mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
LibWeb: Override width calculation for table wrappers
Introduce `TableWrapper` type so table wrappers could be distinguished from block containers and override width calculation for table wrappers (CSS 2.2 spec, section 17.5.2) inside BFCs in the way that their width should be equal to width of table box they wrap.
This commit is contained in:
parent
7526f9a8b7
commit
709fe01f52
8 changed files with 74 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <LibWeb/Layout/TableBox.h>
|
||||
#include <LibWeb/Layout/TableCellBox.h>
|
||||
#include <LibWeb/Layout/TableRowBox.h>
|
||||
#include <LibWeb/Layout/TableWrapper.h>
|
||||
#include <LibWeb/Layout/TextNode.h>
|
||||
#include <LibWeb/Layout/TreeBuilder.h>
|
||||
#include <LibWeb/SVG/SVGForeignObjectElement.h>
|
||||
|
@ -598,7 +599,7 @@ void TreeBuilder::generate_missing_parents(NodeWithStyle& root)
|
|||
mutable_wrapper_computed_values.set_margin(table_box->computed_values().margin());
|
||||
table_box->reset_table_box_computed_values_used_by_wrapper_to_init_values();
|
||||
|
||||
auto wrapper = parent.heap().allocate_without_realm<BlockContainer>(parent.document(), nullptr, move(wrapper_computed_values));
|
||||
auto wrapper = parent.heap().allocate_without_realm<TableWrapper>(parent.document(), nullptr, move(wrapper_computed_values));
|
||||
|
||||
parent.remove_child(*table_box);
|
||||
wrapper->append_child(*table_box);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue