mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 21:35:07 +00:00
LibWeb: Add support for justify-self property in CSS parser
This commit is contained in:
parent
fbab9bc330
commit
fedbb39e9e
7 changed files with 39 additions and 0 deletions
|
@ -66,6 +66,7 @@ public:
|
||||||
static CSS::FlexBasis flex_basis() { return CSS::Size::make_auto(); }
|
static CSS::FlexBasis flex_basis() { return CSS::Size::make_auto(); }
|
||||||
static CSS::ImageRendering image_rendering() { return CSS::ImageRendering::Auto; }
|
static CSS::ImageRendering image_rendering() { return CSS::ImageRendering::Auto; }
|
||||||
static CSS::JustifyContent justify_content() { return CSS::JustifyContent::FlexStart; }
|
static CSS::JustifyContent justify_content() { return CSS::JustifyContent::FlexStart; }
|
||||||
|
static CSS::JustifySelf justify_self() { return CSS::JustifySelf::Auto; }
|
||||||
static CSS::AlignContent align_content() { return CSS::AlignContent::Stretch; }
|
static CSS::AlignContent align_content() { return CSS::AlignContent::Stretch; }
|
||||||
static CSS::AlignItems align_items() { return CSS::AlignItems::Stretch; }
|
static CSS::AlignItems align_items() { return CSS::AlignItems::Stretch; }
|
||||||
static CSS::AlignSelf align_self() { return CSS::AlignSelf::Auto; }
|
static CSS::AlignSelf align_self() { return CSS::AlignSelf::Auto; }
|
||||||
|
@ -253,6 +254,7 @@ public:
|
||||||
CSS::Visibility visibility() const { return m_inherited.visibility; }
|
CSS::Visibility visibility() const { return m_inherited.visibility; }
|
||||||
CSS::ImageRendering image_rendering() const { return m_inherited.image_rendering; }
|
CSS::ImageRendering image_rendering() const { return m_inherited.image_rendering; }
|
||||||
CSS::JustifyContent justify_content() const { return m_noninherited.justify_content; }
|
CSS::JustifyContent justify_content() const { return m_noninherited.justify_content; }
|
||||||
|
CSS::JustifySelf justify_self() const { return m_noninherited.justify_self; }
|
||||||
CSS::BackdropFilter const& backdrop_filter() const { return m_noninherited.backdrop_filter; }
|
CSS::BackdropFilter const& backdrop_filter() const { return m_noninherited.backdrop_filter; }
|
||||||
Vector<ShadowData> const& box_shadow() const { return m_noninherited.box_shadow; }
|
Vector<ShadowData> const& box_shadow() const { return m_noninherited.box_shadow; }
|
||||||
CSS::BoxSizing box_sizing() const { return m_noninherited.box_sizing; }
|
CSS::BoxSizing box_sizing() const { return m_noninherited.box_sizing; }
|
||||||
|
@ -401,6 +403,7 @@ protected:
|
||||||
CSS::AlignSelf align_self { InitialValues::align_self() };
|
CSS::AlignSelf align_self { InitialValues::align_self() };
|
||||||
CSS::Appearance appearance { InitialValues::appearance() };
|
CSS::Appearance appearance { InitialValues::appearance() };
|
||||||
CSS::JustifyContent justify_content { InitialValues::justify_content() };
|
CSS::JustifyContent justify_content { InitialValues::justify_content() };
|
||||||
|
CSS::JustifySelf justify_self { InitialValues::justify_self() };
|
||||||
CSS::Overflow overflow_x { InitialValues::overflow() };
|
CSS::Overflow overflow_x { InitialValues::overflow() };
|
||||||
CSS::Overflow overflow_y { InitialValues::overflow() };
|
CSS::Overflow overflow_y { InitialValues::overflow() };
|
||||||
float opacity { InitialValues::opacity() };
|
float opacity { InitialValues::opacity() };
|
||||||
|
@ -502,6 +505,7 @@ public:
|
||||||
void set_appearance(CSS::Appearance value) { m_noninherited.appearance = value; }
|
void set_appearance(CSS::Appearance value) { m_noninherited.appearance = value; }
|
||||||
void set_opacity(float value) { m_noninherited.opacity = value; }
|
void set_opacity(float value) { m_noninherited.opacity = value; }
|
||||||
void set_justify_content(CSS::JustifyContent value) { m_noninherited.justify_content = value; }
|
void set_justify_content(CSS::JustifyContent value) { m_noninherited.justify_content = value; }
|
||||||
|
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_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_transformations(Vector<CSS::Transformation> value) { m_noninherited.transformations = move(value); }
|
||||||
void set_transform_origin(CSS::TransformOrigin value) { m_noninherited.transform_origin = value; }
|
void set_transform_origin(CSS::TransformOrigin value) { m_noninherited.transform_origin = value; }
|
||||||
|
|
|
@ -176,6 +176,21 @@
|
||||||
"space-around",
|
"space-around",
|
||||||
"space-evenly"
|
"space-evenly"
|
||||||
],
|
],
|
||||||
|
"justify-self": [
|
||||||
|
"auto",
|
||||||
|
"baseline",
|
||||||
|
"center",
|
||||||
|
"end",
|
||||||
|
"flex-end",
|
||||||
|
"flex-start",
|
||||||
|
"normal",
|
||||||
|
"safe",
|
||||||
|
"self-end",
|
||||||
|
"self-start",
|
||||||
|
"start",
|
||||||
|
"stretch",
|
||||||
|
"unsafe"
|
||||||
|
],
|
||||||
"line-style": [
|
"line-style": [
|
||||||
"none",
|
"none",
|
||||||
"hidden",
|
"hidden",
|
||||||
|
|
|
@ -1260,6 +1260,13 @@
|
||||||
"justify-content"
|
"justify-content"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"justify-self": {
|
||||||
|
"inherited": false,
|
||||||
|
"initial": "auto",
|
||||||
|
"valid-types": [
|
||||||
|
"justify-self"
|
||||||
|
]
|
||||||
|
},
|
||||||
"left": {
|
"left": {
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
|
|
@ -691,6 +691,8 @@ ErrorOr<RefPtr<StyleValue const>> ResolvedCSSStyleDeclaration::style_value_for_p
|
||||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().image_rendering()));
|
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().image_rendering()));
|
||||||
case PropertyID::JustifyContent:
|
case PropertyID::JustifyContent:
|
||||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().justify_content()));
|
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().justify_content()));
|
||||||
|
case PropertyID::JustifySelf:
|
||||||
|
return TRY(IdentifierStyleValue::create(to_value_id(layout_node.computed_values().justify_self())));
|
||||||
case PropertyID::Left:
|
case PropertyID::Left:
|
||||||
return style_value_for_length_percentage(layout_node.computed_values().inset().left());
|
return style_value_for_length_percentage(layout_node.computed_values().inset().left());
|
||||||
case PropertyID::LineHeight:
|
case PropertyID::LineHeight:
|
||||||
|
|
|
@ -405,6 +405,12 @@ Optional<CSS::JustifyContent> StyleProperties::justify_content() const
|
||||||
return value_id_to_justify_content(value->to_identifier());
|
return value_id_to_justify_content(value->to_identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<CSS::JustifySelf> StyleProperties::justify_self() const
|
||||||
|
{
|
||||||
|
auto value = property(CSS::PropertyID::JustifySelf);
|
||||||
|
return value_id_to_justify_self(value->to_identifier());
|
||||||
|
}
|
||||||
|
|
||||||
Vector<CSS::Transformation> StyleProperties::transformations() const
|
Vector<CSS::Transformation> StyleProperties::transformations() const
|
||||||
{
|
{
|
||||||
auto value = property(CSS::PropertyID::Transform);
|
auto value = property(CSS::PropertyID::Transform);
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
Optional<CSS::Visibility> visibility() const;
|
Optional<CSS::Visibility> visibility() const;
|
||||||
Optional<CSS::ImageRendering> image_rendering() const;
|
Optional<CSS::ImageRendering> image_rendering() const;
|
||||||
Optional<CSS::JustifyContent> justify_content() const;
|
Optional<CSS::JustifyContent> justify_content() const;
|
||||||
|
Optional<CSS::JustifySelf> justify_self() const;
|
||||||
Optional<CSS::Overflow> overflow_x() const;
|
Optional<CSS::Overflow> overflow_x() const;
|
||||||
Optional<CSS::Overflow> overflow_y() const;
|
Optional<CSS::Overflow> overflow_y() const;
|
||||||
Vector<CSS::ShadowData> box_shadow(Layout::Node const&) const;
|
Vector<CSS::ShadowData> box_shadow(Layout::Node const&) const;
|
||||||
|
|
|
@ -491,6 +491,10 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
|
||||||
if (justify_content.has_value())
|
if (justify_content.has_value())
|
||||||
computed_values.set_justify_content(justify_content.value());
|
computed_values.set_justify_content(justify_content.value());
|
||||||
|
|
||||||
|
auto justify_self = computed_style.justify_self();
|
||||||
|
if (justify_self.has_value())
|
||||||
|
computed_values.set_justify_self(justify_self.value());
|
||||||
|
|
||||||
auto accent_color = computed_style.accent_color(*this);
|
auto accent_color = computed_style.accent_color(*this);
|
||||||
if (accent_color.has_value())
|
if (accent_color.has_value())
|
||||||
computed_values.set_accent_color(accent_color.value());
|
computed_values.set_accent_color(accent_color.value());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue