mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 03:56:16 +00:00
LibWeb: Add virtuals to check if Paintable is PBox or PWithLines
Instead of inferring the type of paintables by looking at the type of their origin in the layout tree, let's ask them directly.
This commit is contained in:
parent
6b3af92262
commit
136ac1a6a5
Notes:
sideshowbarker
2024-07-17 07:16:27 +09:00
Author: https://github.com/awesomekling
Commit: 136ac1a6a5
Pull-request: https://github.com/SerenityOS/serenity/pull/20661
4 changed files with 16 additions and 7 deletions
|
@ -79,7 +79,7 @@ Optional<HitTestResult> Paintable::hit_test(CSSPixelPoint, HitTestType) const
|
|||
|
||||
StackingContext const* Paintable::stacking_context_rooted_here() const
|
||||
{
|
||||
if (!layout_node().is_box())
|
||||
if (!is<PaintableBox>(*this))
|
||||
return nullptr;
|
||||
return static_cast<PaintableBox const&>(*this).stacking_context();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue