mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibWeb: Allow layout nodes to have multiple paintables
CSS fragmentation implies 1:N relationship between layout nodes and paintables. This change is a preparation for implementation of inline fragmentation where InlinePaintable will be replaced with PaintableWithLines corresponding to each line.
This commit is contained in:
parent
a6718e5f3b
commit
7d22b1c5c8
Notes:
github-actions[bot]
2024-10-16 18:26:52 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 7d22b1c5c8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1829
16 changed files with 90 additions and 30 deletions
|
@ -51,6 +51,38 @@ bool Paintable::is_visible() const
|
|||
return computed_values.visibility() == CSS::Visibility::Visible && computed_values.opacity() != 0;
|
||||
}
|
||||
|
||||
DOM::Document const& Paintable::document() const
|
||||
{
|
||||
return layout_node().document();
|
||||
}
|
||||
|
||||
DOM::Document& Paintable::document()
|
||||
{
|
||||
return layout_node().document();
|
||||
}
|
||||
|
||||
CSS::Display Paintable::display() const
|
||||
{
|
||||
return layout_node().display();
|
||||
}
|
||||
|
||||
PaintableBox* Paintable::containing_block() const
|
||||
{
|
||||
if (!m_containing_block.has_value()) {
|
||||
auto containing_layout_box = m_layout_node->containing_block();
|
||||
if (containing_layout_box)
|
||||
m_containing_block = const_cast<PaintableBox*>(containing_layout_box->paintable_box());
|
||||
else
|
||||
m_containing_block = nullptr;
|
||||
}
|
||||
return *m_containing_block;
|
||||
}
|
||||
|
||||
CSS::ImmutableComputedValues const& Paintable::computed_values() const
|
||||
{
|
||||
return m_layout_node->computed_values();
|
||||
}
|
||||
|
||||
void Paintable::set_dom_node(JS::GCPtr<DOM::Node> dom_node)
|
||||
{
|
||||
m_dom_node = dom_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue