Bug 252403

Summary: HTMLStyleElement mangles -webkit-mask-repeat into unsupported mask-repeat
Product: WebKit Reporter: Carlos Lopez <clshortfuse>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: annevk, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   

Description Carlos Lopez 2023-02-16 08:33:36 PST
When creating an HTMLStyleElement with `-webkit-mask-repeat` included, the property is mangled to `mask-repeat`. Webkit supports `-webkit-mask-repeat`, but not `mask-repeat`. Therefore, when attempting to reflect back into another HTMLStyleElement, the style is invalid. This is used to ponyfill/polyfill CSS Modules (native ones).

Test: https://codepen.io/shortfuse/pen/PodwrJE

Chrome PASS
Firefox PASS
WebKit/Safari FAIL

Unprefixing is fine if it's supported. Firefox unprefixes and that's fine. Chrome doesn't unprefix, so that's also fine. But Webkit will unprefix and break the ability to replicate styles. 

Related:

* https://bugs.webkit.org/show_bug.cgi?id=167255
* https://bugs.webkit.org/show_bug.cgi?id=227967
* https://bugs.webkit.org/show_bug.cgi?id=229082
Comment 1 Radar WebKit Bug Importer 2023-02-23 08:34:17 PST
<rdar://problem/105835488>
Comment 2 Tim Nguyen (:ntim) 2023-02-23 11:09:31 PST
The unprefixed mask-repeat is supported by Safari, and -webkit-mask-repeat is an alias of it.
Comment 3 Carlos Lopez 2023-02-23 16:12:29 PST
CSS.supports("mask-repeat-x", "initial") and CSS.supports("mask-repeat-y", "initial") reports false on iPad 16.1

The codepen shows this pretty clearly. "-webkit-mask-repeat" gets mangled to "mask-repeat-x" and "mask-repeat-y" and neither are supported.
Comment 4 Tim Nguyen (:ntim) 2023-03-27 16:39:38 PDT
mask-repeat-x/mask-repeat-y shouldn't exist, only -webkit-mask-repeat-x/-webkit-mask-repeat-y should.
Comment 5 Tim Nguyen (:ntim) 2023-03-27 16:41:06 PDT
Actually, -webkit-mask-repeat-x/-webkit-mask-repeat-y should have been removed as well
Comment 6 Anne van Kesteren 2023-12-17 04:09:41 PST
The -x/-y variants were removed in bug 243915.

*** This bug has been marked as a duplicate of bug 243915 ***