Bug 229317 - Ancestors with opacity should not affect top layer elements
Summary: Ancestors with opacity should not affect top layer elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on: 229350
Blocks: dialog-element
  Show dependency treegraph
 
Reported: 2021-08-19 17:56 PDT by Tim Nguyen (:ntim)
Modified: 2021-08-20 13:51 PDT (History)
14 users (show)

See Also:


Attachments
Patch (4.91 KB, patch)
2021-08-20 00:00 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2021-08-19 17:56:03 PDT
From: https://fullscreen.spec.whatwg.org/#new-stacking-layer

Ancestor elements with overflow, opacity, masks, etc. cannot affect it.
Comment 1 Tim Nguyen (:ntim) 2021-08-19 18:00:32 PDT
This needs a test too, unfortunately there's no WPT for this.
Comment 2 Radar WebKit Bug Importer 2021-08-19 23:23:53 PDT
<rdar://problem/82158248>
Comment 3 Tim Nguyen (:ntim) 2021-08-19 23:56:31 PDT
https://github.com/web-platform-tests/wpt/pull/30104
Comment 4 Tim Nguyen (:ntim) 2021-08-20 00:00:53 PDT
Created attachment 435945 [details]
Patch
Comment 5 EWS Watchlist 2021-08-20 00:01:55 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 6 EWS 2021-08-20 01:04:02 PDT
Committed r281299 (240723@main): <https://commits.webkit.org/240723@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435945 [details].
Comment 7 Simon Fraser (smfr) 2021-08-20 11:43:49 PDT
Comment on attachment 435945 [details]
Patch

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

> Source/WebCore/rendering/RenderLayerBacking.cpp:2435
> +    // Top layer elements should not be affected by parent elements opacity
> +    if (m_owningLayer.establishesTopLayer())
> +        return finalOpacity;

This seems like the wrong way to fix this. Here we're in compositing code, but don't we want to reset opacity in style? If for some reason we end up not using compositing for top layers, we'll get bad rendering.
Comment 8 Tim Nguyen (:ntim) 2021-08-20 13:51:25 PDT
(In reply to Simon Fraser (smfr) from comment #7)
> Comment on attachment 435945 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435945&action=review
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:2435
> > +    // Top layer elements should not be affected by parent elements opacity
> > +    if (m_owningLayer.establishesTopLayer())
> > +        return finalOpacity;
> 
> This seems like the wrong way to fix this. Here we're in compositing code,
> but don't we want to reset opacity in style? If for some reason we end up
> not using compositing for top layers, we'll get bad rendering.

I filed https://bugs.webkit.org/show_bug.cgi?id=229350