Bug 252403 - HTMLStyleElement mangles -webkit-mask-repeat into unsupported mask-repeat
Summary: HTMLStyleElement mangles -webkit-mask-repeat into unsupported mask-repeat
Status: RESOLVED DUPLICATE of bug 243915
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-16 08:33 PST by Carlos Lopez
Modified: 2023-12-17 04:09 PST (History)
3 users (show)

See Also:


Attachments

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