mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:15:07 +00:00
LibHTML: Add is<T> and to<T> helpers for LayoutNode class family
This commit is contained in:
parent
bbee1c5b98
commit
d14b60533f
6 changed files with 75 additions and 5 deletions
|
@ -31,8 +31,8 @@ void LayoutNode::layout()
|
|||
const LayoutBlock* LayoutNode::containing_block() const
|
||||
{
|
||||
for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
if (ancestor->is_block())
|
||||
return static_cast<const LayoutBlock*>(ancestor);
|
||||
if (is<LayoutBlock>(*ancestor))
|
||||
return to<LayoutBlock>(ancestor);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue