mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Handle interpolation of BorderRadius style value type
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
b3e8784f92
commit
fff09ed330
Notes:
github-actions[bot]
2025-09-14 15:50:21 +00:00
Author: https://github.com/MFMF-EGY 🔰
Commit: fff09ed330
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6167
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 148 additions and 128 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/CSS/StyleValues/AngleStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/BorderImageSliceStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/FontStyleStyleValue.h>
|
||||
|
@ -1193,6 +1194,19 @@ static RefPtr<StyleValue const> interpolate_value_impl(DOM::Element& element, Ca
|
|||
interpolated_left.release_nonnull(),
|
||||
from_border_image_slice.fill());
|
||||
}
|
||||
case StyleValue::Type::BorderRadius: {
|
||||
auto const& from_horizontal_radius = from.as_border_radius().horizontal_radius();
|
||||
auto const& to_horizontal_radius = to.as_border_radius().horizontal_radius();
|
||||
auto const& from_vertical_radius = from.as_border_radius().vertical_radius();
|
||||
auto const& to_vertical_radius = to.as_border_radius().vertical_radius();
|
||||
auto const interpolated_horizontal_radius = interpolate_length_percentage(calculation_context, from_horizontal_radius, to_horizontal_radius, delta);
|
||||
auto const interpolated_vertical_radius = interpolate_length_percentage(calculation_context, from_vertical_radius, to_vertical_radius, delta);
|
||||
if (!interpolated_horizontal_radius.has_value() || !interpolated_vertical_radius.has_value())
|
||||
return {};
|
||||
return BorderRadiusStyleValue::create(
|
||||
interpolated_horizontal_radius.value(),
|
||||
interpolated_vertical_radius.value());
|
||||
}
|
||||
case StyleValue::Type::Color: {
|
||||
ColorResolutionContext color_resolution_context {};
|
||||
if (auto node = element.layout_node()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue