mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:27:35 +00:00
LibWeb: Add support for table caption
Adds layout support and the CSS caption-side property.
This commit is contained in:
parent
656f72adc0
commit
940d9b98ae
15 changed files with 353 additions and 21 deletions
|
@ -35,6 +35,7 @@ public:
|
|||
static int font_weight() { return 400; }
|
||||
static CSS::FontVariant font_variant() { return CSS::FontVariant::Normal; }
|
||||
static CSS::Float float_() { return CSS::Float::None; }
|
||||
static CSS::CaptionSide caption_side() { return CSS::CaptionSide::Top; }
|
||||
static CSS::Clear clear() { return CSS::Clear::None; }
|
||||
static CSS::Clip clip() { return CSS::Clip::make_auto(); }
|
||||
static CSS::Cursor cursor() { return CSS::Cursor::Auto; }
|
||||
|
@ -220,6 +221,7 @@ class ComputedValues {
|
|||
public:
|
||||
AspectRatio aspect_ratio() const { return m_noninherited.aspect_ratio; }
|
||||
CSS::Float float_() const { return m_noninherited.float_; }
|
||||
CSS::CaptionSide caption_side() const { return m_inherited.caption_side; }
|
||||
CSS::Clear clear() const { return m_noninherited.clear; }
|
||||
CSS::Clip clip() const { return m_noninherited.clip; }
|
||||
CSS::Cursor cursor() const { return m_inherited.cursor; }
|
||||
|
@ -328,6 +330,7 @@ protected:
|
|||
float font_size { InitialValues::font_size() };
|
||||
int font_weight { InitialValues::font_weight() };
|
||||
CSS::FontVariant font_variant { InitialValues::font_variant() };
|
||||
CSS::CaptionSide caption_side { InitialValues::caption_side() };
|
||||
Color color { InitialValues::color() };
|
||||
Optional<Color> accent_color {};
|
||||
CSS::Cursor cursor { InitialValues::cursor() };
|
||||
|
@ -431,6 +434,7 @@ public:
|
|||
void set_font_size(float font_size) { m_inherited.font_size = font_size; }
|
||||
void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; }
|
||||
void set_font_variant(CSS::FontVariant font_variant) { m_inherited.font_variant = font_variant; }
|
||||
void set_caption_side(CSS::CaptionSide caption_side) { m_inherited.caption_side = caption_side; }
|
||||
void set_color(Color color) { m_inherited.color = color; }
|
||||
void set_clip(CSS::Clip const& clip) { m_noninherited.clip = clip; }
|
||||
void set_content(ContentData const& content) { m_noninherited.content = content; }
|
||||
|
|
|
@ -84,6 +84,10 @@
|
|||
"border-box",
|
||||
"content-box"
|
||||
],
|
||||
"caption-side": [
|
||||
"top",
|
||||
"bottom"
|
||||
],
|
||||
"clear": [
|
||||
"none",
|
||||
"left",
|
||||
|
|
|
@ -628,9 +628,8 @@
|
|||
"caption-side": {
|
||||
"inherited": true,
|
||||
"initial": "top",
|
||||
"valid-identifiers": [
|
||||
"bottom",
|
||||
"top"
|
||||
"valid-types": [
|
||||
"caption-side"
|
||||
]
|
||||
},
|
||||
"clear": {
|
||||
|
|
|
@ -523,6 +523,9 @@ ErrorOr<RefPtr<StyleValue const>> ResolvedCSSStyleDeclaration::style_value_for_p
|
|||
}
|
||||
case PropertyID::BoxSizing:
|
||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().box_sizing()));
|
||||
case PropertyID::CaptionSide: {
|
||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().caption_side()));
|
||||
}
|
||||
case PropertyID::Clear:
|
||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().clear()));
|
||||
case PropertyID::Clip:
|
||||
|
|
|
@ -373,6 +373,12 @@ Optional<CSS::ImageRendering> StyleProperties::image_rendering() const
|
|||
return value_id_to_image_rendering(value->to_identifier());
|
||||
}
|
||||
|
||||
Optional<CSS::CaptionSide> StyleProperties::caption_side() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::CaptionSide);
|
||||
return value_id_to_caption_side(value->to_identifier());
|
||||
}
|
||||
|
||||
CSS::Clip StyleProperties::clip() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Clip);
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
Color color_or_fallback(CSS::PropertyID, Layout::NodeWithStyle const&, Color fallback) const;
|
||||
Optional<CSS::TextAlign> text_align() const;
|
||||
Optional<CSS::TextJustify> text_justify() const;
|
||||
Optional<CSS::CaptionSide> caption_side() const;
|
||||
CSS::Clip clip() const;
|
||||
CSS::Display display() const;
|
||||
Optional<CSS::Float> float_() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue