Skip to content

Commit

Permalink
[css-properties-values-api] Implement parsing and serialization for @…
Browse files Browse the repository at this point in the history
…Property at-rule

Implemented behind the new properties-and-values pref.

Support for the CSSPropertyRule WebIDL interface is also added in this
patch, because until it's added, any attempt to access the rule using
the CSSOM would crash the browser.

Depends on D178268

Differential Revision: https://phabricator.services.mozilla.com/D178270

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1833540
gecko-commit: f0ed58537793b76f901d9233f2aaa7f94b5f6e79
gecko-reviewers: emilio
  • Loading branch information
zrhoffman authored and pull[bot] committed Aug 2, 2023
1 parent 3dcff20 commit d36a627
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion css/css-properties-values-api/at-property.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,29 @@
test_descriptor('syntax', '"<color>"', '<color>');
test_descriptor('syntax', '"<color> | none"', '<color> | none');
test_descriptor('syntax', '"<color># | <image> | none"', '<color># | <image> | none');
test_descriptor('syntax', '"foo | <length>#"', 'foo | <length>#');
test_descriptor('syntax', '"foo | bar | baz"', 'foo | bar | baz');
test_descriptor('syntax', '"*"', '*');
test_descriptor('syntax', '"notasyntax"', 'notasyntax');

// syntax: universal
for (const syntax of ["*", " * ", "* ", "\t*\t"]) {
test_descriptor('syntax', `"${syntax}"`, syntax);
}

test_descriptor('syntax', 'red', '');
test_descriptor('syntax', 'rgb(255, 0, 0)', '');
test_descriptor('syntax', '<color>', '');
test_descriptor('syntax', 'foo | bar', '');

// syntax: pipe between components
test_descriptor('syntax', 'foo bar', '');
test_descriptor('syntax', 'Foo <length>', '');
test_descriptor('syntax', 'foo, bar', '');
test_descriptor('syntax', '<length> <percentage>', '');

// syntax: leaading bar
test_descriptor('syntax', '|<length>', '');

// initial-value
test_descriptor('initial-value', '10px');
test_descriptor('initial-value', 'rgb(1, 2, 3)');
Expand Down

0 comments on commit d36a627

Please sign in to comment.