mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibWeb: Don't call establishes_stacking_context() during painting
By the time we're painting, we've already built the stacking context tree. So instead of asking if a box establishes a stacking context, we can ask if its paintable *has* a stacking context. This was taking up ~6% of the profile when mousing around on the HTML specification. With this change, it disappears completely. :^)
This commit is contained in:
parent
e31d1620a8
commit
ccc37032a4
1 changed files with 2 additions and 1 deletions
|
@ -52,7 +52,8 @@ void StackingContext::paint_descendants(PaintContext& context, Layout::Node& box
|
|||
}
|
||||
|
||||
box.for_each_child([&](auto& child) {
|
||||
if (child.establishes_stacking_context())
|
||||
// If `child` establishes its own stacking context, skip over it.
|
||||
if (is<Layout::Box>(child) && child.paintable() && static_cast<Layout::Box const&>(child).paint_box()->stacking_context())
|
||||
return;
|
||||
bool child_is_inline_or_replaced = child.is_inline() || is<Layout::ReplacedBox>(child);
|
||||
switch (phase) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue