at (303,11) content-size 194x198 table-row children: not-inline
+ BlockContainer at (304,85.265625) content-size 192x49.46875 table-cell [BFC] children: not-inline
+ BlockContainer at (304,101.265625) content-size 192x17.46875 children: inline
+ line 0 width: 26.25, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 4, rect: [304,101.265625 26.25x17.46875]
+ "left"
+ TextNode <#text>
+
+ViewportPaintable (Viewport<#document>) [0,0 800x600]
+ PaintableWithLines (BlockContainer) [0,0 800x220]
+ PaintableWithLines (BlockContainer ) [8,8 784x204]
+ PaintableWithLines (BlockContainer) [8,8 784x204]
+ PaintableWithLines (TableWrapper(anonymous)) [300,8 200x204]
+ PaintableBox (Box ) [300,8 200x204]
+ PaintableBox (Box) [301,9 194x198] overflow: [301,9 196x200]
+ PaintableBox (Box) [303,11 194x198]
+ PaintableWithLines (BlockContainer) [303,11 194x198]
+ PaintableWithLines (BlockContainer ) [304,101.265625 192x17.46875]
+ TextPaintable (TextNode<#text>)
diff --git a/Tests/LibWeb/Layout/input/table/internal-alignment.html b/Tests/LibWeb/Layout/input/table/internal-alignment.html
new file mode 100644
index 0000000000..7b74ed32cc
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/table/internal-alignment.html
@@ -0,0 +1,7 @@
+ left
diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp
index 8e85684a3b..e77ee1be16 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Element.cpp
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -45,6 +46,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -552,6 +554,14 @@ Element::RequiredInvalidationAfterStyleChange Element::recompute_style()
// FIXME propagate errors
auto new_computed_css_values = MUST(document().style_computer().compute_style(*this));
+ // Tables must not inherit -libweb-* values for text-align.
+ // FIXME: Find the spec for this.
+ if (is(*this)) {
+ auto text_align = new_computed_css_values->text_align();
+ if (text_align.has_value() && (text_align.value() == CSS::TextAlign::LibwebLeft || text_align.value() == CSS::TextAlign::LibwebCenter || text_align.value() == CSS::TextAlign::LibwebRight))
+ new_computed_css_values->set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::Start));
+ }
+
RequiredInvalidationAfterStyleChange invalidation;
if (m_computed_css_values)
invalidation = compute_required_invalidation(*m_computed_css_values, *new_computed_css_values);
|
| |