Bug 246590 - REGRESSION (r278062): Multiple backgrounds with "background-blend-mode: difference" breaks
Summary: REGRESSION (r278062): Multiple backgrounds with "background-blend-mode: diffe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-16 07:11 PDT by brfrog7
Modified: 2022-11-11 10:48 PST (History)
5 users (show)

See Also:


Attachments
Screenshot showing lines instead of checkerboard (122.20 KB, image/jpeg)
2022-10-16 07:11 PDT, brfrog7
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.