mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:17:44 +00:00
LibWeb: Rename LayoutNode::is_root() => is_initial_containing_block()
Let's use spec language for this. :^)
This commit is contained in:
parent
e0809f78a9
commit
169a9150cb
6 changed files with 8 additions and 8 deletions
|
@ -48,7 +48,7 @@ BlockFormattingContext::~BlockFormattingContext()
|
||||||
|
|
||||||
bool BlockFormattingContext::is_initial() const
|
bool BlockFormattingContext::is_initial() const
|
||||||
{
|
{
|
||||||
return context_box().is_root();
|
return context_box().is_initial_containing_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockFormattingContext::run(LayoutMode layout_mode)
|
void BlockFormattingContext::run(LayoutMode layout_mode)
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
|
|
||||||
void did_set_viewport_rect(Badge<Frame>, const Gfx::IntRect&);
|
void did_set_viewport_rect(Badge<Frame>, const Gfx::IntRect&);
|
||||||
|
|
||||||
virtual bool is_root() const override { return true; }
|
virtual bool is_initial_containing_block() const override { return true; }
|
||||||
|
|
||||||
void build_stacking_context_tree();
|
void build_stacking_context_tree();
|
||||||
|
|
||||||
|
@ -63,5 +63,5 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
AK_BEGIN_TYPE_TRAITS(Web::Layout::InitialContainingBlockBox)
|
AK_BEGIN_TYPE_TRAITS(Web::Layout::InitialContainingBlockBox)
|
||||||
static bool is_type(const Web::Layout::Node& layout_node) { return layout_node.is_root(); }
|
static bool is_type(const Web::Layout::Node& layout_node) { return layout_node.is_initial_containing_block(); }
|
||||||
AK_END_TYPE_TRAITS()
|
AK_END_TYPE_TRAITS()
|
||||||
|
|
|
@ -52,7 +52,7 @@ Node::~Node()
|
||||||
|
|
||||||
bool Node::can_contain_boxes_with_position_absolute() const
|
bool Node::can_contain_boxes_with_position_absolute() const
|
||||||
{
|
{
|
||||||
return style().position() != CSS::Position::Static || is_root();
|
return style().position() != CSS::Position::Static || is_initial_containing_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockBox* Node::containing_block() const
|
const BlockBox* Node::containing_block() const
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
InitialContainingBlockBox& root();
|
InitialContainingBlockBox& root();
|
||||||
|
|
||||||
virtual const char* class_name() const = 0;
|
virtual const char* class_name() const = 0;
|
||||||
virtual bool is_root() const { return false; }
|
virtual bool is_initial_containing_block() const { return false; }
|
||||||
virtual bool is_text() const { return false; }
|
virtual bool is_text() const { return false; }
|
||||||
virtual bool is_block() const { return false; }
|
virtual bool is_block() const { return false; }
|
||||||
virtual bool is_replaced() const { return false; }
|
virtual bool is_replaced() const { return false; }
|
||||||
|
|
|
@ -119,7 +119,7 @@ GUI::Variant LayoutTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole
|
||||||
{
|
{
|
||||||
auto& node = *static_cast<Layout::Node*>(index.internal_data());
|
auto& node = *static_cast<Layout::Node*>(index.internal_data());
|
||||||
if (role == GUI::ModelRole::Icon) {
|
if (role == GUI::ModelRole::Icon) {
|
||||||
if (node.is_root())
|
if (node.is_initial_containing_block())
|
||||||
return m_document_icon;
|
return m_document_icon;
|
||||||
if (node.is_text())
|
if (node.is_text())
|
||||||
return m_text_icon;
|
return m_text_icon;
|
||||||
|
|
|
@ -49,7 +49,7 @@ StackingContext::StackingContext(Box& box, StackingContext* parent)
|
||||||
|
|
||||||
void StackingContext::paint(PaintContext& context, PaintPhase phase)
|
void StackingContext::paint(PaintContext& context, PaintPhase phase)
|
||||||
{
|
{
|
||||||
if (!m_box.is_root()) {
|
if (!m_box.is_initial_containing_block()) {
|
||||||
m_box.paint(context, phase);
|
m_box.paint(context, phase);
|
||||||
} else {
|
} else {
|
||||||
// NOTE: InitialContainingBlockBox::paint() merely calls StackingContext::paint()
|
// NOTE: InitialContainingBlockBox::paint() merely calls StackingContext::paint()
|
||||||
|
@ -64,7 +64,7 @@ void StackingContext::paint(PaintContext& context, PaintPhase phase)
|
||||||
HitTestResult StackingContext::hit_test(const Gfx::IntPoint& position, HitTestType type) const
|
HitTestResult StackingContext::hit_test(const Gfx::IntPoint& position, HitTestType type) const
|
||||||
{
|
{
|
||||||
HitTestResult result;
|
HitTestResult result;
|
||||||
if (!m_box.is_root()) {
|
if (!m_box.is_initial_containing_block()) {
|
||||||
result = m_box.hit_test(position, type);
|
result = m_box.hit_test(position, type);
|
||||||
} else {
|
} else {
|
||||||
// NOTE: InitialContainingBlockBox::hit_test() merely calls StackingContext::hit_test()
|
// NOTE: InitialContainingBlockBox::hit_test() merely calls StackingContext::hit_test()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue