Browse Source

LibWeb: Remove inheritance of `TableBox` from `BlockContainer`

Fixup rule that table roots need to be wrapped in anonymous
block boxes need to be implemeted instead of having `TableBox`
inherited from `BlockContainer`.
Aliaksandr Kalenik 2 years ago
parent
commit
e107c83a57

+ 2 - 2
Userland/Libraries/LibWeb/Layout/TableBox.cpp

@@ -10,12 +10,12 @@
 namespace Web::Layout {
 namespace Web::Layout {
 
 
 TableBox::TableBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
 TableBox::TableBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
-    : Layout::BlockContainer(document, element, move(style))
+    : Layout::Box(document, element, move(style))
 {
 {
 }
 }
 
 
 TableBox::TableBox(DOM::Document& document, DOM::Element* element, CSS::ComputedValues computed_values)
 TableBox::TableBox(DOM::Document& document, DOM::Element* element, CSS::ComputedValues computed_values)
-    : Layout::BlockContainer(document, element, move(computed_values))
+    : Layout::Box(document, element, move(computed_values))
 {
 {
 }
 }
 
 

+ 3 - 3
Userland/Libraries/LibWeb/Layout/TableBox.h

@@ -6,12 +6,12 @@
 
 
 #pragma once
 #pragma once
 
 
-#include <LibWeb/Layout/BlockContainer.h>
+#include <LibWeb/Layout/Box.h>
 
 
 namespace Web::Layout {
 namespace Web::Layout {
 
 
-class TableBox final : public Layout::BlockContainer {
-    JS_CELL(TableBox, BlockContainer);
+class TableBox final : public Layout::Box {
+    JS_CELL(TableBox, Box);
 
 
 public:
 public:
     TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
     TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);

+ 1 - 1
Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp

@@ -36,7 +36,7 @@ struct Traits<GridPosition> : public GenericTraits<GridPosition> {
 
 
 namespace Web::Layout {
 namespace Web::Layout {
 
 
-TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& root, FormattingContext* parent)
+TableFormattingContext::TableFormattingContext(LayoutState& state, TableBox const& root, FormattingContext* parent)
     : FormattingContext(Type::Table, state, root, parent)
     : FormattingContext(Type::Table, state, root, parent)
 {
 {
 }
 }

+ 1 - 1
Userland/Libraries/LibWeb/Layout/TableFormattingContext.h

@@ -13,7 +13,7 @@ namespace Web::Layout {
 
 
 class TableFormattingContext final : public FormattingContext {
 class TableFormattingContext final : public FormattingContext {
 public:
 public:
-    explicit TableFormattingContext(LayoutState&, BlockContainer const&, FormattingContext* parent);
+    explicit TableFormattingContext(LayoutState&, TableBox const&, FormattingContext* parent);
     ~TableFormattingContext();
     ~TableFormattingContext();
 
 
     virtual void run(Box const&, LayoutMode, AvailableSpace const&) override;
     virtual void run(Box const&, LayoutMode, AvailableSpace const&) override;