Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc12d007e2e9ea083b66ce8d6cc42b9fd8c9a389
      
https://github.com/WebKit/WebKit/commit/cc12d007e2e9ea083b66ce8d6cc42b9fd8c9a389
  Author: Matt Woodrow <[email protected]>
  Date:   2023-12-11 (Mon, 11 Dec 2023)

  Changed paths:
    A 
LayoutTests/compositing/layer-creation/overlap-transformed-clip-expected.html
    A LayoutTests/compositing/layer-creation/overlap-transformed-clip.html
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp

  Log Message:
  -----------
  Second div within a rotated and overflow:hidden parent div does not render.
https://bugs.webkit.org/show_bug.cgi?id=265480
<rdar://118901069>

Reviewed by Simon Fraser.

RenderLayerCompositor::addToOverlapMap takes layer overlap bounds in the root 
coordinate space, computes
the clip in the root coordinate space and intersect them.

RenderLayer::calculateClipRects was only ever applying an offset when 
converting clips to an ancestor coordinate
space, which is incorrect if there is a non-tranlation transform (like the 
rotation in the testcase).

The incorrect clip resulted in an empty overlap area, and us drawing the green 
div into the backing store behind
the composited (3d transformed) div.

This makes calculateClipRects transform the clip quad, not just the top-left 
point.

* 
LayoutTests/compositing/layer-creation/overlap-transformed-clip-expected.html: 
Added.
* LayoutTests/compositing/layer-creation/overlap-transformed-clip.html: Added.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::intersectsWithAncestor):

Canonical link: https://commits.webkit.org/271894@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to