diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-03 17:36:06 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-03 17:36:06 +0200 |
commit | d68c1effcb874f0d0180447e62d2336edac73589 (patch) | |
tree | d911b0932abad43ce99b350a25e65aa3ecc49be0 | |
parent | f908a2718a7b1ecc7d8bea790596d02856c48356 (diff) | |
download | serenity-d68c1effcb874f0d0180447e62d2336edac73589.zip |
LibHTML: Remove unused LayoutInline::layout()
Inline layout now happens in the containing block, specifically in
LayoutBlock::layout_inline_children().
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutInline.cpp | 27 | ||||
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutInline.h | 3 |
2 files changed, 0 insertions, 30 deletions
diff --git a/Libraries/LibHTML/Layout/LayoutInline.cpp b/Libraries/LibHTML/Layout/LayoutInline.cpp index 687a78b8ed..6b403df5cf 100644 --- a/Libraries/LibHTML/Layout/LayoutInline.cpp +++ b/Libraries/LibHTML/Layout/LayoutInline.cpp @@ -1,4 +1,3 @@ -#include <LibHTML/DOM/Element.h> #include <LibHTML/Layout/LayoutBlock.h> #include <LibHTML/Layout/LayoutInline.h> @@ -11,32 +10,6 @@ LayoutInline::~LayoutInline() { } -void LayoutInline::layout() -{ - Point origin; - - if (previous_sibling() != nullptr) { - auto& previous_sibling_rect = previous_sibling()->rect(); - auto& previous_sibling_style = previous_sibling()->style(); - origin = previous_sibling_rect.location(); - // FIXME: Implement proper inline positioning when - // there are nodes with different heights. And don't - // hardcode font size like we do here. - origin.move_by(previous_sibling_rect.width(), previous_sibling_rect.height()); - origin.move_by(previous_sibling_style.full_margin().right, -11); - } else { - origin = parent()->rect().location(); - } - - rect().set_location(origin); - - for_each_child([&](auto& child) { - child.layout(); - rect().set_right(child.rect().right() + child.style().full_margin().right); - rect().set_bottom(child.rect().bottom() + child.style().full_margin().bottom); - }); -} - void LayoutInline::split_into_lines(LayoutBlock& container) { for_each_child([&](auto& child) { diff --git a/Libraries/LibHTML/Layout/LayoutInline.h b/Libraries/LibHTML/Layout/LayoutInline.h index c8dcfb0625..eb387c04bf 100644 --- a/Libraries/LibHTML/Layout/LayoutInline.h +++ b/Libraries/LibHTML/Layout/LayoutInline.h @@ -2,7 +2,6 @@ #include <LibHTML/Layout/LayoutNode.h> -class Element; class LayoutBlock; class LayoutInline : public LayoutNode { @@ -13,8 +12,6 @@ public: virtual const char* class_name() const override { return "LayoutInline"; } virtual bool is_inline() const override { return true; } - virtual void layout() override; - virtual void split_into_lines(LayoutBlock& container); private: |