[wpt-sync] Sync PR 63294 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=227967
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 63294 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63294
Details from upstream follow.
Kiet Ho <kiet.ho@apple.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=227967
WebKit export from bug: Implement CSS module scripts
<pre>
Implement CSS module scriptsThis patch implements importing CSS stylesheets as JavaScript modules, using the
import ... with { type: 'css' }andimport(..., { with: { type: 'css' } })
syntax.On the JSC side, we add support for the
cssmodule type, and requests WebCore
to fetch it. WebCore fetches the stylesheet, constructs a CSSStyleSheet object
out of it, wraps it in a JSCSSStyleSheet, and returns it back to JSC as a JSValue.
JSC uses this as the default export value of the CSS module.To implement this requires some changes in how script modules loading works. Before,
JSC asks WebCore to fetch a script, WebCore fetches the source code and returns it
to JSC. This works for JavaScript/WASM/JSON/text, because those are JavaScript
constructs and can only be handled by JSC. However, CSS is a WebCore construct and
can only be handled by WebCore. This patch changes it so that depending on the module
type, WebCore can either return a source code for types it can't handle, like JS or
WASM. For types it can handle like CSS, WebCore constructs the JSValue itself, then
passes it to JSC. JSC just uses the JSValue as the default module export.This is gated by the CSSModuleScriptsEnabled feature flag, which is disabled by default.
There is one failing test only on GTK, which is tracked at webkit.org/b/326330:
- html/semantics/scripting-1/the-script-element/css-module/credentials.sub.html
WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=227967">https://bugs.webkit.org/show_bug.cgi?id=227967</a>
</pre>
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=101141
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, and Chrome on GitHub CI
Total 18 tests and 1 subtests
Status Summary
Firefox
OK : 2[GitHub] 18[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 9[GitHub] 60[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
Chrome
OK : 2
PASS: 9
Links
Comment 4•1 month ago
|
||
| bugherder | ||
Description
•