1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

LibWeb: Rename Layout::InitialContainingBlock to Layout::Viewport

The name "initial containing block" was wrong for this, as it doesn't
correspond to the HTML element, and that's specifically what it's
supposed to do! :^)
This commit is contained in:
Andreas Kling 2023-02-25 11:04:29 +01:00
parent 60f699338d
commit 7e76a51cb0
66 changed files with 121 additions and 128 deletions

View file

@ -11,7 +11,7 @@
#include <LibWeb/FontCache.h>
#include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/Viewport.h>
#include <LibWeb/Painting/BackgroundPainting.h>
#include <LibWeb/Painting/FilterPainting.h>
#include <LibWeb/Painting/PaintableBox.h>
@ -141,7 +141,7 @@ Painting::StackingContext* PaintableBox::enclosing_stacking_context()
if (auto* ancestor_paint_box = ancestor_box.paint_box(); ancestor_paint_box && ancestor_paint_box->stacking_context())
return const_cast<StackingContext*>(ancestor_paint_box->stacking_context());
}
// We should always reach the Layout::InitialContainingBlock stacking context.
// We should always reach the Layout::Viewport stacking context.
VERIFY_NOT_REACHED();
}
@ -686,8 +686,8 @@ Optional<HitTestResult> PaintableBox::hit_test(CSSPixelPoint position, HitTestTy
if (!is_visible())
return {};
if (layout_box().is_initial_containing_block_box()) {
const_cast<Layout::InitialContainingBlock&>(static_cast<Layout::InitialContainingBlock const&>(layout_box())).build_stacking_context_tree_if_needed();
if (layout_box().is_viewport()) {
const_cast<Layout::Viewport&>(static_cast<Layout::Viewport const&>(layout_box())).build_stacking_context_tree_if_needed();
return stacking_context()->hit_test(position, type);
}