mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:47:45 +00:00
LibWeb: Parse the CSS transform-box property
This commit is contained in:
parent
c3c7707de4
commit
391cfdc085
8 changed files with 32 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue