mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibWeb: Use LibwebLeft and LibwebRight to align table cells
This commit is contained in:
parent
ccea69ad40
commit
5df52a5082
3 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (0,0) content-size 800x228 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (8,8) content-size 784x212 children: not-inline
|
||||||
|
TableWrapper <(anonymous)> at (8,8) content-size 200x212 [BFC] children: not-inline
|
||||||
|
Box <table> at (9,9) content-size 198x210 table-box [TFC] children: not-inline
|
||||||
|
Box <tbody> at (9,9) content-size 194x206 table-row-group children: not-inline
|
||||||
|
Box <tr> at (11,11) content-size 194x206 table-row children: not-inline
|
||||||
|
BlockContainer <td> at (12,12) content-size 192x204 table-cell [BFC] children: not-inline
|
||||||
|
TableWrapper <(anonymous)> at (158.890625,12) content-size 45.109375x204 [BFC] children: not-inline
|
||||||
|
Box <table> at (159.890625,13) content-size 43.109375x202 table-box [TFC] children: not-inline
|
||||||
|
Box <tbody> at (159.890625,13) content-size 39.109375x198 table-row-group children: not-inline
|
||||||
|
Box <tr> at (161.890625,15) content-size 39.109375x198 table-row children: not-inline
|
||||||
|
BlockContainer <td> at (162.890625,105.265625) content-size 37.109375x17.46875 table-cell [BFC] children: inline
|
||||||
|
line 0 width: 37.109375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 5, rect: [162.890625,105.265625 37.109375x17.46875]
|
||||||
|
"right"
|
||||||
|
TextNode <#text>
|
||||||
|
|
||||||
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x228]
|
||||||
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x212]
|
||||||
|
PaintableWithLines (TableWrapper(anonymous)) [8,8 200x212]
|
||||||
|
PaintableBox (Box<TABLE>) [8,8 200x212]
|
||||||
|
PaintableBox (Box<TBODY>) [9,9 194x206] overflow: [9,9 196x208]
|
||||||
|
PaintableBox (Box<TR>) [11,11 194x206]
|
||||||
|
PaintableWithLines (BlockContainer<TD>) [11,11 194x206]
|
||||||
|
PaintableWithLines (TableWrapper(anonymous)) [158.890625,12 45.109375x204]
|
||||||
|
PaintableBox (Box<TABLE>) [158.890625,12 45.109375x204]
|
||||||
|
PaintableBox (Box<TBODY>) [159.890625,13 39.109375x198] overflow: [159.890625,13 41.109375x200]
|
||||||
|
PaintableBox (Box<TR>) [161.890625,15 39.109375x198]
|
||||||
|
PaintableWithLines (BlockContainer<TD>) [161.890625,15 39.109375x198]
|
||||||
|
TextPaintable (TextNode<#text>)
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!doctype html><style>
|
||||||
|
table {
|
||||||
|
height: 200px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style><table width="200px"><td align="right"><table><td>right
|
|
@ -60,6 +60,10 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
|
||||||
if (name == HTML::AttributeNames::align) {
|
if (name == HTML::AttributeNames::align) {
|
||||||
if (value.equals_ignoring_ascii_case("center"sv) || value.equals_ignoring_ascii_case("middle"sv)) {
|
if (value.equals_ignoring_ascii_case("center"sv) || value.equals_ignoring_ascii_case("middle"sv)) {
|
||||||
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebCenter));
|
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebCenter));
|
||||||
|
} else if (value.equals_ignoring_ascii_case("left"sv)) {
|
||||||
|
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebLeft));
|
||||||
|
} else if (value.equals_ignoring_ascii_case("right"sv)) {
|
||||||
|
style.set_property(CSS::PropertyID::TextAlign, CSS::IdentifierStyleValue::create(CSS::ValueID::LibwebRight));
|
||||||
} else {
|
} else {
|
||||||
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value.view(), CSS::PropertyID::TextAlign))
|
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value.view(), CSS::PropertyID::TextAlign))
|
||||||
style.set_property(CSS::PropertyID::TextAlign, parsed_value.release_nonnull());
|
style.set_property(CSS::PropertyID::TextAlign, parsed_value.release_nonnull());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue