mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-07 20:31:04 +03:00
LibWeb: Parse the CSS transform-box property
This commit is contained in:
parent
c3c7707de4
commit
391cfdc085
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/391cfdc085 Pull-request: https://github.com/SerenityOS/serenity/pull/22950
@ -156,6 +156,7 @@ text-shadow: none
|
||||
text-transform: none
|
||||
top: auto
|
||||
transform: none
|
||||
transform-box: view-box
|
||||
transform-origin: 50% 50%
|
||||
transition-delay: 0s
|
||||
user-select: auto
|
||||
|
@ -160,6 +160,7 @@ public:
|
||||
static CSS::Length outline_width() { return CSS::Length::make_px(3); }
|
||||
static CSS::TableLayout table_layout() { return CSS::TableLayout::Auto; }
|
||||
static QuotesData quotes() { return QuotesData { .type = QuotesData::Type::Auto }; }
|
||||
static CSS::TransformBox transform_box() { return CSS::TransformBox::ViewBox; }
|
||||
|
||||
static CSS::MaskType mask_type() { return CSS::MaskType::Luminance; }
|
||||
static CSS::MathShift math_shift() { return CSS::MathShift::Normal; }
|
||||
@ -387,6 +388,7 @@ public:
|
||||
CSS::MaskType mask_type() const { return m_noninherited.mask_type; }
|
||||
|
||||
Vector<CSS::Transformation> const& transformations() const { return m_noninherited.transformations; }
|
||||
CSS::TransformBox const& transform_box() const { return m_noninherited.transform_box; }
|
||||
CSS::TransformOrigin const& transform_origin() const { return m_noninherited.transform_origin; }
|
||||
|
||||
Gfx::FontCascadeList const& font_list() const { return *m_inherited.font_list; }
|
||||
@ -508,6 +510,7 @@ protected:
|
||||
float opacity { InitialValues::opacity() };
|
||||
Vector<ShadowData> box_shadow {};
|
||||
Vector<CSS::Transformation> transformations {};
|
||||
CSS::TransformBox transform_box { InitialValues::transform_box() };
|
||||
CSS::TransformOrigin transform_origin {};
|
||||
CSS::BoxSizing box_sizing { InitialValues::box_sizing() };
|
||||
CSS::ContentData content;
|
||||
@ -620,6 +623,7 @@ public:
|
||||
void set_justify_self(CSS::JustifySelf value) { m_noninherited.justify_self = value; }
|
||||
void set_box_shadow(Vector<ShadowData>&& value) { m_noninherited.box_shadow = move(value); }
|
||||
void set_transformations(Vector<CSS::Transformation> value) { m_noninherited.transformations = move(value); }
|
||||
void set_transform_box(CSS::TransformBox value) { m_noninherited.transform_box = value; }
|
||||
void set_transform_origin(CSS::TransformOrigin value) { m_noninherited.transform_origin = value; }
|
||||
void set_box_sizing(CSS::BoxSizing value) { m_noninherited.box_sizing = value; }
|
||||
void set_vertical_align(Variant<CSS::VerticalAlign, CSS::LengthPercentage> value) { m_noninherited.vertical_align = move(value); }
|
||||
|
@ -396,6 +396,13 @@
|
||||
"none",
|
||||
"uppercase"
|
||||
],
|
||||
"transform-box": [
|
||||
"content-box",
|
||||
"border-box",
|
||||
"fill-box",
|
||||
"stroke-box",
|
||||
"view-box "
|
||||
],
|
||||
"vertical-align": [
|
||||
"baseline",
|
||||
"bottom",
|
||||
|
@ -153,6 +153,7 @@
|
||||
"fieldtext",
|
||||
"fine",
|
||||
"fill",
|
||||
"fill-box",
|
||||
"fit-content",
|
||||
"fixed",
|
||||
"flex",
|
||||
@ -333,6 +334,7 @@
|
||||
"static",
|
||||
"sticky",
|
||||
"stretch",
|
||||
"stroke-box",
|
||||
"sub",
|
||||
"subtractive",
|
||||
"super",
|
||||
@ -377,6 +379,7 @@
|
||||
"upper-roman",
|
||||
"uppercase",
|
||||
"vertical-text",
|
||||
"view-box",
|
||||
"visible",
|
||||
"visitedtext",
|
||||
"w-resize",
|
||||
|
@ -2082,6 +2082,14 @@
|
||||
"affects-layout": false,
|
||||
"affects-stacking-context": true
|
||||
},
|
||||
"transform-box": {
|
||||
"inherited": false,
|
||||
"initial": "view-box",
|
||||
"affects-layout": false,
|
||||
"valid-types": [
|
||||
"transform-box"
|
||||
]
|
||||
},
|
||||
"transform-origin": {
|
||||
"affects-layout": false,
|
||||
"inherited": false,
|
||||
|
@ -493,6 +493,12 @@ static Optional<LengthPercentage> length_percentage_for_style_value(StyleValue c
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<CSS::TransformBox> StyleProperties::transform_box() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::TransformBox);
|
||||
return value_id_to_transform_box(value->to_identifier());
|
||||
}
|
||||
|
||||
CSS::TransformOrigin StyleProperties::transform_origin() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::TransformOrigin);
|
||||
|
@ -119,6 +119,7 @@ public:
|
||||
|
||||
static Vector<CSS::Transformation> transformations_for_style_value(StyleValue const& value);
|
||||
Vector<CSS::Transformation> transformations() const;
|
||||
Optional<CSS::TransformBox> transform_box() const;
|
||||
CSS::TransformOrigin transform_origin() const;
|
||||
|
||||
Optional<CSS::MaskType> mask_type() const;
|
||||
|
@ -669,6 +669,8 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
||||
computed_values.set_box_shadow(computed_style.box_shadow(*this));
|
||||
|
||||
computed_values.set_transformations(computed_style.transformations());
|
||||
if (auto transform_box = computed_style.transform_box(); transform_box.has_value())
|
||||
computed_values.set_transform_box(transform_box.value());
|
||||
computed_values.set_transform_origin(computed_style.transform_origin());
|
||||
|
||||
auto transition_delay_property = computed_style.property(CSS::PropertyID::TransitionDelay);
|
||||
|
Loading…
Reference in New Issue
Block a user