Bug 196303

Summary: Non-separable blend modes in mix-blend-mode don't work on elements that overlap a GPU layer
Product: WebKit Reporter: Matt Perry <mattgperry>
Component: CompositingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino, eelco, graouts, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.14   
Attachments:
Description Flags
Testcase none

Description Matt Perry 2019-03-27 10:05:53 PDT
If an element has both `mix-blend-mode` rule and has either:
1. Been promoted to a GPU layer,
2. intersects an element that has been promoted to a GPU layer
3. intersects an element that itself intersects an element that has been promoted to a GPU layer (possibly so on)

The mix-blend-mode fails to take effect.

Examples
=================================

In the following examples the red box has been forced into GPU acceleration with `translateZ(0)` - `will-change: transform; transform: anything` also has the same effect.

The blue and black boxes are not on a GPU layer.

The black box has `mix-blend-mode: color` applied.

Note: If any example fails to reproduce as per "Result", try opening the link in a separate, new tab (seriously). Sometimes these work as expected, even after refresh, and then don't when in a new tab.

Example 1
---------

Blended element overlaps *only* non-accelerated element

Visit https://0pl5r1jx3l.codesandbox.io/ 
Expected: Blend mode takes effect
Result: Blend mode indeed takes effect
With source https://codesandbox.io/s/0pl5r1jx3l

Example 2
---------

Blended element overlaps both accelerated and non-accelerated elements

Visit https://2xm9ormpkn.codesandbox.io/
Expected: Blend mode takes effect
Result: Blend mode doesn't take effect
With source https://codesandbox.io/s/2xm9ormpkn

Example 3
---------

Blended element overlaps *only* non-accelerated element, but non-accelerated element overlaps accelerated element

Visit https://0p56069jp.codesandbox.io/
Expected: Blend mode takes effect
Result: Blend mode doesn't take effect
With source https://codesandbox.io/s/0p56069jp
Comment 1 Radar WebKit Bug Importer 2019-03-28 11:16:13 PDT
<rdar://problem/49387130>
Comment 2 Simon Fraser (smfr) 2019-03-28 21:18:06 PDT
Holy React tests batman. Needs to transpile modules before it can show three divs?
Comment 3 Simon Fraser (smfr) 2019-03-28 21:18:18 PDT
Created attachment 366243 [details]
Testcase
Comment 4 Simon Fraser (smfr) 2019-03-28 21:20:40 PDT
I think we just don't support the non-separable blend modes on GPU layers.
Comment 5 Simon Fraser (smfr) 2019-03-28 21:31:30 PDT
        // FIXME: CA does't support non-separable blend modes on compositing filters.