@@ -297,6 +297,7 @@ class StyleValue : public RefCounted<StyleValue> {
297
297
Calculated,
298
298
Color,
299
299
CombinedBorderRadius,
300
+ Content,
300
301
Flex,
301
302
FlexFlow,
302
303
Font,
@@ -333,6 +334,7 @@ class StyleValue : public RefCounted<StyleValue> {
333
334
bool is_box_shadow () const { return type () == Type::BoxShadow; }
334
335
bool is_calculated () const { return type () == Type::Calculated; }
335
336
bool is_color () const { return type () == Type::Color; }
337
+ bool is_content () const { return type () == Type::Content; }
336
338
bool is_flex () const { return type () == Type::Flex; }
337
339
bool is_flex_flow () const { return type () == Type::FlexFlow; }
338
340
bool is_font () const { return type () == Type::Font; }
@@ -367,6 +369,7 @@ class StyleValue : public RefCounted<StyleValue> {
367
369
BoxShadowStyleValue const & as_box_shadow () const ;
368
370
CalculatedStyleValue const & as_calculated () const ;
369
371
ColorStyleValue const & as_color () const ;
372
+ ContentStyleValue const & as_content () const ;
370
373
FlexFlowStyleValue const & as_flex_flow () const ;
371
374
FlexStyleValue const & as_flex () const ;
372
375
FontStyleValue const & as_font () const ;
@@ -399,6 +402,7 @@ class StyleValue : public RefCounted<StyleValue> {
399
402
BoxShadowStyleValue& as_box_shadow () { return const_cast <BoxShadowStyleValue&>(const_cast <StyleValue const &>(*this ).as_box_shadow ()); }
400
403
CalculatedStyleValue& as_calculated () { return const_cast <CalculatedStyleValue&>(const_cast <StyleValue const &>(*this ).as_calculated ()); }
401
404
ColorStyleValue& as_color () { return const_cast <ColorStyleValue&>(const_cast <StyleValue const &>(*this ).as_color ()); }
405
+ ContentStyleValue& as_content () { return const_cast <ContentStyleValue&>(const_cast <StyleValue const &>(*this ).as_content ()); }
402
406
FlexFlowStyleValue& as_flex_flow () { return const_cast <FlexFlowStyleValue&>(const_cast <StyleValue const &>(*this ).as_flex_flow ()); }
403
407
FlexStyleValue& as_flex () { return const_cast <FlexStyleValue&>(const_cast <StyleValue const &>(*this ).as_flex ()); }
404
408
FontStyleValue& as_font () { return const_cast <FontStyleValue&>(const_cast <StyleValue const &>(*this ).as_font ()); }
@@ -969,6 +973,31 @@ class CombinedBorderRadiusStyleValue final : public StyleValue {
969
973
NonnullRefPtr<BorderRadiusStyleValue> m_bottom_left;
970
974
};
971
975
976
+ class ContentStyleValue final : public StyleValue {
977
+ public:
978
+ static NonnullRefPtr<ContentStyleValue> create (NonnullRefPtr<StyleValueList> content, RefPtr<StyleValueList> alt_text)
979
+ {
980
+ return adopt_ref (*new ContentStyleValue (move (content), move (alt_text)));
981
+ }
982
+
983
+ StyleValueList const & content () const { return *m_content; }
984
+ bool has_alt_text () const { return !m_alt_text.is_null (); }
985
+ StyleValueList const * alt_text () const { return m_alt_text; }
986
+
987
+ virtual String to_string () const override ;
988
+
989
+ private:
990
+ ContentStyleValue (NonnullRefPtr<StyleValueList> content, RefPtr<StyleValueList> alt_text)
991
+ : StyleValue(Type::Content)
992
+ , m_content(move(content))
993
+ , m_alt_text(move(alt_text))
994
+ {
995
+ }
996
+
997
+ NonnullRefPtr<StyleValueList> m_content;
998
+ RefPtr<StyleValueList> m_alt_text;
999
+ };
1000
+
972
1001
class FlexStyleValue final : public StyleValue {
973
1002
public:
974
1003
static NonnullRefPtr<FlexStyleValue> create (
0 commit comments