Closed Bug 2095382 Opened 10 days ago Closed 8 days ago

[wpt-sync] Sync PR 65113 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=330641

Categories

(Core :: DOM: CSS Object Model, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 65113 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/65113
Details from upstream follow.

Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=330641

WebKit export from bug: CSSKeyframesRule.<!---->cssText should serialize CSS-<!---->wide keyword and '<!---->none'<!----> names as strings

<pre>
CSSKeyframesRule.cssText should serialize CSS-wide keyword and 'none' names as strings

This patch aligns WebKit with Gecko / Firefox.

Per [1], a @keyframes name is a <custom-ident> or a <string>:

"The <custom-ident> additionally excludes the none keyword. The <string> additionally
excludes the empty string (but allows the string "none" and other excluded keywords).
When serialized, the value is serialized as an <ident> unless it's a disallowed keyword,
in which case it's serialized as a <string>."

CSSKeyframesRule::cssText() always serialized the name as an identifier, so a name that is
a CSS-wide keyword, 'default' or 'none' (e.g. from @keyframes "initial" or via the name
setter) produced output such as "@keyframes initial { }", which does not round-trip.
Serialize the name as a string when it is not a valid <custom-ident> for <keyframes-name>.

Add isValidCustomIdentifierForKeyframeName() and share it between cssText(),
consumeKeyframesName() and CSSParser::consumeKeyframesRule().

[1] <a href="https://drafts.csswg.org/css-animations/#typedef-keyframes-name">https://drafts.csswg.org/css-animations/#typedef-keyframes-name</a>

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=330641">https://bugs.webkit.org/show_bug.cgi?id=330641</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/326525@main">https://commits.webkit.org/326525@main</a>
</pre>

Component: web-platform-tests → DOM: CSS Object Model
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 3 subtests

Status Summary

Firefox

OK : 1
PASS: 3

Chrome

OK : 1
PASS: 1
FAIL: 2

Safari

OK : 1
PASS: 1
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.