Import css/css-syntax WPT tests
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Oct 2019 15:10:06 +0000 (15:10 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Oct 2019 15:10:06 +0000 (15:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203444

Reviewed by Antti Koivisto.

Imported from WPT at 5eebc927c57ec8c5e234fef8e4cc480ac339462c (Mon Oct 21 20:23:09 2019 +0100).

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/css/css-syntax/META.yml: Added.
* web-platform-tests/css/css-syntax/anb-parsing-expected.txt: Added.
* web-platform-tests/css/css-syntax/anb-parsing.html: Added.
* web-platform-tests/css/css-syntax/anb-serialization-expected.txt: Added.
* web-platform-tests/css/css-syntax/anb-serialization.html: Added.
* web-platform-tests/css/css-syntax/cdc-vs-ident-tokens-expected.txt: Added.
* web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html: Added.
* web-platform-tests/css/css-syntax/charset-is-not-a-rule-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset-is-not-a-rule.html: Added.
* web-platform-tests/css/css-syntax/charset/.htaccess: Added.
* web-platform-tests/css/css-syntax/charset/MANIFEST: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html: Added.
* web-platform-tests/css/css-syntax/charset/support/MANIFEST: Added.
* web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css: Added.
(@charset "bogus";):
* web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css: Added.
(@charset "utf-16";):
* web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css: Added.
(@charset "utf-16";):
* web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css: Added.
(@charset "utf-16be";):
* web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css: Added.
* web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css: Added.
* web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css: Added.
(@charset "windows-1250";):
* web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css: Added.
* web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css: Added.
* web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css: Added.
(@charset "windows-1250";):
* web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers: Added.
* web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css: Added.
(#È):
* web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers: Added.
* web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css: Added.
(@charset "windows-1253";):
* web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers: Added.
* web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css: Added.
(#foo):
* web-platform-tests/css/css-syntax/charset/support/no-decl.css: Added.
(#È):
* web-platform-tests/css/css-syntax/charset/support/utf8-bom.css: Added.
(#È):
* web-platform-tests/css/css-syntax/charset/support/w3c-import.log: Added.
* web-platform-tests/css/css-syntax/charset/w3c-import.log: Added.
* web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt: Added.
* web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml: Added.
* web-platform-tests/css/css-syntax/decimal-points-in-numbers-expected.txt: Added.
* web-platform-tests/css/css-syntax/decimal-points-in-numbers.html: Added.
* web-platform-tests/css/css-syntax/declarations-trim-whitespace-expected.txt: Added.
* web-platform-tests/css/css-syntax/declarations-trim-whitespace.html: Added.
* web-platform-tests/css/css-syntax/escaped-eof-expected.txt: Added.
* web-platform-tests/css/css-syntax/escaped-eof.html: Added.
* web-platform-tests/css/css-syntax/ident-three-code-points-expected.txt: Added.
* web-platform-tests/css/css-syntax/ident-three-code-points.html: Added.
* web-platform-tests/css/css-syntax/inclusive-ranges-expected.txt: Added.
* web-platform-tests/css/css-syntax/inclusive-ranges.html: Added.
* web-platform-tests/css/css-syntax/input-preprocessing-expected.txt: Added.
* web-platform-tests/css/css-syntax/input-preprocessing.html: Added.
* web-platform-tests/css/css-syntax/serialize-consecutive-tokens-expected.txt: Added.
* web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html: Added.
* web-platform-tests/css/css-syntax/unclosed-constructs-expected.txt: Added.
* web-platform-tests/css/css-syntax/unclosed-constructs.html: Added.
* web-platform-tests/css/css-syntax/unclosed-url-at-eof-expected.txt: Added.
* web-platform-tests/css/css-syntax/unclosed-url-at-eof.html: Added.
* web-platform-tests/css/css-syntax/unicode-range-selector-expected.txt: Added.
* web-platform-tests/css/css-syntax/unicode-range-selector.html: Added.
* web-platform-tests/css/css-syntax/urange-parsing-expected.txt: Added.
* web-platform-tests/css/css-syntax/urange-parsing.html: Added.
* web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt: Added.
* web-platform-tests/css/css-syntax/url-whitespace-consumption.html: Added.
* web-platform-tests/css/css-syntax/w3c-import.log: Added.
* web-platform-tests/css/css-syntax/whitespace-expected.txt: Added.
* web-platform-tests/css/css-syntax/whitespace.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

100 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/resources/resource-files.json
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/.htaccess [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/MANIFEST [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/MANIFEST [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/utf8-bom.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace.html [new file with mode: 0644]

index 17e4f26..e3789cb 100644 (file)
@@ -1,3 +1,123 @@
+2019-10-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Import css/css-syntax WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=203444
+
+        Reviewed by Antti Koivisto.
+
+        Imported from WPT at 5eebc927c57ec8c5e234fef8e4cc480ac339462c (Mon Oct 21 20:23:09 2019 +0100).
+
+        * resources/import-expectations.json:
+        * resources/resource-files.json:
+        * web-platform-tests/css/css-syntax/META.yml: Added.
+        * web-platform-tests/css/css-syntax/anb-parsing-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/anb-parsing.html: Added.
+        * web-platform-tests/css/css-syntax/anb-serialization-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/anb-serialization.html: Added.
+        * web-platform-tests/css/css-syntax/cdc-vs-ident-tokens-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html: Added.
+        * web-platform-tests/css/css-syntax/charset-is-not-a-rule-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset-is-not-a-rule.html: Added.
+        * web-platform-tests/css/css-syntax/charset/.htaccess: Added.
+        * web-platform-tests/css/css-syntax/charset/MANIFEST: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html: Added.
+        * web-platform-tests/css/css-syntax/charset/support/MANIFEST: Added.
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css: Added.
+        (@charset "bogus";):
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css: Added.
+        (@charset "utf-16";):
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css: Added.
+        (@charset "utf-16";):
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css: Added.
+        (@charset "utf-16be";):
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css: Added.
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css: Added.
+        * web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css: Added.
+        (@charset "windows-1250";):
+        * web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css: Added.
+        * web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css: Added.
+        * web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css: Added.
+        (@charset "windows-1250";):
+        * web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers: Added.
+        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css: Added.
+        (#È):
+        * web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers: Added.
+        * web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css: Added.
+        (@charset "windows-1253";):
+        * web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers: Added.
+        * web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css: Added.
+        (#foo):
+        * web-platform-tests/css/css-syntax/charset/support/no-decl.css: Added.
+        (#È):
+        * web-platform-tests/css/css-syntax/charset/support/utf8-bom.css: Added.
+        (#È):
+        * web-platform-tests/css/css-syntax/charset/support/w3c-import.log: Added.
+        * web-platform-tests/css/css-syntax/charset/w3c-import.log: Added.
+        * web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml: Added.
+        * web-platform-tests/css/css-syntax/decimal-points-in-numbers-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/decimal-points-in-numbers.html: Added.
+        * web-platform-tests/css/css-syntax/declarations-trim-whitespace-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/declarations-trim-whitespace.html: Added.
+        * web-platform-tests/css/css-syntax/escaped-eof-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/escaped-eof.html: Added.
+        * web-platform-tests/css/css-syntax/ident-three-code-points-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/ident-three-code-points.html: Added.
+        * web-platform-tests/css/css-syntax/inclusive-ranges-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/inclusive-ranges.html: Added.
+        * web-platform-tests/css/css-syntax/input-preprocessing-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/input-preprocessing.html: Added.
+        * web-platform-tests/css/css-syntax/serialize-consecutive-tokens-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html: Added.
+        * web-platform-tests/css/css-syntax/unclosed-constructs-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/unclosed-constructs.html: Added.
+        * web-platform-tests/css/css-syntax/unclosed-url-at-eof-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/unclosed-url-at-eof.html: Added.
+        * web-platform-tests/css/css-syntax/unicode-range-selector-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/unicode-range-selector.html: Added.
+        * web-platform-tests/css/css-syntax/urange-parsing-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/urange-parsing.html: Added.
+        * web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/url-whitespace-consumption.html: Added.
+        * web-platform-tests/css/css-syntax/w3c-import.log: Added.
+        * web-platform-tests/css/css-syntax/whitespace-expected.txt: Added.
+        * web-platform-tests/css/css-syntax/whitespace.html: Added.
+
 2019-10-25  Simon Fraser  <simon.fraser@apple.com>
 
         Update css/support directory in WPT
index 67733ea..a591679 100644 (file)
@@ -1,5 +1,6 @@
 {
     "apng": "import", 
+    "css/css-syntax": "import", 
     "css/css-values": "import", 
     "css/geometry": "import", 
     "css/support": "import", 
index 3761437..9ff3c28 100644 (file)
@@ -12,6 +12,8 @@
         "web-platform-tests/tools"
     ],
     "files": [
+        "css/css-syntax/charset/page-utf16-css-bomless-utf16be.html",
+        "css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html",
         "css/css-values/absolute_length_units.html",
         "css/css-values/support/vh-support-transform-origin-iframe.html",
         "css/css-values/support/vh-support-transform-translate-iframe.html",
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/META.yml b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/META.yml
new file mode 100644 (file)
index 0000000..359219c
--- /dev/null
@@ -0,0 +1,4 @@
+spec: https://drafts.csswg.org/css-syntax/
+suggested_reviewers:
+  - gregwhitworth
+  - tabatkins
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing-expected.txt
new file mode 100644 (file)
index 0000000..1174635
--- /dev/null
@@ -0,0 +1,69 @@
+
+FAIL "odd" becomes "2n+1" assert_equals: expected "2n+1" but got "odd"
+FAIL "even" becomes "2n" assert_equals: expected "2n" but got "even"
+PASS "1" becomes "1" 
+FAIL "+1" becomes "1" assert_equals: expected "1" but got "+1"
+PASS "-1" becomes "-1" 
+PASS "5n" becomes "5n" 
+FAIL "5N" becomes "5n" assert_equals: expected "5n" but got "5N"
+FAIL "+n" becomes "n" assert_equals: expected "n" but got "+n"
+PASS "n" becomes "n" 
+FAIL "N" becomes "n" assert_equals: expected "n" but got "N"
+PASS "+ n" becomes "parse error" 
+PASS "-n" becomes "-n" 
+FAIL "-N" becomes "-n" assert_equals: expected "-n" but got "-N"
+PASS "5n-5" becomes "5n-5" 
+FAIL "+n-5" becomes "n-5" assert_equals: expected "n-5" but got "+n-5"
+PASS "n-5" becomes "n-5" 
+PASS "+ n-5" becomes "parse error" 
+PASS "-n-5" becomes "-n-5" 
+FAIL "5n +5" becomes "5n+5" assert_equals: expected "5n+5" but got "5n +5"
+FAIL "5n -5" becomes "5n-5" assert_equals: expected "5n-5" but got "5n -5"
+FAIL "+n +5" becomes "n+5" assert_equals: expected "n+5" but got "+n +5"
+FAIL "n +5" becomes "n+5" assert_equals: expected "n+5" but got "n +5"
+FAIL "+n -5" becomes "n-5" assert_equals: expected "n-5" but got "+n -5"
+PASS "+ n +5" becomes "parse error" 
+PASS "n 5" becomes "parse error" 
+FAIL "-n +5" becomes "-n+5" assert_equals: expected "-n+5" but got "-n +5"
+FAIL "-n -5" becomes "-n-5" assert_equals: expected "-n-5" but got "-n -5"
+PASS "-n 5" becomes "parse error" 
+FAIL "5n- 5" becomes "5n-5" assert_equals: expected "5n-5" but got "5n- 5"
+PASS "5n- -5" becomes "parse error" 
+PASS "5n- +5" becomes "parse error" 
+FAIL "-5n- 5" becomes "-5n-5" assert_equals: expected "-5n-5" but got "-5n- 5"
+FAIL "+n- 5" becomes "n-5" assert_equals: expected "n-5" but got "+n- 5"
+FAIL "n- 5" becomes "n-5" assert_equals: expected "n-5" but got "n- 5"
+PASS "+ n- 5" becomes "parse error" 
+PASS "n- +5" becomes "parse error" 
+PASS "n- -5" becomes "parse error" 
+FAIL "-n- 5" becomes "-n-5" assert_equals: expected "-n-5" but got "-n- 5"
+PASS "-n- +5" becomes "parse error" 
+PASS "-n- -5" becomes "parse error" 
+FAIL "5n + 5" becomes "5n+5" assert_equals: expected "5n+5" but got "5n + 5"
+FAIL "5n - 5" becomes "5n-5" assert_equals: expected "5n-5" but got "5n - 5"
+PASS "5n + +5" becomes "parse error" 
+PASS "5n + -5" becomes "parse error" 
+PASS "5n - +5" becomes "parse error" 
+PASS "5n - -5" becomes "parse error" 
+FAIL "+n + 5" becomes "n+5" assert_equals: expected "n+5" but got "+n + 5"
+FAIL "n + 5" becomes "n+5" assert_equals: expected "n+5" but got "n + 5"
+PASS "+ n + 5" becomes "parse error" 
+FAIL "+n - 5" becomes "n-5" assert_equals: expected "n-5" but got "+n - 5"
+PASS "+n + +5" becomes "parse error" 
+PASS "+n + -5" becomes "parse error" 
+PASS "+n - +5" becomes "parse error" 
+PASS "+n - -5" becomes "parse error" 
+FAIL "-n + 5" becomes "-n+5" assert_equals: expected "-n+5" but got "-n + 5"
+FAIL "-n - 5" becomes "-n-5" assert_equals: expected "-n-5" but got "-n - 5"
+PASS "-n + +5" becomes "parse error" 
+PASS "-n + -5" becomes "parse error" 
+PASS "-n - +5" becomes "parse error" 
+PASS "-n - -5" becomes "parse error" 
+PASS "1 - n" becomes "parse error" 
+PASS "0 - n" becomes "parse error" 
+PASS "-1 + n" becomes "parse error" 
+PASS "2 n + 2" becomes "parse error" 
+PASS "- 2n" becomes "parse error" 
+PASS "+ 2n" becomes "parse error" 
+PASS "+2 n" becomes "parse error" 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing.html
new file mode 100644 (file)
index 0000000..7fcc06e
--- /dev/null
@@ -0,0 +1,125 @@
+<!doctype html>
+<title>An+B Parsing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+foo { color: blue; }
+
+</style>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#the-anb-type">
+
+<script>
+
+function roundtripANB(str) {
+    const rule = document.styleSheets[0].cssRules[0];
+    rule.selectorText = "foo";
+    rule.selectorText = `:nth-child(${str})`;
+    // Check for parse error.
+    if(rule.selectorText == "foo") return "parse error";
+    return rule.selectorText.slice(11, -1);
+}
+function testANB(input, expected) {
+    test(()=>{
+        assert_equals(roundtripANB(input), expected);
+    }, `"${input}" becomes "${expected}"`);
+}
+
+/* Just going down all the syntax clauses one-by-one */
+//  odd | even |
+testANB("odd", "2n+1");
+testANB("even", "2n");
+//  <integer> |
+testANB("1", "1");
+testANB("+1", "1");
+testANB("-1", "-1");
+//
+//  <n-dimension> |
+testANB("5n", "5n");
+testANB("5N", "5n");
+//  '+'?† n |
+testANB("+n", "n");
+testANB("n", "n");
+testANB("N", "n");
+testANB("+ n", "parse error");
+//  -n |
+testANB("-n", "-n");
+testANB("-N", "-n");
+//
+//  <ndashdigit-dimension> |
+testANB("5n-5", "5n-5");
+//  '+'?† <ndashdigit-ident> |
+testANB("+n-5", "n-5");
+testANB("n-5", "n-5");
+testANB("+ n-5", "parse error");
+//  <dashndashdigit-ident> |
+testANB("-n-5", "-n-5");
+//
+//  <n-dimension> <signed-integer> |
+testANB("5n +5", "5n+5");
+testANB("5n -5", "5n-5");
+//  '+'?† n <signed-integer> |
+testANB("+n +5", "n+5");
+testANB("n +5", "n+5");
+testANB("+n -5", "n-5");
+testANB("+ n +5", "parse error");
+testANB("n 5", "parse error");
+//  -n <signed-integer> |
+testANB("-n +5", "-n+5");
+testANB("-n -5", "-n-5");
+testANB("-n 5", "parse error");
+//
+//  <ndash-dimension> <signless-integer> |
+testANB("5n- 5", "5n-5");
+testANB("5n- -5", "parse error");
+testANB("5n- +5", "parse error");
+testANB("-5n- 5", "-5n-5");
+//  '+'?† n- <signless-integer> |
+testANB("+n- 5", "n-5");
+testANB("n- 5", "n-5");
+testANB("+ n- 5", "parse error");
+testANB("n- +5", "parse error");
+testANB("n- -5", "parse error");
+//  -n- <signless-integer> |
+testANB("-n- 5", "-n-5");
+testANB("-n- +5", "parse error");
+testANB("-n- -5", "parse error");
+//
+//  <n-dimension> ['+' | '-'] <signless-integer>
+testANB("5n + 5", "5n+5");
+testANB("5n - 5", "5n-5");
+testANB("5n + +5", "parse error");
+testANB("5n + -5", "parse error");
+testANB("5n - +5", "parse error");
+testANB("5n - -5", "parse error");
+//  '+'?† n ['+' | '-'] <signless-integer> |
+testANB("+n + 5", "n+5");
+testANB("n + 5", "n+5");
+testANB("+ n + 5", "parse error");
+testANB("+n - 5", "n-5");
+testANB("+n + +5", "parse error");
+testANB("+n + -5", "parse error");
+testANB("+n - +5", "parse error");
+testANB("+n - -5", "parse error");
+//  -n ['+' | '-'] <signless-integer>
+testANB("-n + 5", "-n+5");
+testANB("-n - 5", "-n-5");
+testANB("-n + +5", "parse error");
+testANB("-n + -5", "parse error");
+testANB("-n - +5", "parse error");
+testANB("-n - -5", "parse error");
+
+/* Swapped ordering is invalid */
+testANB("1 - n", "parse error");
+testANB("0 - n", "parse error");
+testANB("-1 + n", "parse error");
+
+/* Odd space usage */
+testANB("2 n + 2", "parse error");
+testANB("- 2n", "parse error");
+testANB("+ 2n", "parse error");
+testANB("+2 n", "parse error");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization-expected.txt
new file mode 100644 (file)
index 0000000..fddcc93
--- /dev/null
@@ -0,0 +1,22 @@
+
+PASS "1" becomes "1" 
+FAIL "+1" becomes "1" assert_equals: expected "1" but got "+1"
+PASS "-1" becomes "-1" 
+FAIL "0n + 0" becomes "0" assert_equals: expected "0" but got "0n + 0"
+FAIL "0n + 1" becomes "1" assert_equals: expected "1" but got "0n + 1"
+FAIL "0n - 1" becomes "-1" assert_equals: expected "-1" but got "0n - 1"
+FAIL "1n" becomes "n" assert_equals: expected "n" but got "1n"
+FAIL "1n - 0" becomes "n" assert_equals: expected "n" but got "1n - 0"
+FAIL "1n + 1" becomes "n+1" assert_equals: expected "n+1" but got "1n + 1"
+FAIL "1n - 1" becomes "n-1" assert_equals: expected "n-1" but got "1n - 1"
+FAIL "-1n" becomes "-n" assert_equals: expected "-n" but got "-1n"
+FAIL "-1n - 0" becomes "-n" assert_equals: expected "-n" but got "-1n - 0"
+FAIL "-1n + 1" becomes "-n+1" assert_equals: expected "-n+1" but got "-1n + 1"
+FAIL "-1n - 1" becomes "-n-1" assert_equals: expected "-n-1" but got "-1n - 1"
+FAIL "+n+1" becomes "n+1" assert_equals: expected "n+1" but got "+n+1"
+PASS "-n-1" becomes "-n-1" 
+FAIL "n + 0" becomes "n" assert_equals: expected "n" but got "n + 0"
+FAIL "n - 0" becomes "n" assert_equals: expected "n" but got "n - 0"
+FAIL "2n + 2" becomes "2n+2" assert_equals: expected "2n+2" but got "2n + 2"
+FAIL "-2n - 2" becomes "-2n-2" assert_equals: expected "-2n-2" but got "-2n - 2"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization.html
new file mode 100644 (file)
index 0000000..787700c
--- /dev/null
@@ -0,0 +1,62 @@
+<!doctype html>
+<title>An+B Serialization</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+foo { color: blue; }
+
+</style>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#serializing-anb">
+
+<script>
+
+function roundtripANB(str) {
+    const rule = document.styleSheets[0].cssRules[0];
+    rule.selectorText = "foo";
+    rule.selectorText = `:nth-child(${str})`;
+    // Check for parse error.
+    if(rule.selectorText == "foo") return "parse error";
+    return rule.selectorText.slice(11, -1);
+}
+function testANB(input, expected) {
+    test(()=>{
+        assert_equals(roundtripANB(input), expected);
+    }, `"${input}" becomes "${expected}"`);
+}
+
+/* A is 0, or omitted */
+testANB("1", "1");
+testANB("+1", "1");
+testANB("-1", "-1");
+testANB("0n + 0", "0");
+testANB("0n + 1", "1");
+testANB("0n - 1", "-1");
+
+/* A is 1 */
+testANB("1n", "n");
+testANB("1n - 0", "n");
+testANB("1n + 1", "n+1");
+testANB("1n - 1", "n-1");
+
+/* A is -1 */
+testANB("-1n", "-n");
+testANB("-1n - 0", "-n");
+testANB("-1n + 1", "-n+1");
+testANB("-1n - 1", "-n-1");
+
+/* A is implied via + or - */
+testANB("+n+1", "n+1");
+testANB("-n-1", "-n-1");
+
+/* B is 0 */
+testANB("n + 0", "n");
+testANB("n - 0", "n");
+
+/* A & B both nonzero */
+testANB("2n + 2", "2n+2");
+testANB("-2n - 2", "-2n-2");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens-expected.txt
new file mode 100644 (file)
index 0000000..03eca65
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CDC-token is properly emitted, and not parsed as an ident. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html
new file mode 100644 (file)
index 0000000..02cfbe1
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>CDC versus Ident Token</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+-->
+
+--foo { color: blue; }
+
+</style>
+
+<meta name=author content="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-token">
+
+<!--
+The ordering of the checks in the HYPHEN-MINUS step is important;
+if you get it wrong, ident-token can swallow cdc-token.
+-->
+
+<script>
+
+test(()=>{
+    const rule = document.styleSheets[0].cssRules[0];
+    assert_equals(rule.selectorText, "--foo");
+}, "CDC-token is properly emitted, and not parsed as an ident.");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule-expected.txt
new file mode 100644 (file)
index 0000000..1a65bd1
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS @charset isn't a valid rule and shouldn't show up in the OM 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule.html
new file mode 100644 (file)
index 0000000..81b2a04
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>@charset isn't a valid rule and should be dropped</title>
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#charset-rule">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+@charset "utf-8";
+@charset "utf-8";
+foo { color: blue; }
+@charset "utf-8";
+</style>
+<script>
+test(()=>{
+    assert_true(document.styleSheets[0].cssRules.length == 1)
+}, "@charset isn't a valid rule and shouldn't show up in the OM");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/.htaccess b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/.htaccess
new file mode 100644 (file)
index 0000000..e14b20d
--- /dev/null
@@ -0,0 +1,4 @@
+IndexOptions NameWidth=*
+AddDefaultCharset Off
+AddCharset bogus .bogus
+AddCharset windows-1250 .windows1250
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/MANIFEST b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/MANIFEST
new file mode 100644 (file)
index 0000000..4bc83f6
--- /dev/null
@@ -0,0 +1,20 @@
+page-utf16-css-bomless-utf16be.html
+page-utf16-css-bomless-utf16.html
+page-utf16-css-no-decl-ascii-only.html
+page-utf16-css-no-decl.html
+page-windows-1251-charset-attribute-bogus.html
+page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
+page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
+page-windows-1251-css-at-charset-bogus.html
+page-windows-1251-css-at-charset-utf16-ascii-only.html
+page-windows-1251-css-at-charset-utf16be.html
+page-windows-1251-css-at-charset-utf16.html
+page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
+page-windows-1251-css-at-charset-windows-1250-in-utf16.html
+page-windows-1251-css-http-bogus-at-charset-windows-1250.html
+page-windows-1251-css-http-bogus.html
+page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
+page-windows-1251-css-no-decl.html
+page-windows-1251-css-utf8-bom.html
+dir support
+xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16-expected.txt
new file mode 100644 (file)
index 0000000..500f12e
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page utf-16, CSS bomless utf-16 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html
new file mode 100644 (file)
index 0000000..f98bc21
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be-expected.txt
new file mode 100644 (file)
index 0000000..fa04a11
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page utf-16, CSS bomless utf-16be 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html
new file mode 100644 (file)
index 0000000..1d47283
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only-expected.txt
new file mode 100644 (file)
index 0000000..7ffe4d3
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page utf-16, CSS no decl (ASCII only) 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html
new file mode 100644 (file)
index 0000000..56e09ac
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-expected.txt
new file mode 100644 (file)
index 0000000..00e42a8
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page utf-16, CSS no decl 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html
new file mode 100644 (file)
index 0000000..2ff52cf
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus-expected.txt
new file mode 100644 (file)
index 0000000..bd32427
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL CSS charset: page windows-1251, charset attribute bogus assert_equals: expected "hidden" but got "visible"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html
new file mode 100644 (file)
index 0000000..939143a
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, charset attribute bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/no-decl.css" charset="bogus">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253-expected.txt
new file mode 100644 (file)
index 0000000..b468c9c
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, @charset windows-1250, charset attribute windows-1253 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
new file mode 100644 (file)
index 0000000..df51dfa
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, @charset windows-1250, charset attribute windows-1253</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250.css" charset=windows-1253>
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250-expected.txt
new file mode 100644 (file)
index 0000000..56f4b37
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset bogus, charset attribute windows-1250 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
new file mode 100644 (file)
index 0000000..7521e85
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset bogus, charset attribute windows-1250</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-bogus.css" charset=windows-1250>
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-expected.txt
new file mode 100644 (file)
index 0000000..751b0ca
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, @charset bogus 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html
new file mode 100644 (file)
index 0000000..2d7c3ef
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, @charset bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-bogus.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only-expected.txt
new file mode 100644 (file)
index 0000000..7d3ed93
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset utf-16 (ASCII only) 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html
new file mode 100644 (file)
index 0000000..d65afd3
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16 (ASCII only)</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16-ascii-only.css">
+<div id=log></div>
+<div id=foo></div>
+<script>
+var elm = document.getElementById('foo');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-expected.txt
new file mode 100644 (file)
index 0000000..5b8f27b
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset utf-16 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html
new file mode 100644 (file)
index 0000000..04c1270
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be-expected.txt
new file mode 100644 (file)
index 0000000..82f3d74
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset utf-16be 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html
new file mode 100644 (file)
index 0000000..4b2d48d
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset utf-16be</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-utf16be.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16-expected.txt
new file mode 100644 (file)
index 0000000..8520792
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html
new file mode 100644 (file)
index 0000000..463e377
--- /dev/null
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250-in-utf16.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<div id=&#x0418;></div>
+<div id=&#x010c;></div>
+<script>
+var elm_fffd = document.getElementById('\ufffd');
+var elm_0418 = document.getElementById('\u0418');
+var elm_010c = document.getElementById('\u010c');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm_fffd, '').visibility, 'visible', 'selector U+FFFD matched (utf-8)');
+  assert_equals(getComputedStyle(elm_0418, '').visibility, 'hidden', 'selector U+0418 did not match (windows-1251)');
+  assert_equals(getComputedStyle(elm_010c, '').visibility, 'visible', 'selector U+010C matched (windows-1250)');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be-expected.txt
new file mode 100644 (file)
index 0000000..d48d0c7
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16be 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
new file mode 100644 (file)
index 0000000..7de3f37
--- /dev/null
@@ -0,0 +1,23 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS @charset windows-1250 in utf-16be</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/at-charset-windows-1250-in-utf16be.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<div id=&#x0418;></div>
+<div id=&#x010c;></div>
+<script>
+var elm_fffd = document.getElementById('\ufffd');
+var elm_0418 = document.getElementById('\u0418');
+var elm_010c = document.getElementById('\u010c');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm_fffd, '').visibility, 'visible', 'selector U+FFFD matched (utf-8)');
+  assert_equals(getComputedStyle(elm_0418, '').visibility, 'hidden', 'selector U+0418 did not match (windows-1251)');
+  assert_equals(getComputedStyle(elm_010c, '').visibility, 'visible', 'selector U+010C matched (windows-1250)');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250-expected.txt
new file mode 100644 (file)
index 0000000..4fa94be
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS HTTP bogus, @charset windows-1250 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html
new file mode 100644 (file)
index 0000000..2fcc56b
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP bogus, @charset windows-1250</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-bogus-at-charset-windows-1250.bogus.css">
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-expected.txt
new file mode 100644 (file)
index 0000000..d0f4de2
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS HTTP bogus 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html
new file mode 100644 (file)
index 0000000..e26501b
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP bogus</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-bogus.bogus.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253-expected.txt
new file mode 100644 (file)
index 0000000..7e681a8
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS HTTP windows-1250, @charset windows-1253 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
new file mode 100644 (file)
index 0000000..3658e44
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS HTTP windows-1250, @charset windows-1253</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/http-windows-1250-at-charset-windows-1253.windows1250.css">
+<div id=log></div>
+<div id=&#x010C;></div>
+<script>
+var elm = document.getElementById('\u010C');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl-expected.txt
new file mode 100644 (file)
index 0000000..be0f8ca
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS no decl 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html
new file mode 100644 (file)
index 0000000..288f01e
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS no decl</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/no-decl.css">
+<div id=log></div>
+<div id=&#x0418;></div>
+<script>
+var elm = document.getElementById('\u0418');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom-expected.txt
new file mode 100644 (file)
index 0000000..ef84a6c
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, CSS UTF-8 BOM 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html
new file mode 100644 (file)
index 0000000..2c32f09
--- /dev/null
@@ -0,0 +1,17 @@
+<!doctype html>
+<title>CSS charset: page windows-1251, CSS UTF-8 BOM</title>
+<link rel=help href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding">
+<meta charset=windows-1251>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel=stylesheet href="support/utf8-bom.css">
+<div id=log></div>
+<div id=&#xfffd;></div>
+<script>
+var elm = document.getElementById('\ufffd');
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/MANIFEST b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/MANIFEST
new file mode 100644 (file)
index 0000000..9688e1f
--- /dev/null
@@ -0,0 +1,15 @@
+support at-charset-bogus.css
+support at-charset-utf16-ascii-only.css
+support at-charset-utf16be.css
+support at-charset-utf16.css
+support at-charset-windows-1250.css
+support at-charset-windows-1250-in-utf16be.css
+support at-charset-windows-1250-in-utf16.css
+support bomless-utf16be.css
+support bomless-utf16.css
+support http-bogus-at-charset-windows-1250.bogus.css
+support http-bogus.bogus.css
+support http-windows-1250-at-charset-windows-1253.windows1250.css
+support no-decl-ascii-only.css
+support no-decl.css
+support utf8-bom.css
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css
new file mode 100644 (file)
index 0000000..50f9b77
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "bogus";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css
new file mode 100644 (file)
index 0000000..e7f067e
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "utf-16";
+#foo { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css
new file mode 100644 (file)
index 0000000..e7dbf57
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "utf-16";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css
new file mode 100644 (file)
index 0000000..cb51b41
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "utf-16be";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css
new file mode 100644 (file)
index 0000000..1132bfd
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css
new file mode 100644 (file)
index 0000000..38bb069
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css
new file mode 100644 (file)
index 0000000..6c06db0
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "windows-1250";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css
new file mode 100644 (file)
index 0000000..b5399b7
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css
new file mode 100644 (file)
index 0000000..eaadad0
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css
new file mode 100644 (file)
index 0000000..6c06db0
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "windows-1250";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers
new file mode 100644 (file)
index 0000000..f08dbd9
--- /dev/null
@@ -0,0 +1 @@
+Content-Type: text/css; charset=bogus
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css
new file mode 100644 (file)
index 0000000..ba2371f
--- /dev/null
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers
new file mode 100644 (file)
index 0000000..f08dbd9
--- /dev/null
@@ -0,0 +1 @@
+Content-Type: text/css; charset=bogus
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css
new file mode 100644 (file)
index 0000000..987dff3
--- /dev/null
@@ -0,0 +1,2 @@
+@charset "windows-1253";
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers
new file mode 100644 (file)
index 0000000..c0993d2
--- /dev/null
@@ -0,0 +1 @@
+Content-Type: text/css; charset=windows-1250
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css
new file mode 100644 (file)
index 0000000..0736f81
--- /dev/null
@@ -0,0 +1 @@
+#foo { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl.css
new file mode 100644 (file)
index 0000000..ba2371f
--- /dev/null
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/utf8-bom.css b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/utf8-bom.css
new file mode 100644 (file)
index 0000000..1dbf5cf
--- /dev/null
@@ -0,0 +1 @@
+#È { visibility:hidden }
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/w3c-import.log
new file mode 100644 (file)
index 0000000..5260611
--- /dev/null
@@ -0,0 +1,35 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/MANIFEST
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-bogus.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16-ascii-only.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-utf16be.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250-in-utf16be.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/at-charset-windows-1250.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/bomless-utf16be.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus-at-charset-windows-1250.bogus.css.headers
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-bogus.bogus.css.headers
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/http-windows-1250-at-charset-windows-1253.windows1250.css.headers
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl-ascii-only.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/no-decl.css
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/support/utf8-bom.css
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/w3c-import.log
new file mode 100644 (file)
index 0000000..d3087a4
--- /dev/null
@@ -0,0 +1,37 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/.htaccess
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/MANIFEST
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-bomless-utf16be.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl-ascii-only.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-utf16-css-no-decl.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-charset-attribute-bogus.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-1250-charset-attribute-windows-1253.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus-charset-attribute-windows-1250.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-bogus.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16-ascii-only.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-utf16be.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-at-charset-windows-1250-in-utf16be.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus-at-charset-windows-1250.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-bogus.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-http-windows-1250-at-charset-windows-1253.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-no-decl.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/page-windows-1251-css-utf8-bom.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250-expected.txt
new file mode 100644 (file)
index 0000000..223f01e
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS CSS charset: page windows-1251, charset attribute bogus 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset/xml-stylesheet-page-windows-1251-charset-attribute-windows-1250.xhtml
new file mode 100644 (file)
index 0000000..512df7a
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<?xml-stylesheet href="support/no-decl.css" charset="windows-1250"?>
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<title>CSS charset: page windows-1251, charset attribute bogus</title>
+<link rel="help" href="https://drafts.csswg.org/css-syntax-3/#determine-the-fallback-encoding"/>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head><body>
+<div id="log"></div>
+<div id="foo"></div>
+<script>
+var elm = document.getElementById('foo');
+elm.id = '\u010C';
+var t = async_test();
+onload = t.step_func(function(){
+  assert_equals(getComputedStyle(elm, '').visibility, 'hidden');
+  this.done();
+});
+</script>
+</body></html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers-expected.txt
new file mode 100644 (file)
index 0000000..69acbc7
--- /dev/null
@@ -0,0 +1,8 @@
+
+PASS decimal point between digits is valid in a number 
+PASS decimal point before digits is valid in a number 
+PASS decimal point after digits is invalid in a number 
+PASS decimal point between digits is valid in a dimension 
+PASS decimal point before digits is valid in a dimension 
+FAIL decimal point after digits is invalid in a dimension assert_not_equals: got disallowed value "1px"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers.html
new file mode 100644 (file)
index 0000000..e594686
--- /dev/null
@@ -0,0 +1,56 @@
+<!doctype html>
+<title>decimal points in numbers</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name=author title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-number">
+
+<style>
+
+.foo {}
+
+</style>
+<script>
+
+function roundTripNumber(input) {
+    const rule = document.styleSheets[0].cssRules[0].style;
+    const fallback = "0";
+    rule.setProperty("line-height", fallback);
+    rule.setProperty("line-height", input);
+    const value = rule.getPropertyValue("line-height");
+    if(value == fallback) return false;
+    return value;
+}
+
+test(()=>{
+    assert_equals(roundTripNumber("1.0"), "1");
+}, "decimal point between digits is valid in a number");
+test(()=>{
+    assert_equals(roundTripNumber(".1"), "0.1");
+}, "decimal point before digits is valid in a number");
+test(()=>{
+    assert_not_equals(roundTripNumber("1."), "1");
+}, "decimal point after digits is invalid in a number");
+
+function roundTripDimension(input) {
+    const rule = document.styleSheets[0].cssRules[0].style;
+    const fallback = "0px";
+    rule.setProperty("width", fallback);
+    rule.setProperty("width", input);
+    const value = rule.getPropertyValue("width");
+    if(value == fallback) return false;
+    return value;
+}
+
+test(()=>{
+    assert_equals(roundTripDimension("1.0px"), "1px");
+}, "decimal point between digits is valid in a dimension");
+test(()=>{
+    assert_equals(roundTripDimension(".1px"), "0.1px");
+}, "decimal point before digits is valid in a dimension");
+test(()=>{
+    assert_not_equals(roundTripDimension("1.px"), "1px");
+}, "decimal point after digits is invalid in a dimension");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace-expected.txt
new file mode 100644 (file)
index 0000000..13e9036
--- /dev/null
@@ -0,0 +1,11 @@
+
+PASS --foo-1:bar; 
+FAIL --foo-2: bar; assert_equals: expected "bar" but got " bar"
+FAIL --foo-3:bar ; assert_equals: expected "bar" but got "bar "
+FAIL --foo-4: bar ; assert_equals: expected "bar" but got " bar "
+FAIL --foo-5: bar !important; assert_equals: expected "bar" but got " bar "
+FAIL --foo-6: bar !important ; assert_equals: expected "bar" but got " bar "
+PASS --foo-7:bar!important; 
+PASS --foo-8:bar!important ; 
+FAIL --foo-9:bar (then ws until end of rule) assert_equals: expected "bar" but got "bar "
+foo
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace.html
new file mode 100644 (file)
index 0000000..a7d69d1
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Declarations trim whitespace from their beginning/ending</title>
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-declaration">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+    <div id="log"></div>
+    <style id="style-el">
+    #foo {
+        --foo-1:bar;
+        --foo-2: bar;
+        --foo-3:bar ;
+        --foo-4: bar ;
+        --foo-5: bar !important;
+        --foo-6: bar !important ;
+        --foo-7:bar!important;
+        --foo-8:bar!important ;
+        --foo-9:bar
+    }
+    </style>
+    <p id=foo>foo</p>
+    <script>
+    let stylesheet = getComputedStyle(document.querySelector("#foo"));
+    let canonical = "bar";
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-1"), canonical);
+    }, "--foo-1:bar;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-2"), canonical);
+    }, "--foo-2: bar;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-3"), canonical);
+    }, "--foo-3:bar ;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-4"), canonical);
+    }, "--foo-4: bar ;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-5"), canonical);
+    }, "--foo-5: bar !important;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-6"), canonical);
+    }, "--foo-6: bar !important ;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-7"), canonical);
+    }, "--foo-7:bar!important;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-8"), canonical);
+    }, "--foo-8:bar!important ;");
+    test(function() {
+        assert_equals(stylesheet.getPropertyValue("--foo-9"), canonical);
+    }, "--foo-9:bar (then ws until end of rule)");
+    </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof-expected.txt
new file mode 100644 (file)
index 0000000..118f4bc
--- /dev/null
@@ -0,0 +1,7 @@
+
+PASS Escaped EOF turns into a U+FFFD in a hash token, makes it 'ID' type. 
+PASS Escaped EOF turns into a U+FFFD in an ident token. 
+PASS Escaped EOF turns into a U+FFFD in a dimension token. 
+PASS Escaped EOF turns into a U+FFFD in a url token. 
+PASS Escaped EOF in a string is ignored. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof.html
new file mode 100644 (file)
index 0000000..5d47c34
--- /dev/null
@@ -0,0 +1,46 @@
+<!doctype html>
+<title>Escaped EOF</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-escaped-code-point">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-string-token">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-token">
+
+<style>foo { --foo:foo\</style>
+<style>foo { --foo:1foo\</style>
+<style>foo { --foo:url(foo\</style>
+<style>foo { --foo:"foo\</style>
+
+<script>
+test(()=>{
+    assert_throws("SyntaxError", ()=>{document.querySelector("#123");}, "numeric hash token is invalid in a selector");
+    document.querySelector("#foo\\"); // escaped-EOF in a hash token is valid in a selector
+}, "Escaped EOF turns into a U+FFFD in a hash token, makes it 'ID' type.");
+
+test(()=>{
+    const sh = document.styleSheets[0];
+    const val = sh.cssRules[0].style.getPropertyValue("--foo");
+    assert_equals("foo\ufffd", val);
+}, "Escaped EOF turns into a U+FFFD in an ident token.");
+
+test(()=>{
+    const sh = document.styleSheets[1];
+    const val = sh.cssRules[0].style.getPropertyValue("--foo");
+    assert_equals("1foo\ufffd", val);
+}, "Escaped EOF turns into a U+FFFD in a dimension token.");
+
+test(()=>{
+    const sh = document.styleSheets[2];
+    const val = sh.cssRules[0].style.getPropertyValue("--foo");
+    assert_equals("url(foo\ufffd)", val);
+}, "Escaped EOF turns into a U+FFFD in a url token.");
+
+test(()=>{
+    const sh = document.styleSheets[3];
+    const val = sh.cssRules[0].style.getPropertyValue("--foo");
+    assert_equals(`"foo"`, val);
+}, "Escaped EOF in a string is ignored.");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points-expected.txt
new file mode 100644 (file)
index 0000000..5b82284
--- /dev/null
@@ -0,0 +1,18 @@
+test1
+test2
+test3
+test4
+test A
+test B
+test C
+test D
+
+PASS one should be green 
+PASS two should be green 
+PASS three should be green 
+PASS four should be green 
+PASS five should be green 
+PASS six should be green 
+PASS seven should be green 
+PASS eight should be green 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points.html
new file mode 100644 (file)
index 0000000..36faef9
--- /dev/null
@@ -0,0 +1,73 @@
+<!doctype html>
+<script src='/resources/testharness.js'></script>
+<script src='/resources/testharnessreport.js'></script>
+<title>Testing valid ident based on first three code points</title>
+
+<link rel="author" title="Greg Whitworth" href="gwhit@microsoft.com" />
+<link rel="help" href="https://drafts.csswg.org/css-syntax-3/#would-start-an-identifier" />
+<style>
+    main div {
+      background-color:red;
+    }
+
+    div[name=one],
+    div[name=two] {
+        background: green;
+    }
+
+    #1 {
+      background-color:red;
+    }
+
+    #-2 {
+      background-color:red;
+    }
+
+    #--3 {
+      background-color:green;
+    }
+
+    #---4 {
+      background-color:green;
+    }
+
+    #a {
+      background-color:green;
+    }
+
+    #-b {
+      background-color:green;
+    }
+
+    #--c {
+      background-color:green;
+    }
+
+    #---d {
+      background-color:green;
+    }
+</style>
+<body>
+    <main>
+        <div id="1" class="item" name="one">test1</div>
+        <div id="-2" class="item" name="two">test2</div>
+        <div id="--3" class="item" name="three">test3</div>
+        <div id="---4" class="item" name="four">test4</div>
+
+        <div id="a" class="item" name="five">test A</div>
+        <div id="-b" class="item" name="six">test B</div>
+        <div id="--c" class="item" name="seven">test C</div>
+        <div id="---d" class="item" name="eight">test D</div>
+    </main>
+
+    <script>
+        var items = document.getElementsByClassName('item');
+
+        for(var i=0; i < items.length; i++) {
+            test(function() {
+                assert_equals(window.getComputedStyle(items[i]).getPropertyValue('background-color'), "rgb(0, 128, 0)");
+            }, items[i].getAttribute('name') + " should be green");
+        }
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges-expected.txt
new file mode 100644 (file)
index 0000000..dec8b30
--- /dev/null
@@ -0,0 +1,40 @@
+
+PASS "0" becomes "0" 
+PASS "1" becomes "1" 
+PASS "2" becomes "2" 
+PASS "3" becomes "3" 
+PASS "4" becomes "4" 
+PASS "5" becomes "5" 
+PASS "6" becomes "6" 
+PASS "7" becomes "7" 
+PASS "8" becomes "8" 
+PASS "9" becomes "9" 
+PASS "foo\ 1" becomes "parse error" 
+PASS "foo\ 2" becomes "parse error" 
+PASS "foo\ 3" becomes "parse error" 
+PASS "foo\ 4" becomes "parse error" 
+PASS "foo\ 5" becomes "parse error" 
+PASS "foo\ 6" becomes "parse error" 
+PASS "foo\a" becomes "parse error" 
+PASS "foo\b" becomes "parse error" 
+PASS "foo\v" becomes "parse error" 
+PASS "foo\ e" becomes "parse error" 
+PASS "foo\ f" becomes "parse error" 
+PASS "foo\10" becomes "parse error" 
+PASS "foo\11" becomes "parse error" 
+PASS "foo\12" becomes "parse error" 
+PASS "foo\13" becomes "parse error" 
+PASS "foo\14" becomes "parse error" 
+PASS "foo\15" becomes "parse error" 
+PASS "foo\16" becomes "parse error" 
+PASS "foo\17" becomes "parse error" 
+PASS "foo\18" becomes "parse error" 
+PASS "foo\19" becomes "parse error" 
+PASS "foo\1a" becomes "parse error" 
+PASS "foo\e" becomes "parse error" 
+PASS "foo\1c" becomes "parse error" 
+PASS "foo\1d" becomes "parse error" 
+PASS "foo\1e" becomes "parse error" 
+PASS "foo\1f" becomes "parse error" 
+PASS "foo\7f" becomes "parse error" 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges.html
new file mode 100644 (file)
index 0000000..ac486bd
--- /dev/null
@@ -0,0 +1,60 @@
+<!doctype html>
+<title>Inclusive Ranges</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+foo { z-index: 0; }
+
+</style>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#digit">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#non-printable-code-point">
+
+<script>
+
+function roundtripIdent(str) {
+    const rule = document.styleSheets[0].cssRules[0];
+    rule.selectorText = "original-ident";
+    rule.selectorText = str;
+    // Check for parse error.
+    if(rule.selectorText == "original-ident") return "parse error";
+    return rule.selectorText;
+}
+function roundtripInteger(str) {
+    const rule = document.styleSheets[0].cssRules[0];
+    rule.style.zIndex = "12345";
+    rule.style.zIndex = str;
+    // Check for parse error.
+    if(rule.style.zIndex == "12345") return "parse error";
+    return rule.style.zIndex;
+}
+function testInteger(input, expected) {
+    test(()=>{
+        assert_equals(roundtripInteger(input), expected);
+    }, `"${input}" becomes "${expected}"`);
+}
+function testIdent(input, expected) {
+    test(()=>{
+        assert_equals(roundtripIdent(input), expected);
+    }, `"${input}" becomes "${expected}"`);
+}
+
+/* Digits are the inclusive range 0-9 */
+for(var i = 0; i <= 9; i++) {
+    testInteger(i+"", i+"");
+}
+
+/* Non-printables are the inclusive ranges 0-8, b, e-1f, or 7f */
+// 0 never shows up due to preprocessing, so start at 1
+for(var i = 1; i <= 8; i++) {
+    testIdent("foo"+String.fromCodePoint(i), "parse error");
+}
+testIdent("foo"+String.fromCodePoint(0xb), "parse error");
+for(var i = 0xe; i <= 0x1f; i++) {
+    testIdent("foo"+String.fromCodePoint(i), "parse error");
+}
+testIdent("foo" + String.fromCodePoint(0x7f), "parse error");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing-expected.txt
new file mode 100644 (file)
index 0000000..cf032cb
--- /dev/null
@@ -0,0 +1,12 @@
+
+PASS "foo\0" becomes "foo�" 
+PASS "f\0oo" becomes "f�oo" 
+PASS "\0foo" becomes "�foo" 
+PASS "\0" becomes "�" 
+PASS "\0\0\0" becomes "���" 
+FAIL "fooU+d800" becomes "foo�" assert_equals: expected "foo\ufffd" but got "foo�"
+FAIL "fU+d800oo" becomes "f�oo" assert_equals: expected "f\ufffdoo" but got "f�oo"
+FAIL "U+d800foo" becomes "�foo" assert_equals: expected "\ufffdfoo" but got "�foo"
+FAIL "U+d800" becomes "�" assert_equals: expected "\ufffd" but got "�"
+FAIL "U+d800U+d800U+d800" becomes "���" assert_equals: expected "\ufffd\ufffd\ufffd" but got "���"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing.html
new file mode 100644 (file)
index 0000000..9ef9a73
--- /dev/null
@@ -0,0 +1,46 @@
+<!doctype html>
+<title>Input Preprocessing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+foo { color: blue; }
+
+</style>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#input-preprocessing">
+
+<script>
+
+function roundtripIdent(str) {
+    const rule = document.styleSheets[0].cssRules[0];
+    rule.selectorText = "original-ident";
+    rule.selectorText = str;
+    // Check for parse error.
+    if(rule.selectorText == "original-ident") return "parse error";
+    return rule.selectorText;
+}
+function testParsing(input, expected) {
+    test(()=>{
+        assert_equals(roundtripIdent(input), expected);
+    }, `"${input}" becomes "${expected}"`);
+}
+
+/* Can't figure out how to test the newline normalization... */
+
+/* NULL becomes FFFD */
+testParsing("foo\x00", "foo\ufffd");
+testParsing("f\x00oo", "f\ufffdoo");
+testParsing("\x00foo", "\ufffdfoo");
+testParsing("\x00", "\ufffd");
+testParsing("\x00\x00\x00", "\ufffd\ufffd\ufffd");
+
+/* surrogates become FFFD */
+testParsing("foo\ud800", "foo\ufffd");
+testParsing("f\ud800oo", "f\ufffdoo");
+testParsing("\ud800foo", "\ufffdfoo");
+testParsing("\ud800", "\ufffd");
+testParsing("\ud800\ud800\ud800", "\ufffd\ufffd\ufffd");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens-expected.txt
new file mode 100644 (file)
index 0000000..171f330
--- /dev/null
@@ -0,0 +1,67 @@
+
+FAIL Serialization of consecutive foo and bar tokens. assert_not_equals: Result must have a comment between foo and bar got disallowed value "foobar"
+FAIL Serialization of consecutive foo and bar() tokens. assert_not_equals: Result must have a comment between foo and bar() got disallowed value "foobar()"
+FAIL Serialization of consecutive foo and url(bar) tokens. assert_not_equals: Result must have a comment between foo and url(bar) got disallowed value "foourl(bar)"
+FAIL Serialization of consecutive foo and - tokens. assert_not_equals: Result must have a comment between foo and - got disallowed value "foo-"
+FAIL Serialization of consecutive foo and 123 tokens. assert_not_equals: Result must have a comment between foo and 123 got disallowed value "foo123"
+FAIL Serialization of consecutive foo and 123% tokens. assert_not_equals: Result must have a comment between foo and 123% got disallowed value "foo123%"
+FAIL Serialization of consecutive foo and 123em tokens. assert_not_equals: Result must have a comment between foo and 123em got disallowed value "foo123em"
+FAIL Serialization of consecutive foo and --> tokens. assert_not_equals: Result must have a comment between foo and --> got disallowed value "foo-->"
+FAIL Serialization of consecutive foo and () tokens. assert_not_equals: Result must have a comment between foo and () got disallowed value "foo()"
+FAIL Serialization of consecutive @foo and bar tokens. assert_not_equals: Result must have a comment between @foo and bar got disallowed value "@foobar"
+FAIL Serialization of consecutive @foo and bar() tokens. assert_not_equals: Result must have a comment between @foo and bar() got disallowed value "@foobar()"
+FAIL Serialization of consecutive @foo and url(bar) tokens. assert_not_equals: Result must have a comment between @foo and url(bar) got disallowed value "@foourl(bar)"
+FAIL Serialization of consecutive @foo and - tokens. assert_not_equals: Result must have a comment between @foo and - got disallowed value "@foo-"
+FAIL Serialization of consecutive @foo and 123 tokens. assert_not_equals: Result must have a comment between @foo and 123 got disallowed value "@foo123"
+FAIL Serialization of consecutive @foo and 123% tokens. assert_not_equals: Result must have a comment between @foo and 123% got disallowed value "@foo123%"
+FAIL Serialization of consecutive @foo and 123em tokens. assert_not_equals: Result must have a comment between @foo and 123em got disallowed value "@foo123em"
+FAIL Serialization of consecutive @foo and --> tokens. assert_not_equals: Result must have a comment between @foo and --> got disallowed value "@foo-->"
+FAIL Serialization of consecutive #foo and bar tokens. assert_not_equals: Result must have a comment between #foo and bar got disallowed value "#foobar"
+FAIL Serialization of consecutive #foo and bar() tokens. assert_not_equals: Result must have a comment between #foo and bar() got disallowed value "#foobar()"
+FAIL Serialization of consecutive #foo and url(bar) tokens. assert_not_equals: Result must have a comment between #foo and url(bar) got disallowed value "#foourl(bar)"
+FAIL Serialization of consecutive #foo and - tokens. assert_not_equals: Result must have a comment between #foo and - got disallowed value "#foo-"
+FAIL Serialization of consecutive #foo and 123 tokens. assert_not_equals: Result must have a comment between #foo and 123 got disallowed value "#foo123"
+FAIL Serialization of consecutive #foo and 123% tokens. assert_not_equals: Result must have a comment between #foo and 123% got disallowed value "#foo123%"
+FAIL Serialization of consecutive #foo and 123em tokens. assert_not_equals: Result must have a comment between #foo and 123em got disallowed value "#foo123em"
+FAIL Serialization of consecutive #foo and --> tokens. assert_not_equals: Result must have a comment between #foo and --> got disallowed value "#foo-->"
+FAIL Serialization of consecutive 123foo and bar tokens. assert_not_equals: Result must have a comment between 123foo and bar got disallowed value "123foobar"
+FAIL Serialization of consecutive 123foo and bar() tokens. assert_not_equals: Result must have a comment between 123foo and bar() got disallowed value "123foobar()"
+FAIL Serialization of consecutive 123foo and url(bar) tokens. assert_not_equals: Result must have a comment between 123foo and url(bar) got disallowed value "123foourl(bar)"
+FAIL Serialization of consecutive 123foo and - tokens. assert_not_equals: Result must have a comment between 123foo and - got disallowed value "123foo-"
+FAIL Serialization of consecutive 123foo and 123 tokens. assert_not_equals: Result must have a comment between 123foo and 123 got disallowed value "123foo123"
+FAIL Serialization of consecutive 123foo and 123% tokens. assert_not_equals: Result must have a comment between 123foo and 123% got disallowed value "123foo123%"
+FAIL Serialization of consecutive 123foo and 123em tokens. assert_not_equals: Result must have a comment between 123foo and 123em got disallowed value "123foo123em"
+FAIL Serialization of consecutive 123foo and --> tokens. assert_not_equals: Result must have a comment between 123foo and --> got disallowed value "123foo-->"
+FAIL Serialization of consecutive # and bar tokens. assert_not_equals: Result must have a comment between # and bar got disallowed value "#bar"
+FAIL Serialization of consecutive # and bar() tokens. assert_not_equals: Result must have a comment between # and bar() got disallowed value "#bar()"
+FAIL Serialization of consecutive # and url(bar) tokens. assert_not_equals: Result must have a comment between # and url(bar) got disallowed value "#url(bar)"
+FAIL Serialization of consecutive # and - tokens. assert_not_equals: Result must have a comment between # and - got disallowed value "#-"
+FAIL Serialization of consecutive # and 123 tokens. assert_not_equals: Result must have a comment between # and 123 got disallowed value "#123"
+FAIL Serialization of consecutive # and 123% tokens. assert_not_equals: Result must have a comment between # and 123% got disallowed value "#123%"
+FAIL Serialization of consecutive # and 123em tokens. assert_not_equals: Result must have a comment between # and 123em got disallowed value "#123em"
+FAIL Serialization of consecutive - and bar tokens. assert_not_equals: Result must have a comment between - and bar got disallowed value "-bar"
+FAIL Serialization of consecutive - and bar() tokens. assert_not_equals: Result must have a comment between - and bar() got disallowed value "-bar()"
+FAIL Serialization of consecutive - and url(bar) tokens. assert_not_equals: Result must have a comment between - and url(bar) got disallowed value "-url(bar)"
+FAIL Serialization of consecutive - and - tokens. assert_not_equals: Result must have a comment between - and - got disallowed value "--"
+FAIL Serialization of consecutive - and 123 tokens. assert_not_equals: Result must have a comment between - and 123 got disallowed value "-123"
+FAIL Serialization of consecutive - and 123% tokens. assert_not_equals: Result must have a comment between - and 123% got disallowed value "-123%"
+FAIL Serialization of consecutive - and 123em tokens. assert_not_equals: Result must have a comment between - and 123em got disallowed value "-123em"
+FAIL Serialization of consecutive 123 and bar tokens. assert_not_equals: Result must have a comment between 123 and bar got disallowed value "123bar"
+FAIL Serialization of consecutive 123 and bar() tokens. assert_not_equals: Result must have a comment between 123 and bar() got disallowed value "123bar()"
+FAIL Serialization of consecutive 123 and url(bar) tokens. assert_not_equals: Result must have a comment between 123 and url(bar) got disallowed value "123url(bar)"
+FAIL Serialization of consecutive 123 and 123 tokens. assert_not_equals: Result must have a comment between 123 and 123 got disallowed value "123123"
+FAIL Serialization of consecutive 123 and 123% tokens. assert_not_equals: Result must have a comment between 123 and 123% got disallowed value "123123%"
+FAIL Serialization of consecutive 123 and 123em tokens. assert_not_equals: Result must have a comment between 123 and 123em got disallowed value "123123em"
+FAIL Serialization of consecutive 123 and % tokens. assert_not_equals: Result must have a comment between 123 and % got disallowed value "123%"
+FAIL Serialization of consecutive @ and bar tokens. assert_not_equals: Result must have a comment between @ and bar got disallowed value "@bar"
+FAIL Serialization of consecutive @ and bar() tokens. assert_not_equals: Result must have a comment between @ and bar() got disallowed value "@bar()"
+FAIL Serialization of consecutive @ and url(bar) tokens. assert_not_equals: Result must have a comment between @ and url(bar) got disallowed value "@url(bar)"
+FAIL Serialization of consecutive @ and - tokens. assert_not_equals: Result must have a comment between @ and - got disallowed value "@-"
+FAIL Serialization of consecutive . and 123 tokens. assert_not_equals: Result must have a comment between . and 123 got disallowed value ".123"
+FAIL Serialization of consecutive . and 123% tokens. assert_not_equals: Result must have a comment between . and 123% got disallowed value ".123%"
+FAIL Serialization of consecutive . and 123em tokens. assert_not_equals: Result must have a comment between . and 123em got disallowed value ".123em"
+FAIL Serialization of consecutive + and 123 tokens. assert_not_equals: Result must have a comment between + and 123 got disallowed value "+123"
+FAIL Serialization of consecutive + and 123% tokens. assert_not_equals: Result must have a comment between + and 123% got disallowed value "+123%"
+FAIL Serialization of consecutive + and 123em tokens. assert_not_equals: Result must have a comment between + and 123em got disallowed value "+123em"
+FAIL Serialization of consecutive / and * tokens. assert_not_equals: Result must have a comment between / and * got disallowed value "/*"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html
new file mode 100644 (file)
index 0000000..21eebca
--- /dev/null
@@ -0,0 +1,107 @@
+<!doctype html>
+<title>Serialization of consecutive tokens.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#serialization">
+<body>
+<!--
+    The serialization chapter provides a table listing all the combinations of consecutive tokens that will,
+    if naively serialized next to each other,
+    produce a different set of tokens when re-parsed.
+    The spec requires that a comment must be inserted between such tokens in the serialization,
+    to ensure that they round-trip correctly.
+-->
+
+<script>
+
+function testTokenPairs(t1, t2) {
+    const b = document.body;
+    test(()=>{
+        b.style.setProperty("--t1", t1);
+        b.style.setProperty("--t2", t2);
+        b.style.setProperty("--result", "var(--t1)var(--t2)");
+        const result = getComputedStyle(b).getPropertyValue("--result");
+        assert_equals(result.slice(0, t1.length), t1, `Result must start with ${t1}`);
+        assert_equals(result.slice(-t2.length), t2, `Result must end with ${t2}`);
+        assert_not_equals(result, t1+t2, `Result must have a comment between ${t1} and ${t2}`);
+    }, `Serialization of consecutive ${t1} and ${t2} tokens.`);
+}
+testTokenPairs("foo", "bar");
+testTokenPairs("foo", "bar()");
+testTokenPairs("foo", "url(bar)");
+testTokenPairs("foo", "-");
+testTokenPairs("foo", "123");
+testTokenPairs("foo", "123%");
+testTokenPairs("foo", "123em");
+testTokenPairs("foo", "-->");
+testTokenPairs("foo", "()");
+
+testTokenPairs("@foo", "bar");
+testTokenPairs("@foo", "bar()");
+testTokenPairs("@foo", "url(bar)");
+testTokenPairs("@foo", "-");
+testTokenPairs("@foo", "123");
+testTokenPairs("@foo", "123%");
+testTokenPairs("@foo", "123em");
+testTokenPairs("@foo", "-->");
+
+testTokenPairs("#foo", "bar");
+testTokenPairs("#foo", "bar()");
+testTokenPairs("#foo", "url(bar)");
+testTokenPairs("#foo", "-");
+testTokenPairs("#foo", "123");
+testTokenPairs("#foo", "123%");
+testTokenPairs("#foo", "123em");
+testTokenPairs("#foo", "-->");
+
+testTokenPairs("123foo", "bar");
+testTokenPairs("123foo", "bar()");
+testTokenPairs("123foo", "url(bar)");
+testTokenPairs("123foo", "-");
+testTokenPairs("123foo", "123");
+testTokenPairs("123foo", "123%");
+testTokenPairs("123foo", "123em");
+testTokenPairs("123foo", "-->");
+
+testTokenPairs("#", "bar");
+testTokenPairs("#", "bar()");
+testTokenPairs("#", "url(bar)");
+testTokenPairs("#", "-");
+testTokenPairs("#", "123");
+testTokenPairs("#", "123%");
+testTokenPairs("#", "123em");
+
+testTokenPairs("-", "bar");
+testTokenPairs("-", "bar()");
+testTokenPairs("-", "url(bar)");
+testTokenPairs("-", "-");
+testTokenPairs("-", "123");
+testTokenPairs("-", "123%");
+testTokenPairs("-", "123em");
+
+testTokenPairs("123", "bar");
+testTokenPairs("123", "bar()");
+testTokenPairs("123", "url(bar)");
+testTokenPairs("123", "123");
+testTokenPairs("123", "123%");
+testTokenPairs("123", "123em");
+testTokenPairs("123", "%");
+
+testTokenPairs("@", "bar");
+testTokenPairs("@", "bar()");
+testTokenPairs("@", "url(bar)");
+testTokenPairs("@", "-");
+
+testTokenPairs(".", "123");
+testTokenPairs(".", "123%");
+testTokenPairs(".", "123em");
+
+testTokenPairs("+", "123");
+testTokenPairs("+", "123%");
+testTokenPairs("+", "123em");
+
+testTokenPairs("/", "*");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs-expected.txt
new file mode 100644 (file)
index 0000000..9230641
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS "[foo]" is a valid selector 
+PASS "[foo" is a valid selector 
+PASS ":nth-child(1)" is a valid selector 
+PASS ":nth-child(1" is a valid selector 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs.html
new file mode 100644 (file)
index 0000000..3d79403
--- /dev/null
@@ -0,0 +1,36 @@
+<!doctype html>
+<title>Unclosed Constructs Are Valid</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#rule-defs">
+
+<!--
+Tests that unclosed constructs are valid and match grammars,
+because grammar-matching only sees the "block",
+not the opening/closing characters themselves.
+-->
+
+<script>
+
+function validSelector(str) {
+    try {
+        document.querySelector(str);
+        return true;
+    } catch(e) {
+        return false;
+    }
+}
+function shouldBeValid(str) {
+    test(()=>{
+        assert_true(validSelector(str));
+    }, `"${str}" is a valid selector`)
+}
+
+shouldBeValid("[foo]");
+shouldBeValid("[foo");
+shouldBeValid(":nth-child(1)");
+shouldBeValid(":nth-child(1");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof-expected.txt
new file mode 100644 (file)
index 0000000..f469ae3
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS Unclosed url token at EOF is valid. 
+PASS Unclosed empty url token at EOF is valid. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof.html
new file mode 100644 (file)
index 0000000..7157896
--- /dev/null
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>Unclosed URL At EOF</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name=author title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-url-token">
+
+<div id=test1-control style="background-image:url(foo)"></div>
+<div id=test1-experiment style="background-image:url(foo"></div>
+
+<div id=test2-control style="background-image:url()"></div>
+<div id=test2-experiment style="background-image:url("></div>
+
+<script>
+
+test(()=>{
+    const control = document.querySelector("#test1-control");
+    const experiment = document.querySelector("#test1-experiment");
+    assert_equals(control.style.backgroundImage, experiment.style.backgroundImage);
+}, "Unclosed url token at EOF is valid.");
+
+test(()=>{
+    const control = document.querySelector("#test2-control");
+    const experiment = document.querySelector("#test2-experiment");
+    assert_equals(control.style.backgroundImage, experiment.style.backgroundImage);
+}, "Unclosed empty url token at EOF is valid.");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector-expected.txt
new file mode 100644 (file)
index 0000000..959a415
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Unicode range is not a token, and doesn't cause confusion in selectors assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector.html
new file mode 100644 (file)
index 0000000..db09540
--- /dev/null
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Unicode range is not a token, and doesn't cause confusion in selectors</title>
+<link name="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://drafts.csswg.org/css-syntax/#urange">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  a { color: red }
+  u+a { color: green }
+</style>
+<u></u><a></a>
+<script>
+  test(function() {
+    assert_equals(
+      getComputedStyle(document.querySelector("a")).color,
+      "rgb(0, 128, 0)"
+    );
+  }, "Unicode range is not a token, and doesn't cause confusion in selectors");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing-expected.txt
new file mode 100644 (file)
index 0000000..5de7ca7
--- /dev/null
@@ -0,0 +1,94 @@
+
+FAIL "u/**/+/**/a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got ""
+FAIL "u+abc" => "U+ABC" assert_equals: expected "U+ABC" but got ""
+FAIL "U+abc" => "U+ABC" assert_equals: expected "U+ABC" but got ""
+FAIL "u+ABC" => "U+ABC" assert_equals: expected "U+ABC" but got ""
+FAIL "U+ABC" => "U+ABC" assert_equals: expected "U+ABC" but got ""
+FAIL "u+AbC" => "U+ABC" assert_equals: expected "U+ABC" but got ""
+FAIL "u+efg" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+ abc" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u +abc" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u + abc" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "U + a b c" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+a" => "U+A" assert_equals: expected "U+A" but got ""
+FAIL "u+aa" => "U+AA" assert_equals: expected "U+AA" but got ""
+FAIL "u+aaa" => "U+AAA" assert_equals: expected "U+AAA" but got ""
+FAIL "u+aaaa" => "U+AAAA" assert_equals: expected "U+AAAA" but got ""
+FAIL "u+aaaaa" => "U+AAAAA" assert_equals: expected "U+AAAAA" but got ""
+FAIL "u+aaaaaaa" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+a?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got ""
+FAIL "u+a??" => "U+A00-AFF" assert_equals: expected "U+A00-AFF" but got ""
+FAIL "u+a???" => "U+A000-AFFF" assert_equals: expected "U+A000-AFFF" but got ""
+FAIL "u+a????" => "U+A0000-AFFFF" assert_equals: expected "U+A0000-AFFFF" but got ""
+FAIL "u+aaaaaa?" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+aaaaa??" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+aaaa???" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+aaa????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+aa?????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+a??????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+a?a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+aaaaaa" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+a?????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u/**/+0a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got ""
+FAIL "u+0a" => "U+A" assert_equals: expected "U+A" but got ""
+FAIL "U+0a0" => "U+A0" assert_equals: expected "U+A0" but got ""
+FAIL "u+0aaaaa" => "U+AAAAA" assert_equals: expected "U+AAAAA" but got ""
+FAIL "u+0aaaaaa" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0a0000" => "U+A0000" assert_equals: expected "U+A0000" but got ""
+FAIL "u+0a00000" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0aaaaa0" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+00000a" => "U+A" assert_equals: expected "U+A" but got ""
+FAIL "u+00000aa" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+00000a0" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+000000a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0a????" => "U+A0000-AFFFF" assert_equals: expected "U+A0000-AFFFF" but got ""
+FAIL "u+0a?????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+00a????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+22222a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+1e9a" => "U+1E9A" assert_equals: expected "U+1E9A" but got ""
+FAIL "u/**/+0/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got ""
+FAIL "u/**/0" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+00" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+000" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+0000" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+00000" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+000000" => "U+0" assert_equals: expected "U+0" but got ""
+FAIL "u+0000000" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+00000?" => "U+0-F" assert_equals: expected "U+0-F" but got ""
+FAIL "u+0?????" => "U+0-FFFFF" assert_equals: expected "U+0-FFFFF" but got ""
+FAIL "u+0?a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+000000?" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+00000??" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0??????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+1e3" => "U+1E3" assert_equals: expected "U+1E3" but got ""
+FAIL "u+1e-20" => "U+1E-20" assert_equals: expected "U+1E-20" but got ""
+FAIL "u+222222" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+2?????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u/**/+0/**/-0a" => "U+0-A" assert_equals: expected "U+0-A" but got ""
+FAIL "u+0-0a" => "U+0-A" assert_equals: expected "U+0-A" but got ""
+FAIL "u+000000-0aaaaa" => "U+0-AAAAA" assert_equals: expected "U+0-AAAAA" but got ""
+FAIL "u+0000000-0a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0-0aaaaaa" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0-000000a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0+0a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0?-0a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0-0a?" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+222222-22222a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u/**/+0/**/-1" => "U+0-1" assert_equals: expected "U+0-1" but got ""
+FAIL "u+0-1" => "U+0-1" assert_equals: expected "U+0-1" but got ""
+FAIL "u-0-1" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u-0+1" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0+1" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+000000-000001" => "U+0-1" assert_equals: expected "U+0-1" but got ""
+FAIL "u+0000000-1" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0-0000001" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+0-222222" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u/**/+/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got ""
+FAIL "u+?" => "U+0-F" assert_equals: expected "U+0-F" but got ""
+FAIL "u+?????" => "u+0-FFFFF" assert_equals: expected "U+0-FFFFF" but got ""
+FAIL "u+???????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+?a" is invalid assert_equals: expected "U+1357" but got ""
+FAIL "u+??????" is invalid assert_equals: expected "U+1357" but got ""
+FAIL u+a is a valid selector assert_equals: expected "u + a" but got ".error"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing.html
new file mode 100644 (file)
index 0000000..2d34e05
--- /dev/null
@@ -0,0 +1,173 @@
+<!doctype html>
+<title>Urange Parsing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+@font-face {
+    font-family: foo;
+    src: url(http://example.com);
+}
+
+.error {}
+
+</style>
+
+<meta name=author title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#urange-syntax">
+
+<script>
+
+function testUrange(input, expected) {
+    test(()=>{
+        const rule = document.styleSheets[0].cssRules[0];
+        rule.style.setProperty("unicode-range", "U+1357");
+        rule.style.setProperty("unicode-range", input);
+        assert_equals(rule.style.getPropertyValue("unicode-range").toUpperCase(), expected.toUpperCase());
+    }, `"${input}" => "${expected}"`)
+}
+function testInvalidUrange(input) {
+    test(()=>{
+        const rule = document.styleSheets[0].cssRules[0];
+        rule.style.setProperty("unicode-range", "U+1357");
+        rule.style.setProperty("unicode-range", input);
+        assert_equals(rule.style.getPropertyValue("unicode-range").toUpperCase(), "U+1357");
+    }, `"${input}" is invalid`);
+}
+
+/* First exercise all the clauses individually */
+//<urange> =
+//  u '+' <ident-token> '?'* |
+/* comments can go between tokens */
+testUrange("u/**/+/**/a/**/?", "U+A0-AF");
+/* capitalization doesn't matter */
+testUrange("u+abc", "U+ABC");
+testUrange("U+abc", "U+ABC");
+testUrange("u+ABC", "U+ABC");
+testUrange("U+ABC", "U+ABC");
+testUrange("u+AbC", "U+ABC");
+/* only hex */
+testInvalidUrange("u+efg");
+/* no spacing */
+testInvalidUrange("u+ abc");
+testInvalidUrange("u +abc");
+testInvalidUrange("u + abc");
+testInvalidUrange("U + a b c");
+/* 1-6 characters */
+testUrange("u+a", "U+A");
+testUrange("u+aa", "U+AA");
+testUrange("u+aaa", "U+AAA");
+testUrange("u+aaaa", "U+AAAA");
+testUrange("u+aaaaa", "U+AAAAA");
+testInvalidUrange("u+aaaaaaa");
+/* Or ? at the end, still up to 6 */
+testUrange("u+a?", "U+A0-AF");
+testUrange("u+a??", "U+A00-AFF");
+testUrange("u+a???", "U+A000-AFFF");
+testUrange("u+a????", "U+A0000-AFFFF");
+testInvalidUrange("u+aaaaaa?");
+testInvalidUrange("u+aaaaa??");
+testInvalidUrange("u+aaaa???");
+testInvalidUrange("u+aaa????");
+testInvalidUrange("u+aa?????");
+testInvalidUrange("u+a??????");
+/* no characters after ? */
+testInvalidUrange("u+a?a");
+// Too large!
+testInvalidUrange("u+aaaaaa");
+testInvalidUrange("u+a?????");
+
+//  u <dimension-token> '?'* |
+testUrange("u/**/+0a/**/?", "U+A0-AF");
+testUrange("u+0a", "U+A");
+testUrange("U+0a0", "U+A0");
+testUrange("u+0aaaaa", "U+AAAAA");
+testInvalidUrange("u+0aaaaaa");
+testUrange("u+0a0000", "U+A0000");
+testInvalidUrange("u+0a00000");
+testInvalidUrange("u+0aaaaa0");
+testUrange("u+00000a", "U+A");
+testInvalidUrange("u+00000aa");
+testInvalidUrange("u+00000a0")
+testInvalidUrange("u+000000a");
+testUrange("u+0a????", "U+A0000-AFFFF");
+testInvalidUrange("u+0a?????");
+testInvalidUrange("u+00a????");
+// Too large!
+testInvalidUrange("u+22222a");
+// Scinot!
+testUrange("u+1e9a", "U+1E9A");
+
+//  u <number-token> '?'* |
+testUrange("u/**/+0/**/?", "U+0-F");
+testInvalidUrange("u/**/0");
+testUrange("u+0", "U+0");
+testUrange("u+00", "U+0");
+testUrange("u+000", "U+0");
+testUrange("u+0000", "U+0");
+testUrange("u+00000", "U+0");
+testUrange("u+000000", "U+0");
+testInvalidUrange("u+0000000");
+testUrange("u+00000?", "U+0-F");
+testUrange("u+0?????", "U+0-FFFFF");
+testInvalidUrange("u+0?a");
+testInvalidUrange("u+000000?");
+testInvalidUrange("u+00000??");
+testInvalidUrange("u+0??????");
+// Scinot!
+testUrange("u+1e3", "U+1E3");
+testUrange("u+1e-20", "U+1E-20");
+// Too large!
+testInvalidUrange("u+222222");
+testInvalidUrange("u+2?????");
+
+//  u <number-token> <dimension-token> |
+testUrange("u/**/+0/**/-0a", "U+0-A");
+testUrange("u+0-0a", "U+0-A");
+testUrange("u+000000-0aaaaa", "U+0-AAAAA");
+testInvalidUrange("u+0000000-0a");
+testInvalidUrange("u+0-0aaaaaa");
+testInvalidUrange("u+0-000000a");
+testInvalidUrange("u+0+0a");
+testInvalidUrange("u+0?-0a");
+testInvalidUrange("u+0-0a?");
+// Too large!
+testInvalidUrange("u+222222-22222a");
+
+//  u <number-token> <number-token> |
+testUrange("u/**/+0/**/-1", "U+0-1");
+testUrange("u+0-1", "U+0-1");
+testInvalidUrange("u-0-1");
+testInvalidUrange("u-0+1");
+testInvalidUrange("u+0+1");
+testUrange("u+000000-000001", "U+0-1");
+testInvalidUrange("u+0000000-1");
+testInvalidUrange("u+0-0000001");
+// Too large!
+testInvalidUrange("u+0-222222");
+
+//  u '+' '?'+
+testUrange("u/**/+/**/?", "U+0-F");
+testUrange("u+?", "U+0-F");
+testUrange("u+?????", "u+0-FFFFF");
+testInvalidUrange("u+???????");
+testInvalidUrange("u+?a");
+// U+FFFFFF is too large!
+testInvalidUrange("u+??????");
+
+
+/* Finally, verify that u+a is properly parsed
+   as IDENT(u) DELIM(+) IDENT(a) in other contexts */
+
+test(()=>{
+    const rule = document.styleSheets[0].cssRules[1];
+    // Establish that it works with whitespace...
+    rule.selectorText = "u + a";
+    assert_equals(rule.selectorText, "u + a");
+    // And then again without...
+    rule.selectorText = ".error";
+    rule.selectorText = "u+a";
+    assert_equals(rule.selectorText, "u + a");
+}, "u+a is a valid selector");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt
new file mode 100644 (file)
index 0000000..1248699
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL whitespace is optional between url( token and the string token assert_equals: expected "url(\"foo\")" but got "url(\"http://localhost:8800/css/css-syntax/foo\")"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption.html
new file mode 100644 (file)
index 0000000..2fd5587
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<title>url whitespace consumption</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+.foo {}
+
+</style>
+
+<meta name=author title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-ident-like-token">
+
+<script>
+
+function roundTripUrl(input) {
+    const rule = document.styleSheets[0].cssRules[0].style;
+    const fallback = 'url("fallback")';
+    rule.setProperty("background-image", fallback);
+    rule.setProperty("background-image", input);
+    const value = rule.getPropertyValue("background-image");
+    if(value == fallback) return false;
+    return value;
+}
+
+test(()=>{
+    assert_equals(roundTripUrl('url("foo")'), 'url("foo")');
+    assert_equals(roundTripUrl('url( "foo")'), 'url("foo")');
+    assert_equals(roundTripUrl('url("foo" )'), 'url("foo")');
+}, "whitespace is optional between url( token and the string token");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/w3c-import.log
new file mode 100644 (file)
index 0000000..d72b1eb
--- /dev/null
@@ -0,0 +1,34 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-parsing.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/anb-serialization.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/cdc-vs-ident-tokens.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/charset-is-not-a-rule.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/decimal-points-in-numbers.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/declarations-trim-whitespace.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/escaped-eof.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/ident-three-code-points.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/inclusive-ranges.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/serialize-consecutive-tokens.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-constructs.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unclosed-url-at-eof.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/unicode-range-selector.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/url-whitespace-consumption.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace-expected.txt
new file mode 100644 (file)
index 0000000..952b46e
--- /dev/null
@@ -0,0 +1,33 @@
+
+PASS U+0009 is CSS whitespace 
+PASS U+000a is CSS whitespace 
+PASS U+000c is CSS whitespace 
+PASS U+000d is CSS whitespace 
+PASS U+0020 is CSS whitespace 
+PASS U+000b is *not* CSS whitespace 
+PASS U+0085 is *not* CSS whitespace 
+PASS U+00a0 is *not* CSS whitespace 
+PASS U+1680 is *not* CSS whitespace 
+PASS U+2000 is *not* CSS whitespace 
+PASS U+2001 is *not* CSS whitespace 
+PASS U+2002 is *not* CSS whitespace 
+PASS U+2003 is *not* CSS whitespace 
+PASS U+2004 is *not* CSS whitespace 
+PASS U+2005 is *not* CSS whitespace 
+PASS U+2006 is *not* CSS whitespace 
+PASS U+2007 is *not* CSS whitespace 
+PASS U+2008 is *not* CSS whitespace 
+PASS U+2009 is *not* CSS whitespace 
+PASS U+200a is *not* CSS whitespace 
+PASS U+2928 is *not* CSS whitespace 
+PASS U+2029 is *not* CSS whitespace 
+PASS U+202f is *not* CSS whitespace 
+PASS U+205f is *not* CSS whitespace 
+PASS U+3000 is *not* CSS whitespace 
+PASS U+180e is *not* CSS whitespace 
+PASS U+200b is *not* CSS whitespace 
+PASS U+200c is *not* CSS whitespace 
+PASS U+200d is *not* CSS whitespace 
+PASS U+2060 is *not* CSS whitespace 
+PASS U+feff is *not* CSS whitespace 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/whitespace.html
new file mode 100644 (file)
index 0000000..bc7aa7e
--- /dev/null
@@ -0,0 +1,62 @@
+<!doctype html>
+<title>CSS Whitespace</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta name="author" title="Tab Atkins-Bittner">
+<link rel=help href="https://drafts.csswg.org/css-syntax/#whitespace">
+
+<div class=a><b></b></div>
+<div id=foo></div>
+
+<!--
+CSS's definition of "whitespace" matches HTML,
+and includes only the five ASCII characters
+U+0009, U+000A, U+000C, U+000D, and U+0020.
+The rest of Unicode's whitespace characters,
+many of which are recognized as whitespace by JS,
+are not valid whitespace in CSS.
+-->
+
+<script>
+
+function isWhitespace(codepoint) {
+    const char = String.fromCodePoint(codepoint);
+    const codepointName = "U+" + codepoint.toString(16).padStart(4, "0");
+    test(()=>{
+        const withSpace = document.querySelector(".a b");
+        const withChar = document.querySelector(`.a${char}b`);
+        assert_equals(withSpace, withChar);
+    }, `${codepointName} is CSS whitespace`);
+}
+function isNotWhitespace(codepoint) {
+    const char = String.fromCodePoint(codepoint);
+    const codepointName = "U+" + codepoint.toString(16).padStart(4, "0");
+    test(()=>{
+        const withSpace = document.querySelector(".a b");
+        document.querySelector("#foo").setAttribute("class", `.a${char}b`);
+        try {
+            var withChar = document.querySelector(`.a${char}b`);
+        } catch(e) {
+            assert_true(true, `${codepointName} isn't valid in a selector at all`);
+            return;
+        }
+        assert_not_equals(withSpace, withChar);
+    }, `${codepointName} is *not* CSS whitespace`);
+}
+
+// CSS Whitespace characters
+var whitespace = [0x9, 0xa, 0xc, 0xd, 0x20];
+
+// Unicode Whitespace characters not recognized by CSS
+// https://en.wikipedia.org/wiki/Whitespace_character#Unicode
+var notWhitespace = [0xb, 0x85, 0xa0, 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x2928, 0x2029, 0x202f, 0x205f, 0x3000, 0x180e, 0x200b, 0x200c, 0x200d, 0x2060, 0xfeff];
+
+for(var codepoint of whitespace) {
+    isWhitespace(codepoint);
+}
+for(var codepoint of notWhitespace) {
+    isNotWhitespace(codepoint);
+}
+
+</script>