summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-01 18:55:47 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-01 18:56:49 +0100
commit07dd73c3510f6bd9f569e101f60e5bf6a1614108 (patch)
tree0fc36cf0b67dc968ccd22e1311a4dde315ac791b /Libraries/LibWeb/Layout/BlockFormattingContext.cpp
parent3bb0cb2202a487303ece7444b4805fd0d30c97ed (diff)
downloadserenity-07dd73c3510f6bd9f569e101f60e5bf6a1614108.zip
LibWeb: Remove hand-rolled is_foo() helpers in Layout::Node classes
Diffstat (limited to 'Libraries/LibWeb/Layout/BlockFormattingContext.cpp')
-rw-r--r--Libraries/LibWeb/Layout/BlockFormattingContext.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index 245efc6361..402a86f127 100644
--- a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -48,7 +48,7 @@ BlockFormattingContext::~BlockFormattingContext()
bool BlockFormattingContext::is_initial() const
{
- return context_box().is_initial_containing_block();
+ return is<InitialContainingBlockBox>(context_box());
}
void BlockFormattingContext::run(Box& box, LayoutMode layout_mode)
@@ -85,7 +85,7 @@ void BlockFormattingContext::run(Box& box, LayoutMode layout_mode)
void BlockFormattingContext::compute_width(Box& box)
{
- if (box.is_replaced()) {
+ if (is<ReplacedBox>(box)) {
// FIXME: This should not be done *by* ReplacedBox
auto& replaced = downcast<ReplacedBox>(box);
replaced.prepare_for_replaced_layout();
@@ -414,7 +414,7 @@ void BlockFormattingContext::compute_width_for_absolutely_positioned_block(Box&
void BlockFormattingContext::compute_height(Box& box)
{
- if (box.is_replaced()) {
+ if (is<ReplacedBox>(box)) {
compute_height_for_block_level_replaced_element_in_normal_flow(downcast<ReplacedBox>(box));
return;
}
@@ -471,9 +471,9 @@ void BlockFormattingContext::layout_block_level_children(Box& box, LayoutMode la
layout_inside(child_box, layout_mode);
compute_height(child_box);
- if (child_box.is_replaced())
+ if (is<ReplacedBox>(child_box))
place_block_level_replaced_element_in_normal_flow(child_box, box);
- else if (child_box.is_block())
+ else if (is<BlockBox>(child_box))
place_block_level_non_replaced_element_in_normal_flow(child_box, box);
// FIXME: This should be factored differently. It's uncool that we mutate the tree *during* layout!