mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Wrap table roots in anonymous block boxes
According to table fixup algorithm: https://www.w3.org/TR/css-tables-3/#fixup-algorithm around every table-root should be generated anonymous box wrapper. Also this patch implements important part of CSS 2.2 spec that is currently not present in CSS Tables 3 spec draft: https://www.w3.org/TR/CSS22/tables.html#model that portion of computed properties should be moved from table-root to table wrapper box. Without having this part implemented height of absolutely positioned table with `height: auto` won't be computed correctly.
This commit is contained in:
parent
e107c83a57
commit
57940f4370
3 changed files with 43 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <LibWeb/Layout/FormattingContext.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Layout/TableBox.h>
|
||||
#include <LibWeb/Layout/TextNode.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
|
||||
|
@ -666,6 +667,17 @@ JS::NonnullGCPtr<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const
|
|||
return *wrapper;
|
||||
}
|
||||
|
||||
void NodeWithStyle::reset_table_box_computed_values_used_by_wrapper_to_init_values()
|
||||
{
|
||||
VERIFY(is<TableBox>(*this));
|
||||
|
||||
CSS::MutableComputedValues& mutable_computed_values = static_cast<CSS::MutableComputedValues&>(m_computed_values);
|
||||
mutable_computed_values.set_position(CSS::Position::Static);
|
||||
mutable_computed_values.set_float(CSS::Float::None);
|
||||
mutable_computed_values.set_inset({ CSS::Length::make_auto(), CSS::Length::make_auto(), CSS::Length::make_auto(), CSS::Length::make_auto() });
|
||||
mutable_computed_values.set_margin({ CSS::Length::make_px(0), CSS::Length::make_px(0), CSS::Length::make_px(0), CSS::Length::make_px(0) });
|
||||
}
|
||||
|
||||
void Node::set_paintable(RefPtr<Painting::Paintable> paintable)
|
||||
{
|
||||
m_paintable = move(paintable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue