[webkit-reviews] review denied: [Bug 231832] Make sure child layers of top layer elements are rendered and correctly z-ordered (top-layer-stacking.html fails) : [Attachment 441461] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 15 17:30:10 PDT 2021


Simon Fraser (smfr) <simon.fraser at apple.com> has denied Tim Nguyen (:ntim)
<ntim at apple.com>'s request for review:
Bug 231832: Make sure child layers of top layer elements are rendered and
correctly z-ordered (top-layer-stacking.html fails)
https://bugs.webkit.org/show_bug.cgi?id=231832

Attachment 441461: Patch

https://bugs.webkit.org/attachment.cgi?id=441461&action=review




--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 441461
  --> https://bugs.webkit.org/attachment.cgi?id=441461
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441461&action=review

I think the real bug here is that RenderLayer::collectLayers() just early
returns when establishesTopLayer() is true, so top layer layers never get any
children.

> Source/WebCore/rendering/RenderLayer.cpp:768
> +    collectLayersForChildren(includeHiddenLayers, false, posZOrderList,
negZOrderList, accumulatedDirtyFlags);

This is called the "boolean trap": a true/false argument that is hard to
understand here at the call site. We generally avoid this by using enums.

> Source/WebCore/rendering/RenderLayer.cpp:803
> +		   auto startOfSorting = posZOrderList->end();
> +		   layer->collectLayersForChildren(includeHiddenLayers, true,
posZOrderList, negZOrderList, accumulatedDirtyFlags);
> +		   std::stable_sort(startOfSorting, posZOrderList->end(),
compareZIndex);

I don't think this is right. This will append all descendant layers to
'posZOrderList' but what needs to happen is that 'layer' here, which is a
stacking context, builds its own positive and negative z-order lists.

> Source/WebCore/rendering/RenderLayer.cpp:827
> +	   auto& layerList = (zIndex() >= 0 || hasTopLayerAncestor) ?
positiveZOrderList : negativeZOrderList;

Here all descendants of top layer layers append to the positiveZOrderList but
this is wrong.


More information about the webkit-reviews mailing list