[wpt-sync] Sync PR 22374 - Disable @import in replace() and replaceSync()
Categories
(Core :: DOM: CSS Object Model, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 22374 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/22374
Details from upstream follow.
Mason Freed <masonfreed@chromium.org> wrote:
Disable @import in replace() and replaceSync()
The CSSWG resolved [1] that "@import doesn't parse in constructable
stylesheets and as a result throw syntax errors". We have a comment [2]
requesting clarification, but the working assumption is:
- calling replace() with text that includes @import will ignore the
@import, and issue a console warning.- calling replaceSync() with text that includes @import will ignore
the @import, and issue a console warning.- calling insertRule() on any stylesheet with an @import rule will
throw a SyntaxError.Prior to this CL, the behavior of Chromium was:
- calling replace() with text that includes @import would work. The
returned Promise would resolve once all @imports were loaded. Any
invalid @import rules would cause a NetworkError to be thrown.- calling replaceSync() with text that includes @import would throw
a "NotAllowed" exception.- calling insertRule() with an @import rule would throw a SyntaxError
for constructed stylesheets only. No exception would be thrown for
document.styleSheets.The Intent to Remove for this change is at [3].
[1] https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-597733392
[2] https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-600410089
[3] https://groups.google.com/a/chromium.org/g/blink-dev/c/RKG8oxp22RY/m/fdFnG1rGCgAJBug: 1055943
Change-Id: I0a8444289b137b4c2880be5231696bb526331107
Reviewed-on: https://chromium-review.googlesource.com/2106996
WPT-Export-Revision: 0745ddeb55ee62b064e7dddc28a9ce1ac7387eee
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
| Assignee | ||
Comment 2•5 years ago
|
||
Comment 4•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c21642a6b4d4
https://hg.mozilla.org/mozilla-central/rev/1c9c302fa1a7
Description
•