Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d927d70696167cf17a12a6d444674b1a8bed5381
      
https://github.com/WebKit/WebKit/commit/d927d70696167cf17a12a6d444674b1a8bed5381
  Author: Simon Fraser <[email protected]>
  Date:   2024-04-17 (Wed, 17 Apr 2024)

  Changed paths:
    M LayoutTests/compositing/visibility/iframe-visibility-hidden-expected.html
    M LayoutTests/compositing/visibility/iframe-visibility-hidden.html
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderLayerCompositor.cpp
    M Source/WebCore/rendering/RenderLayerCompositor.h

  Log Message:
  -----------
  Sometimes the contents of a visibility:hidden iframe become visible
https://bugs.webkit.org/show_bug.cgi?id=272727
rdar://126178201

Reviewed by Matt Woodrow.

A normal composited but `visibility:hidden` layer uses 
`setContentsVisible(false)`
to hide its contents (by clearing the layer's `contents` property), and this 
works
within a document because `visibility` is inherited, and allows a visible child
inside a hidden ancestor.

For plugin or iframe layers we try to avoid making them composited when they
are `visibility:hidden`. However, if they are composited for other reasons (e.g.
`position:fixed`) then we hide their layer contents, but we fail to hide their
descendant layers, which GraphicsLayer parented via 
`attachWidgetContentLayers()`.

Fix this by not parenting the widget's content layers in 
`RenderLayerCompositor::attachWidgetContentLayersIfNecessary()`,
and enhancing the return value to distinguish between "widget has contents via 
child layers", and "mutated the layer hierarchy"
since the two callers were using the return value in two different ways.

Enhance an existing test to exercise this case.
* LayoutTests/compositing/visibility/iframe-visibility-hidden-expected.html:
* LayoutTests/compositing/visibility/iframe-visibility-hidden.html:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::attachWidgetContentLayersIfNecessary):
(WebCore::RenderLayerCompositor::attachWidgetContentLayers): Deleted.
* Source/WebCore/rendering/RenderLayerCompositor.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to