Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bba8d155dff7ddba32eda78e56d0bafdda239f68
      
https://github.com/WebKit/WebKit/commit/bba8d155dff7ddba32eda78e56d0bafdda239f68
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-06-01 (Sun, 01 Jun 2025)

  Changed paths:
    M 
LayoutTests/fast/page-color-sampling/color-sampling-includes-subframes-expected.txt
    M 
LayoutTests/fast/page-color-sampling/color-sampling-includes-subframes.html
    M Source/WebCore/page/LocalFrameView.cpp

  Log Message:
  -----------
  [Page color sampling] Fixed element detection may incorrectly ignore subframes
https://bugs.webkit.org/show_bug.cgi?id=293883
rdar://151981818

Reviewed by Richard Robinson.

The heuristic in `isHiddenOrNearlyTransparent` is currently too restrictive, in 
the case where the
hit-tested element is a subframe. In particular, `!box.hasBackground() && 
!box.firstChild()` check
was intended to avoid color-sampling fixed containers without backgrounds or 
any rendered children,
but in the case where the hit-tested element is a fixed-position subframe, the 
frame owner element
won't have any children in the render tree (despite the fact that it may have a 
content document/
frame with rendered children).

Fix this by simply adding `!is<RenderReplaced>` as an additional constraint to 
this check, to ensure
that we correctly detect and sample content inside fixed subframes (and other 
renderer types like
images or videos, which may be visually non-empty).

* 
LayoutTests/fast/page-color-sampling/color-sampling-includes-subframes-expected.txt:
* LayoutTests/fast/page-color-sampling/color-sampling-includes-subframes.html:

Augment an existing layout test, to also cover the case where the `iframe` 
itself is fixed (as
opposed to being contained in a fixed-position container).

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::isHiddenOrNearlyTransparent):

See above.

Canonical link: https://commits.webkit.org/295667@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