Bug 246590

Summary: REGRESSION (r278062): Multiple backgrounds with "background-blend-mode: difference" breaks
Product: WebKit Reporter: brfrog7
Component: Layout and RenderingAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, sabouhallawa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
See Also: https://bugs.webkit.org/show_bug.cgi?id=228098
https://bugs.webkit.org/show_bug.cgi?id=226170
Attachments:
Description Flags
Screenshot showing lines instead of checkerboard none

Description brfrog7 2022-10-16 07:11:16 PDT
Created attachment 463015 [details]
Screenshot showing lines instead of checkerboard

Steps to reproduce:

*(ios16+) Go to: https://codepen.io/jokeyrhyme/pen/OVVzem

Expected result:

*Result should display a checkerboard pattern

Actual result:

*In the codepen result, only one background is displayed, rendering lines only. See screenshot from ios 16


Additional info:

This displays as a checkerboard in Firefox, Chrome and on iOS 15.7 but appears broken in iOS 16 so I would consider it a regression bug.
Don't know if/how it may affect other areas of using multiple backgrounds using "linear-gradient" and "background-blend-mode: difference"
Comment 1 Radar WebKit Bug Importer 2022-10-17 12:06:07 PDT
<rdar://problem/101257606>
Comment 2 Said Abou-Hallawa 2022-11-08 14:35:52 PST
This happens on macOS also.
Comment 3 Said Abou-Hallawa 2022-11-08 16:41:48 PST
I think this is a regression of r278062.

This revision replaced the call to GraphicsContextCG::setPlatformCompositeOperation() by GraphicsContext::setCompositeOperation() in GraphicsContextCG::drawPattern(). setCompositeOperation() is platform independent and should not be called from GraphicsContextCG methods. Instead we should be calling GraphicsContextCG::setCGBlendMode(). 

Note: r280095 fixed a similar problem in drawNativeImage().
Comment 4 Said Abou-Hallawa 2022-11-08 17:32:50 PST
Pull request: https://github.com/WebKit/WebKit/pull/6280
Comment 5 EWS 2022-11-11 10:48:40 PST
Committed 256578@main (9ffcb90d8fa7): <https://commits.webkit.org/256578@main>

Reviewed commits have been landed. Closing PR #6280 and removing active labels.