Parse calc() in CSS media queries
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 16:07:13 +0000 (16:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 16:07:13 +0000 (16:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181716

LayoutTests/imported/w3c:

Patch by Chris Nardi <csnardi1@gmail.com> on 2018-01-22
Reviewed by Antti Koivisto.

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/css/mediaqueries/OWNERS: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-001.html: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-002.html: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-003.html: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht: Added.
* web-platform-tests/css/mediaqueries/aspect-ratio-004.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht: Added.
* web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html: Added.
* web-platform-tests/css/mediaqueries/min-width-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/min-width-001.xht: Added.
* web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/min-width-tables-001.html: Added.
* web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-calc-001.html: Added.
* web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-calc-002.html: Added.
* web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-calc-003.html: Added.
* web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-calc-004.html: Added.
* web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-calc-005.html: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht: Added.
* web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html: Added.
* web-platform-tests/css/mediaqueries/relative-units-001-expected.xht: Added.
* web-platform-tests/css/mediaqueries/relative-units-001.html: Added.
* web-platform-tests/css/mediaqueries/relative-units-002-expected.xht: Added.
* web-platform-tests/css/mediaqueries/relative-units-002.html: Added.
* web-platform-tests/css/mediaqueries/relative-units-003-expected.xht: Added.
* web-platform-tests/css/mediaqueries/relative-units-003.html: Added.
* web-platform-tests/css/mediaqueries/relative-units-004-expected.xht: Added.
* web-platform-tests/css/mediaqueries/relative-units-004.html: Added.
* web-platform-tests/css/mediaqueries/support/media_queries_iframe.html: Renamed from LayoutTests/fast/media/w3c/resources/media_queries_iframe.html.
* web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html: Added.
* web-platform-tests/css/mediaqueries/support/w3c-import.log: Added.
* web-platform-tests/css/mediaqueries/test_media_queries-expected.txt: Renamed from LayoutTests/fast/media/w3c/test_media_queries-expected.txt.
* web-platform-tests/css/mediaqueries/test_media_queries.html: Renamed from LayoutTests/fast/media/w3c/test_media_queries.html.
* web-platform-tests/css/mediaqueries/w3c-import.log: Added.

Source/WebCore:

calc() was previously unsupported inside of media queries. This change
adds in support for parsing calc inside of media queries.

Patch by Chris Nardi <csnardi1@gmail.com> on 2018-01-22
Reviewed by Antti Koivisto.

Tests: Imported web-platform-tests/css/mediaqueries

* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
(WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
(WebCore::featureWithValidPositiveLength): Ditto.
(WebCore::featureExpectingPositiveInteger): Ditto.
(WebCore::featureWithPositiveInteger): Ditto.
(WebCore::featureWithPositiveNumber): Ditto.
(WebCore::featureWithZeroOrOne): Ditto.
(WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
* css/MediaQueryExpression.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
(WebCore::MediaQueryParser::readMediaNot): Ditto.
(WebCore::MediaQueryParser::readMediaType): Ditto.
(WebCore::MediaQueryParser::readAnd): Ditto.
(WebCore::MediaQueryParser::readFeatureStart): Ditto.
(WebCore::MediaQueryParser::readFeature): Ditto.
(WebCore::MediaQueryParser::readFeatureColon): Ditto.
(WebCore::MediaQueryParser::readFeatureValue): Ditto.
(WebCore::MediaQueryParser::readFeatureEnd): Ditto.
(WebCore::MediaQueryParser::skipUntilComma): Ditto.
(WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
(WebCore::MediaQueryParser::processToken): Ditto.
(WebCore::MediaQueryParser::parseInternal): Ditto.
(WebCore::MediaQueryData::clear): Removed reference to m_valueList
(WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
(WebCore::MediaQueryData::lastExpressionValid): New helper function.
(WebCore::MediaQueryData::removeLastExpression): New helper function.
* css/parser/MediaQueryParser.h:

LayoutTests:

Imported CSS mediaqueries tests from WPT, deleting our (old) copy of one test. Updated
expectations.

Patch by Chris Nardi <csnardi1@gmail.com> on 2018-01-22
Reviewed by Antti Koivisto.

* TestExpectations:
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
* fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:
* fast/media/w3c/README: Removed.
* fast/media/w3c/test_media_queries-expected.txt: Removed.
* platform/ios/TestExpectations:
* platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
* platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
* platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
* platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:

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

80 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt
LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt
LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt
LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt
LayoutTests/fast/media/w3c/README [deleted file]
LayoutTests/fast/media/w3c/test_media_queries-expected.txt [deleted file]
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/mediaqueries/OWNERS [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004-expected.xht [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/media_queries_iframe.html [moved from LayoutTests/fast/media/w3c/resources/media_queries_iframe.html with 75% similarity]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries.html [moved from LayoutTests/fast/media/w3c/test_media_queries.html with 69% similarity]
LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/w3c-import.log [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt
LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt
LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt
LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryExpression.cpp
Source/WebCore/css/MediaQueryExpression.h
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.h
Source/WebCore/css/parser/MediaQueryParser.cpp
Source/WebCore/css/parser/MediaQueryParser.h

index 3fb887a..7e48bc0 100644 (file)
@@ -1,3 +1,26 @@
+2018-01-22  Chris Nardi  <csnardi1@gmail.com>
+
+        Parse calc() in CSS media queries
+        https://bugs.webkit.org/show_bug.cgi?id=181716
+
+        Imported CSS mediaqueries tests from WPT, deleting our (old) copy of one test. Updated
+        expectations.
+
+        Reviewed by Antti Koivisto.
+
+        * TestExpectations:
+        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
+        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
+        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
+        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:
+        * fast/media/w3c/README: Removed.
+        * fast/media/w3c/test_media_queries-expected.txt: Removed.
+        * platform/ios/TestExpectations:
+        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
+        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
+        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
+        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:
+
 2018-01-19  Ryosuke Niwa  <rniwa@webkit.org>
 
         Release assertion in canExecuteScript when executing scripts during page cache restore
index afd2d17..e09f8cc 100644 (file)
@@ -517,6 +517,14 @@ imported/w3c/web-platform-tests/css/selectors4/selector-placeholder-shown-type-c
 imported/w3c/web-platform-tests/css/selectors4/selector-read-write-type-change-002.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/selectors4/selector-required-type-change-002.html [ ImageOnlyFailure ]
 
+# https://github.com/w3c/web-platform-tests/issues/8547
+imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html [ Skip ]
+imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html [ Skip ]
+
+imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht [ ImageOnlyFailure ]
+webkit.org/b/156684 imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html [ ImageOnlyFailure ]
+webkit.org/b/156684 imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html [ ImageOnlyFailure ]
+
 # nth-child tests takes long time and Debug build sometimes timeouts because there are many test cases.
 webkit.org/b/137149 fast/selectors/nth-child-of-basics.html [ Slow ]
 
index efa9d51..5a3f32e 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index efa9d51..5a3f32e 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index 89d304c..cc6bb58 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index efa9d51..5a3f32e 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
diff --git a/LayoutTests/fast/media/w3c/README b/LayoutTests/fast/media/w3c/README
deleted file mode 100644 (file)
index 7315fd5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-Imported CSS3 MediaQuery test suite from:
-http://www.w3.org/Style/CSS/Test/MediaQueries/20120229/
-
-* Media Queries Test Suite
-
-This is a Release Candidate version of the official W3C Media Queries Test Suite. It relies on support for HTML,
-ECMAScript, and the DOM.
-
-This test suite is considered to be complete with no known or suspected bugs at the time of its publication.
-If you find any errors, would like to contribute additional tests, or have other feedback, please post to the
-archived public discussion mailing list for CSS test suites, public-css-testsuite@w3.org.
-
-An implementation report is available. (If you would like to add an implementation to the report,
-please send a patch to public-css-testsuite@w3.org.)
-
-* Test Suite
-
-The test suite is a single self-contained file that thoroughly tests Media Queries via a script: Media Queries Self-Contained Test Suite.
-
-* License
-
-This test suite is licensed under both the W3C Test Suite License and the W3C 3-clause BSD License. See W3C Legal's explanation of the licenses.
-
-* Acknowledgements
-
-Many thanks to the following for their contributions:
-
- Anne van Kesteren
- Ian Hickson
- L. David Baron
- Arron Eicholz
\ No newline at end of file
diff --git a/LayoutTests/fast/media/w3c/test_media_queries-expected.txt b/LayoutTests/fast/media/w3c/test_media_queries-expected.txt
deleted file mode 100644 (file)
index 3ce940a..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-
-PASS query (orientation) should be parseable 
-PASS query not (orientation) should not be parseable 
-PASS query only (orientation) should not be parseable 
-PASS query all and (orientation) should be parseable 
-PASS query not all and (orientation) should be parseable 
-PASS query only all and (orientation) should be parseable 
-PASS query (orientation: 'landscape') should not be parseable 
-PASS expression width should be parseable 
-PASS expression width: 0 should be parseable 
-PASS expression width: 0px should be parseable 
-PASS expression width: 0em should be parseable 
-PASS expression width: -0 should be parseable 
-PASS expression min-width: -0 should be parseable 
-PASS expression max-width: -0 should be parseable 
-PASS expression width: -0cm should be parseable 
-PASS expression width: 1px should be parseable 
-PASS expression width: 0.001mm should be parseable 
-PASS expression width: 100000px should be parseable 
-PASS expression width: -1px should not be parseable 
-PASS expression width: '20px' should not be parseable 
-PASS expression min-width: -1px should not be parseable 
-PASS expression max-width: -1px should not be parseable 
-PASS expression min-width: '10px' should not be parseable 
-PASS expression max-width: '10px' should not be parseable 
-PASS expression width: -0.00001mm should not be parseable 
-PASS expression width: -100000em should not be parseable 
-PASS expression min-width should not be parseable 
-PASS expression max-width should not be parseable 
-PASS expression height should be parseable 
-PASS expression height: 0 should be parseable 
-PASS expression height: 0px should be parseable 
-PASS expression height: 0em should be parseable 
-PASS expression height: -0 should be parseable 
-PASS expression min-height: -0 should be parseable 
-PASS expression max-height: -0 should be parseable 
-PASS expression height: -0cm should be parseable 
-PASS expression height: 1px should be parseable 
-PASS expression height: 0.001mm should be parseable 
-PASS expression height: 100000px should be parseable 
-PASS expression height: -1px should not be parseable 
-PASS expression height: '20px' should not be parseable 
-PASS expression min-height: -1px should not be parseable 
-PASS expression max-height: -1px should not be parseable 
-PASS expression min-height: '10px' should not be parseable 
-PASS expression max-height: '10px' should not be parseable 
-PASS expression height: -0.00001mm should not be parseable 
-PASS expression height: -100000em should not be parseable 
-PASS expression min-height should not be parseable 
-PASS expression max-height should not be parseable 
-PASS expression device-width should be parseable 
-PASS expression device-width: 0 should be parseable 
-PASS expression device-width: 0px should be parseable 
-PASS expression device-width: 0em should be parseable 
-PASS expression device-width: -0 should be parseable 
-PASS expression min-device-width: -0 should be parseable 
-PASS expression max-device-width: -0 should be parseable 
-PASS expression device-width: -0cm should be parseable 
-PASS expression device-width: 1px should be parseable 
-PASS expression device-width: 0.001mm should be parseable 
-PASS expression device-width: 100000px should be parseable 
-PASS expression device-width: -1px should not be parseable 
-PASS expression device-width: '20px' should not be parseable 
-PASS expression min-device-width: -1px should not be parseable 
-PASS expression max-device-width: -1px should not be parseable 
-PASS expression min-device-width: '10px' should not be parseable 
-PASS expression max-device-width: '10px' should not be parseable 
-PASS expression device-width: -0.00001mm should not be parseable 
-PASS expression device-width: -100000em should not be parseable 
-PASS expression min-device-width should not be parseable 
-PASS expression max-device-width should not be parseable 
-PASS expression device-height should be parseable 
-PASS expression device-height: 0 should be parseable 
-PASS expression device-height: 0px should be parseable 
-PASS expression device-height: 0em should be parseable 
-PASS expression device-height: -0 should be parseable 
-PASS expression min-device-height: -0 should be parseable 
-PASS expression max-device-height: -0 should be parseable 
-PASS expression device-height: -0cm should be parseable 
-PASS expression device-height: 1px should be parseable 
-PASS expression device-height: 0.001mm should be parseable 
-PASS expression device-height: 100000px should be parseable 
-PASS expression device-height: -1px should not be parseable 
-PASS expression device-height: '20px' should not be parseable 
-PASS expression min-device-height: -1px should not be parseable 
-PASS expression max-device-height: -1px should not be parseable 
-PASS expression min-device-height: '10px' should not be parseable 
-PASS expression max-device-height: '10px' should not be parseable 
-PASS expression device-height: -0.00001mm should not be parseable 
-PASS expression device-height: -100000em should not be parseable 
-PASS expression min-device-height should not be parseable 
-PASS expression max-device-height should not be parseable 
-PASS all and (width: width px) should apply 
-PASS all and (width: width +1 px) should not apply 
-PASS all and (width: width -1 px) should not apply 
-PASS all and (min-width: width px) should apply 
-PASS all and (min-width: width +1 px) should not apply 
-PASS all and (min-width: width -1 px) should apply 
-PASS all and (max-width: width px) should apply 
-PASS all and (max-width: width +1 px) should apply 
-PASS all and (max-width: width +1 px) should not apply 
-PASS all and (min-width: width +1 em) should not apply 
-PASS all and (min-width: width -1 em) should apply 
-PASS all and (max-width: width +1 em) should apply 
-PASS all and (max-width: width -1 em) should not apply 
-PASS all and (height: height px) should apply 
-PASS all and (height: height +1 px) should not apply 
-PASS all and (height: height -1 px) should not apply 
-PASS all and (min-height: height px) should apply 
-PASS all and (min-height: height +1 px) should not apply 
-PASS all and (min-height: height -1 px) should apply 
-PASS all and (max-height: height px) should apply 
-PASS all and (max-height: height +1 px) should apply 
-PASS all and (max-height: height +1 px) should not apply 
-PASS all and (min-height: height +1 em) should not apply 
-PASS all and (min-height: height -1 em) should apply 
-PASS all and (max-height: height +1 em) should apply 
-PASS all and (max-height: height -1 em) should not apply 
-PASS all and (device-width: device-width px) should apply 
-PASS all and (device-width: device-width +1 px) should not apply 
-PASS all and (device-width: device-width -1 px) should not apply 
-PASS all and (min-device-width: device-width px) should apply 
-PASS all and (min-device-width: device-width +1 px) should not apply 
-PASS all and (min-device-width: device-width -1 px) should apply 
-PASS all and (max-device-width: device-width px) should apply 
-PASS all and (max-device-width: device-width +1 px) should apply 
-PASS all and (max-device-width: device-width +1 px) should not apply 
-PASS all and (min-device-width: device-width +1 em) should not apply 
-PASS all and (min-device-width: device-width -1 em) should apply 
-PASS all and (max-device-width: device-width +1 em) should apply 
-PASS all and (max-device-width: device-width -1 em) should not apply 
-PASS all and (device-height: device-height px) should apply 
-PASS all and (device-height: device-height +1 px) should not apply 
-PASS all and (device-height: device-height -1 px) should not apply 
-PASS all and (min-device-height: device-height px) should apply 
-PASS all and (min-device-height: device-height +1 px) should not apply 
-PASS all and (min-device-height: device-height -1 px) should apply 
-PASS all and (max-device-height: device-height px) should apply 
-PASS all and (max-device-height: device-height +1 px) should apply 
-PASS all and (max-device-height: device-height +1 px) should not apply 
-PASS all and (min-device-height: device-height +1 em) should not apply 
-PASS all and (min-device-height: device-height -1 em) should apply 
-PASS all and (max-device-height: device-height +1 em) should apply 
-PASS all and (max-device-height: device-height -1 em) should not apply 
-PASS all and (height) should apply 
-PASS all and (width) should not apply 
-PASS all and (height) should not apply 
-PASS all and (width) should not apply 
-PASS all and (device-height) should apply 
-PASS all and (device-width) should apply 
-PASS all and (height) should not apply 
-PASS all and (width) should apply 
-PASS all and (height) should apply 
-PASS all and (width) should apply 
-PASS expression orientation should be parseable 
-PASS expression orientation: portrait should be parseable 
-PASS expression orientation: landscape should be parseable 
-PASS expression min-orientation should not be parseable 
-PASS expression min-orientation: portrait should not be parseable 
-PASS expression min-orientation: landscape should not be parseable 
-PASS expression max-orientation should not be parseable 
-PASS expression max-orientation: portrait should not be parseable 
-PASS expression max-orientation: landscape should not be parseable 
-PASS (orientation) should apply 
-PASS (orientation: landscape) should apply 
-PASS (orientation: portrait) should not apply 
-PASS not all and (orientation: portrait) should apply 
-PASS (orientation) should apply 
-PASS (orientation: landscape) should not apply 
-PASS not all and (orientation: landscape) should apply 
-PASS (orientation: portrait) should apply 
-PASS (aspect-ratio: 59/80) should apply 
-PASS (aspect-ratio: 58/80) should not apply 
-PASS (aspect-ratio: 59/81) should not apply 
-PASS (aspect-ratio: 60/80) should not apply 
-PASS (aspect-ratio: 59/79) should not apply 
-PASS (aspect-ratio: 177/240) should apply 
-PASS (aspect-ratio: 413/560) should apply 
-PASS (aspect-ratio: 5900/8000) should apply 
-PASS (aspect-ratio: 5901/8000) should not apply 
-PASS (aspect-ratio: 5899/8000) should not apply 
-PASS (aspect-ratio: 5900/8001) should not apply 
-PASS (aspect-ratio: 5900/7999) should not apply 
-PASS (aspect-ratio) should apply 
-PASS (min-aspect-ratio: 59/80) should apply 
-PASS (min-aspect-ratio: 58/80) should apply 
-PASS (min-aspect-ratio: 59/81) should apply 
-PASS (min-aspect-ratio: 60/80) should not apply 
-PASS (min-aspect-ratio: 59/79) should not apply 
-PASS expression min-aspect-ratio should not be parseable 
-PASS (max-aspect-ratio: 59/80) should apply 
-PASS (max-aspect-ratio: 58/80) should not apply 
-PASS (max-aspect-ratio: 59/81) should not apply 
-PASS (max-aspect-ratio: 60/80) should apply 
-PASS (max-aspect-ratio: 59/79) should apply 
-PASS expression max-aspect-ratio should not be parseable 
-PASS (device-aspect-ratio: device-width / device-height) should apply 
-PASS not all and (device-aspect-ratio: device-width + 1 / device-height) should apply 
-PASS all and (device-aspect-ratio: device-width / device-height - 1) should not apply 
-PASS all and (device-aspect-ratio: device-width - 1 / device-height) should not apply 
-PASS not all and (device-aspect-ratio: device-width / device-height + 1) should apply 
-PASS (device-aspect-ratio) should apply 
-PASS (min-device-aspect-ratio: device-width / device-height) should apply 
-PASS not all and (device-aspect-ratio: device-width + 1 / device-height) should not apply 
-PASS not all and (min-device-aspect-ratio: device-width / device-height - 1) should apply 
-PASS not all and (min-device-aspect-ratio: device-width - 1 / device-height) should not apply 
-PASS all and (min-device-aspect-ratio: device-width / device-height + 1) should apply 
-PASS expression min-device-aspect-ratio should not be parseable 
-PASS all and (max-device-aspect-ratio: device-width / device-height) should apply 
-PASS (max-device-aspect-ratio: device-width + 1 / device-height) should apply 
-PASS (max-device-aspect-ratio: device-width / device-height - 1 should apply 
-PASS all and (max-device-aspect-ratio: device-width - 1 / device-height) should not apply 
-PASS not all and (max-device-aspect-ratio: device-width / device-height + 1) should apply 
-PASS expression max-device-aspect-ratio should not be parseable 
-PASS expression max-aspect-ratio: 1/1 should be parseable 
-PASS expression max-aspect-ratio: 1  /1 should be parseable 
-PASS expression max-aspect-ratio: 1  /         
-1 should be parseable 
-PASS expression max-aspect-ratio: 1/\r1 should be parseable 
-PASS expression max-aspect-ratio: 1 should not be parseable 
-PASS expression max-aspect-ratio: 0.5 should not be parseable 
-PASS expression max-aspect-ratio: 1.0/1 should not be parseable 
-PASS expression max-aspect-ratio: 1/1.0 should not be parseable 
-PASS expression max-aspect-ratio: 1.0/1.0 should not be parseable 
-PASS expression max-aspect-ratio: 0/1 should not be parseable 
-PASS expression max-aspect-ratio: 1/0 should not be parseable 
-PASS expression max-aspect-ratio: 0/0 should not be parseable 
-PASS expression max-aspect-ratio: -1/1 should not be parseable 
-PASS expression max-aspect-ratio: 1/-1 should not be parseable 
-PASS expression max-aspect-ratio: -1/-1 should not be parseable 
-PASS expression device-aspect-ratio: 1/1 should be parseable 
-PASS expression device-aspect-ratio: 1  /1 should be parseable 
-PASS expression device-aspect-ratio: 1  /      
-1 should be parseable 
-PASS expression device-aspect-ratio: 1/\r1 should be parseable 
-PASS expression device-aspect-ratio: 1 should not be parseable 
-PASS expression device-aspect-ratio: 0.5 should not be parseable 
-PASS expression device-aspect-ratio: 1.0/1 should not be parseable 
-PASS expression device-aspect-ratio: 1/1.0 should not be parseable 
-PASS expression device-aspect-ratio: 1.0/1.0 should not be parseable 
-PASS expression device-aspect-ratio: 0/1 should not be parseable 
-PASS expression device-aspect-ratio: 1/0 should not be parseable 
-PASS expression device-aspect-ratio: 0/0 should not be parseable 
-PASS expression device-aspect-ratio: -1/1 should not be parseable 
-PASS expression device-aspect-ratio: 1/-1 should not be parseable 
-PASS expression device-aspect-ratio: -1/-1 should not be parseable 
-PASS monochrome_and_color 
-PASS find_depth 
-PASS all and (color: depth) should apply 
-PASS all and (color: depth - 1) should not apply 
-PASS all and (color: depth + 1) should not apply 
-PASS all and (max-color: depth) should apply 
-PASS all and (max-color: depth - 1) should not apply 
-PASS all and (max-color: depth + 1) should apply 
-PASS all and (color) should apply 
-PASS expression max-color should not be parseable 
-PASS expression min-color should not be parseable 
-PASS all and (monochrome) should not apply 
-PASS expression max-monochrome should not be parseable 
-PASS expression min-monochrome should not be parseable 
-PASS not all and (monochrome) should apply 
-PASS not all and (color) should not apply 
-PASS only all and (color) should apply 
-PASS only all and (monochrome) should not apply 
-PASS expression color: 1 should be parseable 
-PASS expression color: 327 should be parseable 
-PASS expression color: 0 should be parseable 
-PASS expression color: 1.0 should not be parseable 
-PASS expression color: -1 should not be parseable 
-PASS expression color: 1/1 should not be parseable 
-PASS expression min-monochrome: 1 should be parseable 
-PASS expression min-monochrome: 327 should be parseable 
-PASS expression min-monochrome: 0 should be parseable 
-PASS expression min-monochrome: 1.0 should not be parseable 
-PASS expression min-monochrome: -1 should not be parseable 
-PASS expression min-monochrome: 1/1 should not be parseable 
-FAIL find_resolution assert_false: expected false got true
-PASS (resolution: dpi) should not apply 
-PASS (resolution: dpi + 1) should not apply 
-FAIL (min-resolution: dpi - 1 ) should apply assert_true: expected true got false
-FAIL not all and (min-resolution: dpi - 1 ) should not apply assert_false: expected false got true
-PASS not all and (min-resolution: dpi + 1 ) should apply 
-PASS all and (min-resolution: dpi + 1 ) should not apply 
-FAIL (min-resolution: dpcm (dpi - 1) ) should apply assert_true: expected true got false
-FAIL (max-resolution: dpcm  (dpi + 1) ) should apply assert_true: expected true got false
-PASS (max-resolution: dpcm  (dpi - 1) ) should not apply 
-PASS not all and (min-resolution: dpcm  (dpi + 1) ) should apply 
-PASS expression grid should be parseable 
-PASS expression grid: 0 should be parseable 
-PASS expression grid: 1 should be parseable 
-PASS expression grid: 1 should be parseable 
-PASS expression min-grid should not be parseable 
-PASS expression min-grid:0 should not be parseable 
-PASS expression max-grid: 1 should not be parseable 
-PASS expression grid: 2 should not be parseable 
-PASS expression grid: -1 should not be parseable 
-PASS (grid) should not apply 
-PASS (grid: 0) should apply 
-PASS (grid: 1) should not apply 
-PASS (grid: 2) should not apply 
-PASS (grid: -1) should not apply 
-
index 8ce2898..8e97a94 100644 (file)
@@ -1,3 +1,70 @@
+2018-01-22  Chris Nardi  <csnardi1@gmail.com>
+
+        Parse calc() in CSS media queries
+        https://bugs.webkit.org/show_bug.cgi?id=181716
+
+        Reviewed by Antti Koivisto.
+
+        * resources/import-expectations.json:
+        * resources/resource-files.json:
+        * web-platform-tests/css/mediaqueries/OWNERS: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-001.html: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-002.html: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-003.html: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/aspect-ratio-004.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html: Added.
+        * web-platform-tests/css/mediaqueries/min-width-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/min-width-001.xht: Added.
+        * web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/min-width-tables-001.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-001.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-002.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-003.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-004.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-calc-005.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-001-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-001.html: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-002-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-002.html: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-003-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-003.html: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-004-expected.xht: Added.
+        * web-platform-tests/css/mediaqueries/relative-units-004.html: Added.
+        * web-platform-tests/css/mediaqueries/support/media_queries_iframe.html: Renamed from LayoutTests/fast/media/w3c/resources/media_queries_iframe.html.
+        * web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html: Added.
+        * web-platform-tests/css/mediaqueries/support/w3c-import.log: Added.
+        * web-platform-tests/css/mediaqueries/test_media_queries-expected.txt: Renamed from LayoutTests/fast/media/w3c/test_media_queries-expected.txt.
+        * web-platform-tests/css/mediaqueries/test_media_queries.html: Renamed from LayoutTests/fast/media/w3c/test_media_queries.html.
+        * web-platform-tests/css/mediaqueries/w3c-import.log: Added.
+
 2018-01-22  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [css-grid] Spanning Grid item has too much space at the bottom / is too high
index 75c5248..1dd72a2 100644 (file)
@@ -67,6 +67,7 @@
     "web-platform-tests/css/css-shapes-1/test-plan/index.html": "skip", 
     "web-platform-tests/css/css-ui-3": "import", 
     "web-platform-tests/css/geometry-1/": "import", 
+    "web-platform-tests/css/mediaqueries": "import", 
     "web-platform-tests/css/reference": "import", 
     "web-platform-tests/css/resources": "import", 
     "web-platform-tests/css/selectors4": "import", 
index 2e2d492..897862c 100644 (file)
         "web-platform-tests/css/css-ui-3/support/nav-up-013-frame.html",
         "web-platform-tests/css/css-ui-3/text-overflow-018.html",
         "web-platform-tests/css/css-ui-3/text-overflow-019.html",
+        "web-platform-tests/css/mediaqueries/support/media_queries_iframe.html",
+        "web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html",
         "web-platform-tests/cssom-view/iframe.html",
         "web-platform-tests/cssom/support/xmlss-pi.xhtml",
         "web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html",
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/OWNERS
new file mode 100644 (file)
index 0000000..597e900
--- /dev/null
@@ -0,0 +1,3 @@
+@dbaron
+@plinss
+@frivoal
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001.html
new file mode 100644 (file)
index 0000000..0dad9ea
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: min-aspect-ratio - 59/79 ('aspect-ratio' property with prefix 'min')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link name="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.6. aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'aspect-ratio' property with prefix 'min' set '59/79' means that the minimum of ratio is '59/79',
+only and only if the value of the 'width' to the value of the 'height' is greater than value of 'min-aspect-ratio', the style sheet will be applied.">
+<style>
+  div {
+    background-color: red;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (min-aspect-ratio: 59/79) {
+    div {
+      background-color: green;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002.html
new file mode 100644 (file)
index 0000000..b4a25ee
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: min-aspect-ratio - 0/0 ('aspect-ratio' property with prefix 'min')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link name="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.6. aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'aspect-ratio' property with prefix 'min' set '0/0' is invalid that means the style sheet specified by 'min-aspect-ratio' will not be applied.">
+<style>
+  div {
+    background-color: green;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (min-aspect-ratio: 0/0) {
+    div {
+      background-color: red;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003.html
new file mode 100644 (file)
index 0000000..76bebd7
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: max-aspect-ratio - 1280/720 ('aspect-ratio' property with prefix 'max')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link name="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.6. aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'aspect-ratio' property with prefix 'max' set '1280/720' means that the maximum of ratio is '1280/720', only and only if the value of the 'width' to the value of the 'height' is lower than value of 'max-aspect-ratio', the style sheet will be applied.">
+<style>
+  div {
+    background-color: red;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (max-aspect-ratio: 1280/720) {
+    div {
+      background-color: green;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004.html
new file mode 100644 (file)
index 0000000..b4b2e86
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: max-aspect-ratio - 0/0 ('aspect-ratio' property with prefix 'max')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link name="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.6. aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'aspect-ratio' property with prefix 'max' set '0/0' is invalid that means the style sheet specified by 'max-aspect-ratio' will not be applied.">
+<style>
+  div {
+    background-color: green;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (max-aspect-ratio: 0/0) {
+    div {
+      background-color: red;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html
new file mode 100644 (file)
index 0000000..60f49b9
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: max-device-aspect-ratio - 1281/1024 ('device-aspect-ratio' property with prefix 'max')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property with prefix 'max' set '1281/1024' means that the maximum of ratio is '1281/1024', only and only if the device value of 'width' to value of 'height' is lower than value of 'max-device-aspect-ratio', the style sheet will be applied.">
+<style>
+  div {
+    background-color: red;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (max-device-aspect-ratio: 1281/1024) {
+    div {
+      background-color: green;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html
new file mode 100644 (file)
index 0000000..52c985a
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: max-device-aspect-ratio - 0/0 ('device-aspect-ratio' property with prefix 'max')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property with prefix 'max' set '0/0' is invalid that means the style sheet specified by 'max-device-aspect-ratio' will not be applied.">
+<style>
+  div {
+    background-color: green;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (max-device-aspect-ratio: 0/0) {
+    div {
+      background-color: red;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html
new file mode 100644 (file)
index 0000000..5d979ba
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: min-device-aspect-ratio - 1279/1024 ('device-aspect-ratio' property with prefix 'min')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property with prefix 'min' set '1279/1024' means that the minimum of ratio is '1279/1024', only and only if the device value of 'width' to value of 'height' is greater than value of 'min-device-aspect-ratio', the style sheet will be applied.">
+<style>
+  div {
+    background-color: red;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (min-device-aspect-ratio: 1279/1024) {
+    div {
+      background-color: green;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html
new file mode 100644 (file)
index 0000000..cd94914
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: min-device-aspect-ratio - 0/0 ('device-aspect-ratio' property with prefix 'min')</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property with prefix 'min' set '0/0' is invalid that means the style sheet specified by 'min-device-aspect-ratio' will not be applied.">
+<style>
+  div {
+    background-color: green;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (min-device-aspect-ratio: 0/0) {
+    div {
+      background-color: red;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html
new file mode 100644 (file)
index 0000000..9190fc4
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: device-aspect-ratio - 1280/1024 (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property set '1280/1024' means that the ratio is '1280/1024', only and only if the device value of 'width' to value of 'height' is equals with value of 'device-aspect-ratio', the style sheet will be applied.">
+<style>
+  div {
+    background-color: red;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (device-aspect-ratio: 1280/1024) {
+    div {
+      background-color: green;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html
new file mode 100644 (file)
index 0000000..403829d
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Media Queries Test: device-aspect-ratio - 0/0 (invalid)</title>
+<link rel="author" title="Intel" href="http://www.intel.com/">
+<link rel="author" title="Xin Liu" href="mailto:xinx.liu@intel.com">
+<link rel="help" title="4.7. device-aspect-ratio" href="http://www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name="flags" content="">
+<meta name="assert" content="The 'device-aspect-ratio' property set '0/0' is invalid that means the style sheet specified by 'device-aspect-ratio' will not be applied.">
+<style>
+  div {
+    background-color: green;
+    height: 100px;
+    width: 100px;
+  }
+  @media screen and (device-aspect-ratio: 0/0) {
+    div {
+      background-color: red;
+    }
+  }
+</style>
+<body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht
new file mode 100644 (file)
index 0000000..649273c
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html SYSTEM "about:legacy-compat">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="utf-8" />
+    <title>CSS Media Queries Test: min-width length value approximation</title>
+    <link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+    <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#width" />
+    <link rel="help" href="http://www.w3.org/TR/mediaqueries-4/#width" />
+    <link rel="help" href="http://www.w3.org/TR/css3-values/#length-value" />
+    <link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="min-width length values that are too large to be supported must be clamped, rounded to infinity, or approximated, but not overflowed to a small or negative value." />
+    <style>
+div {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+@media (min-width: 9999999999px) {
+    div {
+        background-color: red;
+    }
+}
+    </style>
+</head>
+<body>
+    <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+    <div></div>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001.html
new file mode 100644 (file)
index 0000000..dc430cc
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+    <meta charset="utf-8">
+    <title>CSS Test: Table Layout and Viewport Resizing</title>
+    <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+    <link rel="help" href="https://drafts.csswg.org/css2/tables.html#auto-table-layout">
+    <link rel="help" href="https://drafts.csswg.org/mediaqueries-3/#width">
+    <link rel="help" href="https://drafts.csswg.org/mediaqueries-4/#width">
+    <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+    <meta name="flags" content="dom">
+    <meta name="assert" content="Resizing a page which toggles the `display` of elements between `block` and `table-cell` based on the viewport width should not cause unnecessary wrapping of the table.">
+    <style>
+iframe {
+    border: 0;
+}
+    </style>
+</head>
+<body>
+    <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+    <iframe id="toy" width="100" height="300" src="support/min-width-tables-001-iframe.html"></iframe>
+    <!-- See min-width-tables-001-iframe.html for the derivation of the 100px value -->
+    <!-- We use 300px height so the incorrect stacking is visible in failure cases -->
+    <!-- This test is not about iframes specifically. It's just that resizing an iframe is more reliable than resizing the window, given browser security restrictions. -->
+    <script>
+    window.addEventListener('load', function () {
+        var PAINT_MS = 250;/* Assume the browser takes about this long to layout/paint this whole page */
+        var iframe = document.getElementById('toy');
+        window.setTimeout(function () {
+            iframe.width = 64;/* <100px ; toggle media query off */
+            window.setTimeout(function () {
+                iframe.width = 100;/* >=100px ; toggle media query on; back to initial width */
+                // Take the reftest screenshot after the last relayout/repaint finishes
+                window.setTimeout(function () {
+                    document.documentElement.className = '';
+                }, PAINT_MS);
+            }, PAINT_MS);
+        }, PAINT_MS);
+    }, false);
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001.html
new file mode 100644 (file)
index 0000000..9a39663
--- /dev/null
@@ -0,0 +1,26 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: support for calc in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="calc can be used in Media Queries">
+               <meta name="flags" content="">
+               <style>
+                       div {
+                               width: 100px;
+                               height: 100px;
+                               background-color: red;
+                       }
+                       @media (min-width: calc(1px - 1px)){
+                               div { background-color: green; }
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002.html
new file mode 100644 (file)
index 0000000..f6f2fc1
--- /dev/null
@@ -0,0 +1,37 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: evaluation of em in calc in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+               <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="The size in pixels of the 'em' unit used in calc inside a media query does not depend on declarations and use the initial value.">
+               <meta name="flags" content="">
+               <style>
+                       :root { font-size: 30000px; }
+                       p { font-size: 16px; }
+                       div {
+                               width: 100px;
+                               height: 100px;
+                               background-color: red;
+                       }
+                       @media (min-width: calc(1em)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+               <script>
+                 document.body.offsetTop;
+               </script>
+               <style>
+                       @media (min-width: calc(1em)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003.html
new file mode 100644 (file)
index 0000000..cadc448
--- /dev/null
@@ -0,0 +1,37 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: evaluation of ex in calc in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+               <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="The size in pixels of the 'ex' unit used in calc inside a media query does not depend on declarations and use the initial value.">
+               <meta name="flags" content="">
+               <style>
+                       :root { font-size: 30000px; }
+                       p { font-size: 16px; }
+                       div {
+                               width: 100px;
+                               height: 100px;
+                               background-color: red;
+                       }
+                       @media (min-width: calc(1ex)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+               <script>
+                 document.body.offsetTop;
+               </script>
+               <style>
+                       @media (min-width: calc(1ex)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004.html
new file mode 100644 (file)
index 0000000..6319034
--- /dev/null
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: evaluation of ch in calc in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+               <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="The size in pixels of the 'ch' unit used in calc inside a media query does not depend on declarations and use the initial value.">
+               <meta name="flags" content="">
+               <style>
+                       :root { font-size: 30000px; }
+                       p { font-size: 16px; }
+                       div {
+                               width: 100px;
+                               height: 100px;
+                               background-color: red;
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+               <script>
+                 document.body.offsetTop;
+               </script>
+               <style>
+                       @media (min-width: calc(1ch)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html
new file mode 100644 (file)
index 0000000..df7409b
--- /dev/null
@@ -0,0 +1,34 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: evaluation of rem in calc in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+               <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="The size in pixels of the 'rem' unit used in calc inside a media query does not depend on declarations and use the initial value.">
+               <meta name="flags" content="">
+               <style>
+                       :root { font-size: 30000px; }
+                       p { font-size: 16px; }
+                       div {
+                               width: 100px;
+                               height: 100px;
+                               background-color: red;
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+               <script>
+                 document.body.offsetTop;
+               </script>
+               <style>
+                       @media (min-width: calc(1rem)){
+                               div { background-color: green; }
+                       }
+               </style>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html
new file mode 100644 (file)
index 0000000..24ebd9f
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: syntax error handling in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="https://drafts.csswg.org/mediaqueries4/#error-handling">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="'and' is an invalid media type">
+               <meta name="flags" content="invalid">
+               <style>
+                       div {
+                               width: 100px;
+                               height: 100px;
+                       }
+                       @media all {
+                               div { background-color: green; }
+                       }
+                       @media not and {
+                               div { background-color: red; }
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html
new file mode 100644 (file)
index 0000000..71f597e
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: syntax error handling in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="https://drafts.csswg.org/mediaqueries4/#error-handling">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="'or' is an invalid media type">
+               <meta name="flags" content="invalid">
+               <style>
+                       div {
+                               width: 100px;
+                               height: 100px;
+                       }
+                       @media all {
+                               div { background-color: green; }
+                       }
+                       @media not or {
+                               div { background-color: red; }
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html
new file mode 100644 (file)
index 0000000..b12bd75
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: syntax error handling in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="https://drafts.csswg.org/mediaqueries4/#error-handling">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="'not' is an invalid media type">
+               <meta name="flags" content="invalid">
+               <style>
+                       div {
+                               width: 100px;
+                               height: 100px;
+                       }
+                       @media all {
+                               div { background-color: green; }
+                       }
+                       @media not not {
+                               div { background-color: red; }
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht
new file mode 100644 (file)
index 0000000..05a1379
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html
new file mode 100644 (file)
index 0000000..d039281
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Test: syntax error handling in Media Queries</title>
+               <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+               <link rel="help" href="https://drafts.csswg.org/mediaqueries4/#error-handling">
+               <link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+               <meta name="assert" content="'only' is an invalid media type">
+               <meta name="flags" content="invalid">
+               <style>
+                       div {
+                               width: 100px;
+                               height: 100px;
+                       }
+                       @media all {
+                               div { background-color: green; }
+                       }
+                       @media not only {
+                               div { background-color: red; }
+                       }
+       </style>
+       </head>
+       <body>
+               <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+               <div></div>
+       </body>
+</html>
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001-expected.xht
new file mode 100644 (file)
index 0000000..f79255d
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Reftest Reference</title>
+<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+<style type="text/css">
+body {
+  background: green;
+}
+p {
+  font-size: 24px;
+}
+</style>
+</head>
+<body>
+<p>This should have a green background.</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html
new file mode 100644 (file)
index 0000000..fac94d7
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>CSS Test: Font-relative length units (rem) in width media queries</title>
+  <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+  <link rel="help" href="https://www.w3.org/TR/css3-mediaqueries/#units">
+  <link rel="help" href="https://www.w3.org/TR/mediaqueries-4/#units">
+  <link rel="match" href="reference/ref-green-body.xht">
+  <meta name="flags" content="">
+  <meta name="assert" content="Font-relative length units (such as 'rem') in media queries should be calculated based on the initial value of 'font-size', not based on author style declarations, such as: html { font-size: 200%; }">
+  <style>
+:root {
+  font-size: 100000px;/* ~87ft */
+}
+body {
+  background: red;
+}
+p {
+  font-size: 24px;
+}
+  </style>
+</head>
+<body>
+  <p>This should have a green background.</p>
+  <script>
+    document.body.offsetTop;
+  </script>
+  <style>
+    @media (min-width: 1rem) {
+      body {
+        background: green;
+      }
+    }
+  </style>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002-expected.xht
new file mode 100644 (file)
index 0000000..f79255d
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Reftest Reference</title>
+<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+<style type="text/css">
+body {
+  background: green;
+}
+p {
+  font-size: 24px;
+}
+</style>
+</head>
+<body>
+<p>This should have a green background.</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002.html
new file mode 100644 (file)
index 0000000..310e18f
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>CSS Test: Font-relative length units (em) in width media queries</title>
+  <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+  <link rel="help" href="https://www.w3.org/TR/css3-mediaqueries/#units">
+  <link rel="help" href="https://www.w3.org/TR/mediaqueries-4/#units">
+  <link rel="match" href="reference/ref-green-body.xht">
+  <meta name="flags" content="">
+  <meta name="assert" content="Font-relative length units (such as 'em') in media queries should be calculated based on the initial value of 'font-size', not based on author style declarations, such as: html { font-size: 200%; }">
+  <style>
+:root {
+  font-size: 100000px;/* ~87ft */
+}
+body {
+  background: red;
+}
+p {
+  font-size: 24px;
+}
+  </style>
+</head>
+<body>
+  <p>This should have a green background.</p>
+  <script>
+    document.body.offsetTop;
+  </script>
+  <style>
+    @media (min-width: 1em) {
+      body {
+        background: green;
+      }
+    }
+  </style>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003-expected.xht
new file mode 100644 (file)
index 0000000..f79255d
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Reftest Reference</title>
+<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+<style type="text/css">
+body {
+  background: green;
+}
+p {
+  font-size: 24px;
+}
+</style>
+</head>
+<body>
+<p>This should have a green background.</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003.html
new file mode 100644 (file)
index 0000000..461db32
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>CSS Test: Font-relative length units (ex) in width media queries</title>
+  <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+  <link rel="help" href="https://www.w3.org/TR/css3-mediaqueries/#units">
+  <link rel="help" href="https://www.w3.org/TR/mediaqueries-4/#units">
+  <link rel="match" href="reference/ref-green-body.xht">
+  <meta name="flags" content="">
+  <meta name="assert" content="Font-relative length units (such as 'ex') in media queries should be calculated based on the initial value of 'font-size', not based on author style declarations, such as: html { font-size: 200%; }">
+  <style>
+:root {
+  font-size: 100000px;/* ~87ft */
+}
+body {
+  background: red;
+}
+p {
+  font-size: 24px;
+}
+  </style>
+</head>
+<body>
+  <p>This should have a green background.</p>
+  <script>
+    document.body.offsetTop;
+  </script>
+  <style>
+    @media (min-width: 1ex) {
+      body {
+        background: green;
+      }
+    }
+  </style>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004-expected.xht
new file mode 100644 (file)
index 0000000..f79255d
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>CSS Reftest Reference</title>
+<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" />
+<style type="text/css">
+body {
+  background: green;
+}
+p {
+  font-size: 24px;
+}
+</style>
+</head>
+<body>
+<p>This should have a green background.</p>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004.html
new file mode 100644 (file)
index 0000000..b0f3765
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>CSS Test: Font-relative length units (ch) in width media queries</title>
+  <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
+  <link rel="help" href="https://www.w3.org/TR/css3-mediaqueries/#units">
+  <link rel="help" href="https://www.w3.org/TR/mediaqueries-4/#units">
+  <link rel="match" href="reference/ref-green-body.xht">
+  <meta name="flags" content="">
+  <meta name="assert" content="Font-relative length units (such as 'ch') in media queries should be calculated based on the initial value of 'font-size', not based on author style declarations, such as: html { font-size: 200%; }">
+  <style>
+:root {
+  font-size: 100000px;/* ~87ft */
+}
+body {
+  background: red;
+}
+p {
+  font-size: 24px;
+}
+  </style>
+</head>
+<body>
+  <p>This should have a green background.</p>
+  <script>
+    document.body.offsetTop;
+  </script>
+  <style>
+    @media (min-width: 1ch) {
+      body {
+        background: green;
+      }
+    }
+  </style>
+</body>
+</html>
@@ -4,8 +4,7 @@
 <head>
        <title>Media Queries Test inner frame</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-       <link rel="author" title="L. David Baron" href="http://dbaron.org/">
-       <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/">
+       <link rel="author" title="L. David Baron" href="https://dbaron.org/">
        <meta http-equiv="Content-Style-Type" content="text/css">
        <style type="text/css" id="style" media="all">
        body { text-decoration: underline; }
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html
new file mode 100644 (file)
index 0000000..794c047
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>iframe containing the meat of the test</title>
+    <style>
+body {
+    margin: 0;
+    overflow: hidden;
+}
+/* green div that should cover the red divs */
+#green {
+    position: absolute;
+    left: 0;
+    top: 0;
+    background-color: green;
+    width: 100%;
+    height: 600px;
+}
+.spacer {
+    height: 98px;
+    width: 20px;
+}
+.item {
+    background-color: red;
+    display: block;/* property under test */
+    /* border to aid understanding of boundaries between items */
+    border-style: solid;
+    border-width: 1px;
+    border-color: red;/* Note: if you're trying to debug this, use a different color here */
+}
+/* 100px = 10*(1 + 8 + 1) */
+@media (min-width: 100px) {
+    #green {
+        width: 100px;
+        height: 100px;/* = 1 + 98 + 1 */
+    }
+    .item {
+        display: table-cell;/* property and value under test */
+    }
+}
+    </style>
+</head>
+<body>
+    <div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+        <div class="item"><div class="spacer"></div></div>
+    </div>
+    <div id="green"></div>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/w3c-import.log
new file mode 100644 (file)
index 0000000..2442224
--- /dev/null
@@ -0,0 +1,18 @@
+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/w3c/web-platform-tests
+
+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/mediaqueries/support/media_queries_iframe.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries-expected.txt
new file mode 100644 (file)
index 0000000..b00affd
--- /dev/null
@@ -0,0 +1,364 @@
+
+PASS subtest_1 
+PASS subtest_2 
+PASS subtest_3 
+PASS subtest_4 
+PASS subtest_5 
+PASS subtest_6 
+PASS subtest_7 
+PASS subtest_8 
+PASS subtest_9 
+PASS subtest_10 
+PASS subtest_11 
+PASS subtest_12 
+PASS subtest_13 
+PASS subtest_14 
+PASS subtest_15 
+PASS subtest_16 
+PASS subtest_17 
+PASS subtest_18 
+PASS subtest_19 
+PASS subtest_20 
+PASS subtest_21 
+PASS subtest_22 
+PASS subtest_23 
+PASS subtest_24 
+PASS subtest_25 
+PASS subtest_26 
+PASS subtest_27 
+PASS subtest_28 
+PASS subtest_29 
+PASS subtest_30 
+PASS subtest_31 
+PASS subtest_32 
+PASS subtest_33 
+PASS subtest_34 
+PASS subtest_35 
+PASS subtest_36 
+PASS subtest_37 
+PASS subtest_38 
+PASS subtest_39 
+PASS subtest_40 
+PASS subtest_41 
+PASS subtest_42 
+PASS subtest_43 
+PASS subtest_44 
+PASS subtest_45 
+PASS subtest_46 
+PASS subtest_47 
+PASS subtest_48 
+PASS subtest_49 
+PASS subtest_50 
+PASS subtest_51 
+PASS subtest_52 
+PASS subtest_53 
+PASS subtest_54 
+PASS subtest_55 
+PASS subtest_56 
+PASS subtest_57 
+PASS subtest_58 
+PASS subtest_59 
+PASS subtest_60 
+PASS subtest_61 
+PASS subtest_62 
+PASS subtest_63 
+PASS subtest_64 
+PASS subtest_65 
+PASS subtest_66 
+PASS subtest_67 
+PASS subtest_68 
+PASS subtest_69 
+PASS subtest_70 
+PASS subtest_71 
+PASS subtest_72 
+PASS subtest_73 
+PASS subtest_74 
+PASS subtest_75 
+PASS subtest_76 
+PASS subtest_77 
+PASS subtest_78 
+FAIL subtest_79 assert_true: expected true got false
+PASS subtest_80 
+PASS subtest_81 
+FAIL subtest_82 assert_true: expected true got false
+PASS subtest_83 
+FAIL subtest_84 assert_true: expected true got false
+FAIL subtest_85 assert_true: expected true got false
+FAIL subtest_86 assert_true: expected true got false
+PASS subtest_87 
+PASS subtest_88 
+FAIL subtest_89 assert_true: expected true got false
+FAIL subtest_90 assert_true: expected true got false
+PASS subtest_91 
+FAIL subtest_92 assert_true: expected true got false
+PASS subtest_93 
+PASS subtest_94 
+FAIL subtest_95 assert_true: expected true got false
+PASS subtest_96 
+FAIL subtest_97 assert_true: expected true got false
+FAIL subtest_98 assert_true: expected true got false
+FAIL subtest_99 assert_true: expected true got false
+PASS subtest_100 
+PASS subtest_101 
+FAIL subtest_102 assert_true: expected true got false
+FAIL subtest_103 assert_true: expected true got false
+PASS subtest_104 
+FAIL subtest_105 assert_true: expected true got false
+PASS subtest_106 
+PASS subtest_107 
+FAIL subtest_108 assert_true: expected true got false
+PASS subtest_109 
+FAIL subtest_110 assert_true: expected true got false
+FAIL subtest_111 assert_true: expected true got false
+FAIL subtest_112 assert_true: expected true got false
+PASS subtest_113 
+PASS subtest_114 
+FAIL subtest_115 assert_true: expected true got false
+FAIL subtest_116 assert_true: expected true got false
+PASS subtest_117 
+FAIL subtest_118 assert_true: expected true got false
+PASS subtest_119 
+PASS subtest_120 
+FAIL subtest_121 assert_true: expected true got false
+PASS subtest_122 
+FAIL subtest_123 assert_true: expected true got false
+FAIL subtest_124 assert_true: expected true got false
+FAIL subtest_125 assert_true: expected true got false
+PASS subtest_126 
+PASS subtest_127 
+FAIL subtest_128 assert_true: expected true got false
+FAIL subtest_129 assert_true: expected true got false
+PASS subtest_130 
+FAIL subtest_131 assert_true: expected true got false
+PASS subtest_132 
+PASS subtest_133 
+PASS subtest_134 
+FAIL subtest_135 assert_true: expected true got false
+FAIL subtest_136 assert_true: expected true got false
+PASS subtest_137 
+FAIL subtest_138 assert_true: expected true got false
+FAIL subtest_139 assert_true: expected true got false
+FAIL subtest_140 assert_true: expected true got false
+PASS subtest_141 
+PASS subtest_142 
+PASS subtest_143 
+PASS subtest_144 
+PASS subtest_145 
+PASS subtest_146 
+PASS subtest_147 
+PASS subtest_148 
+PASS subtest_149 
+FAIL subtest_150 assert_true: expected true got false
+FAIL subtest_151 assert_true: expected true got false
+PASS subtest_152 
+FAIL subtest_153 assert_true: expected true got false
+FAIL subtest_154 assert_true: expected true got false
+PASS subtest_155 
+FAIL subtest_156 assert_true: expected true got false
+FAIL subtest_157 assert_true: expected true got false
+FAIL subtest_158 assert_true: expected true got false
+PASS subtest_159 
+PASS subtest_160 
+PASS subtest_161 
+PASS subtest_162 
+FAIL subtest_163 assert_true: expected true got false
+FAIL subtest_164 assert_true: expected true got false
+FAIL subtest_165 assert_true: expected true got false
+PASS subtest_166 
+PASS subtest_167 
+PASS subtest_168 
+PASS subtest_169 
+FAIL subtest_170 assert_true: expected true got false
+FAIL subtest_171 assert_true: expected true got false
+FAIL subtest_172 assert_true: expected true got false
+FAIL subtest_173 assert_true: expected true got false
+PASS subtest_174 
+PASS subtest_175 
+PASS subtest_176 
+FAIL subtest_177 assert_true: expected true got false
+PASS subtest_178 
+PASS subtest_179 
+FAIL subtest_180 assert_true: expected true got false
+FAIL subtest_181 assert_true: expected true got false
+PASS subtest_182 
+FAIL subtest_183 assert_true: expected true got false
+FAIL subtest_184 assert_true: expected true got false
+PASS subtest_185 
+PASS subtest_186 
+FAIL subtest_187 assert_true: expected true got false
+FAIL subtest_188 assert_true: expected true got false
+FAIL subtest_189 assert_true: expected true got false
+PASS subtest_190 
+FAIL subtest_191 assert_true: expected true got false
+PASS subtest_192 
+FAIL subtest_193 assert_true: expected true got false
+PASS subtest_194 
+FAIL subtest_195 assert_true: expected true got false
+FAIL subtest_196 assert_true: expected true got false
+FAIL subtest_197 assert_true: expected true got false
+PASS subtest_198 
+FAIL subtest_199 assert_true: expected true got false
+PASS subtest_200 
+PASS subtest_201 
+PASS subtest_202 
+PASS subtest_203 
+PASS subtest_204 
+PASS subtest_205 
+PASS subtest_206 
+PASS subtest_207 
+PASS subtest_208 
+PASS subtest_209 
+PASS subtest_210 
+PASS subtest_211 
+PASS subtest_212 
+PASS subtest_213 
+PASS subtest_214 
+PASS subtest_215 
+PASS subtest_216 
+PASS subtest_217 
+PASS subtest_218 
+PASS subtest_219 
+PASS subtest_220 
+PASS subtest_221 
+PASS subtest_222 
+PASS subtest_223 
+PASS subtest_224 
+PASS subtest_225 
+PASS subtest_226 
+PASS subtest_227 
+PASS subtest_228 
+PASS subtest_229 
+PASS subtest_230 
+FAIL monochrome_and_color assert_not_equals: should be either monochrome or color got disallowed value false
+PASS find_depth 
+FAIL subtest_231 assert_true: expected true got false
+PASS subtest_232 
+PASS subtest_233 
+FAIL subtest_234 assert_true: expected true got false
+PASS subtest_235 
+FAIL subtest_236 assert_true: expected true got false
+PASS subtest_237 
+PASS subtest_238 
+PASS subtest_239 
+FAIL subtest_240 assert_true: expected true got false
+PASS subtest_241 
+PASS subtest_242 
+PASS subtest_243 
+FAIL subtest_244 assert_true: expected true got false
+PASS subtest_245 
+FAIL subtest_246 assert_true: expected true got false
+PASS subtest_247 
+PASS subtest_248 
+PASS subtest_249 
+PASS subtest_250 
+PASS subtest_251 
+PASS subtest_252 
+PASS subtest_253 
+PASS subtest_254 
+PASS subtest_255 
+PASS subtest_256 
+PASS subtest_257 
+PASS subtest_258 
+PASS subtest_259 
+PASS subtest_260 
+PASS subtest_261 
+PASS subtest_262 
+PASS subtest_263 
+PASS subtest_264 
+FAIL subtest_265 assert_true: expected true got false
+PASS subtest_266 
+FAIL subtest_267 assert_true: expected true got false
+PASS subtest_268 
+FAIL subtest_269 assert_true: expected true got false
+FAIL subtest_270 assert_true: expected true got false
+FAIL subtest_271 assert_true: expected true got false
+PASS subtest_272 
+PASS subtest_273 
+PASS subtest_274 
+PASS subtest_275 
+PASS subtest_276 
+PASS subtest_277 
+PASS subtest_278 
+PASS subtest_279 
+PASS subtest_280 
+PASS subtest_281 
+PASS subtest_282 
+PASS subtest_283 
+PASS subtest_284 
+PASS subtest_285 
+PASS subtest_286 
+PASS subtest_287 
+PASS subtest_288 
+PASS subtest_289 
+PASS subtest_290 
+PASS subtest_291 
+PASS subtest_292 
+FAIL find_resolution assert_false: expected false got true
+PASS subtest_293 
+PASS subtest_294 
+FAIL subtest_295 assert_true: expected true got false
+PASS subtest_296 
+FAIL subtest_297 assert_true: expected true got false
+PASS subtest_298 
+FAIL subtest_299 assert_true: expected true got false
+FAIL subtest_300 assert_true: expected true got false
+PASS subtest_301 
+FAIL subtest_302 assert_true: expected true got false
+FAIL subtest_303 assert_true: expected true got false
+FAIL subtest_304 assert_true: expected true got false
+FAIL subtest_305 assert_true: expected true got false
+PASS subtest_306 
+PASS subtest_307 
+PASS subtest_308 
+PASS subtest_309 
+PASS subtest_310 
+PASS subtest_311 
+PASS subtest_312 
+FAIL subtest_313 assert_true: expected true got false
+FAIL subtest_314 assert_true: expected true got false
+FAIL subtest_315 assert_true: expected true got false
+PASS subtest_316 
+PASS subtest_317 
+PASS subtest_318 
+PASS subtest_319 
+PASS subtest_320 
+PASS subtest_321 
+PASS subtest_322 
+PASS subtest_323 
+PASS subtest_324 
+PASS subtest_325 
+FAIL subtest_326 assert_true: expected true got false
+PASS subtest_327 
+PASS subtest_328 
+PASS subtest_329 
+FAIL subtest_330 assert_true: expected true got false
+PASS subtest_331 
+PASS subtest_332 
+FAIL subtest_333 assert_true: expected true got false
+PASS subtest_334 
+FAIL subtest_335 assert_true: expected true got false
+PASS subtest_336 
+PASS subtest_337 
+FAIL subtest_338 assert_true: expected true got false
+PASS subtest_339 
+FAIL subtest_340 assert_true: expected true got false
+FAIL subtest_341 assert_true: expected true got false
+FAIL subtest_342 assert_true: expected true got false
+FAIL subtest_343 assert_true: expected true got false
+FAIL subtest_344 assert_true: expected true got false
+PASS subtest_345 
+FAIL subtest_346 assert_true: expected true got false
+FAIL subtest_347 assert_true: expected true got false
+PASS subtest_348 
+PASS subtest_349 
+FAIL subtest_350 assert_true: expected true got false
+FAIL subtest_351 assert_true: expected true got false
+PASS subtest_352 
+PASS subtest_353 
+PASS subtest_354 
+PASS subtest_355 
+PASS subtest_356 
+PASS subtest_357 
+PASS subtest_358 
+PASS subtest_359 
+
@@ -2,60 +2,44 @@
 <html>
 <head>
   <title>Media Queries Self-Contained Test Suite</title>
-  <link rel="author" title="L. David Baron" href="http://dbaron.org/">
+  <link rel="author" title="L. David Baron" href="https://dbaron.org/">
   <link rel="author" title="Anne van Kesteren" href="http://annevankesteren.nl/">
   <link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
   <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/">
-  <script type="text/javascript" src="../../../resources/testharness.js"></script>
-  <script type="text/javascript" src="../../../resources/testharnessreport.js"></script>
+  <script type="text/javascript" src="/resources/testharness.js"></script>
+  <script type="text/javascript" src="/resources/testharnessreport.js"></script>
 </head>
 <body onload="run()">
 <div id=log></div>
-<iframe id="subdoc" src="resources/media_queries_iframe.html"></iframe>
+<iframe id="subdoc" src="support/media_queries_iframe.html"></iframe>
 <div id="content" style="display: none"></div>
 
 <script type="text/javascript">
 setup({ "explicit_done": true });
 
-function assert_false_wrapper(fnc) {
-    try {
-      assert_false(fnc);
-    } catch (e) {
-      throw {message: e.message, stack: undefined};
-    }
-}
-
-function assert_true_wrapper(fnc) {
-    try {
-      assert_true(fnc);
-    } catch (e) {
-      throw {message: e.message, stack: undefined};
-    }
-}
-
-
 function run() {
     var subdoc = document.getElementById("subdoc").contentDocument;
     var subwin = document.getElementById("subdoc").contentWindow;
     var style = subdoc.getElementById("style");
     var iframe_style = document.getElementById("subdoc").style;
     var body_cs = subdoc.defaultView.getComputedStyle(subdoc.body, "");
+    var testNum = 0;
 
     function query_applies(q) {
       style.setAttribute("media", q);
-      return body_cs.getPropertyValue("text-decoration") == "underline";
+      return body_cs.getPropertyValue("text-decoration-line") == "underline";
     }
 
-    function should_apply(q, message) {
+    function should_apply(q) {
       test(function() {
-        assert_true_wrapper(query_applies(q));
-      }, (message !== undefined ? message : q) + " should apply");
+        assert_true(query_applies(q));
+      }, "subtest_" + ++testNum, {assert: q + " should apply"});
     }
 
-    function should_not_apply(q, message) {
+    function should_not_apply(q) {
       test(function() {
-        assert_false_wrapper(query_applies(q));
-      }, (message !== undefined ? message : q) + " should not apply");
+        assert_false(query_applies(q));
+      }, "subtest_" + ++testNum, {assert: q + " should not apply"});
     }
 
     /*
@@ -83,14 +67,14 @@ function run() {
 
     function query_should_be_parseable(q) {
       test(function() {
-        assert_true_wrapper(query_is_parseable(q))
-      },"query " + q + " should be parseable");
+        assert_true(query_is_parseable(q))
+      }, "subtest_" + ++testNum, {assert: "query " + q + " should be parseable"});
     }
 
     function query_should_not_be_parseable(q) {
       test(function() {
-        assert_false_wrapper(query_is_parseable(q))
-      },"query " + q + " should not be parseable");
+        assert_false(query_is_parseable(q))
+      }, "subtest_" + ++testNum, {assert: "query " + q + " should not be parseable"});
     }
 
     /*
@@ -103,14 +87,14 @@ function run() {
 
     function expression_should_be_parseable(e) {
       test(function() {
-        assert_true_wrapper(expression_is_parseable(e));
-      },"expression " + e + " should be parseable");
+        assert_true(expression_is_parseable(e));
+      }, "subtest_" + ++testNum, {assert: "expression " + e + " should be parseable"});
     }
 
     function expression_should_not_be_parseable(e) {
       test(function() {
-        assert_false_wrapper(expression_is_parseable(e));
-      },"expression " + e + " should not be parseable");
+        assert_false(expression_is_parseable(e));
+      }, "subtest_" + ++testNum, {assert: "expression " + e + " should not be parseable"});
     }
 
     // The no-type syntax doesn't mix with the not and only keywords.
@@ -119,8 +103,7 @@ function run() {
     query_should_not_be_parseable("only (orientation)");
     query_should_be_parseable("all and (orientation)");
     query_should_be_parseable("not all and (orientation)");
-    query_should_be_parseable("only all and (orientation)")
-    query_should_not_be_parseable("(orientation: 'landscape')");
+    query_should_be_parseable("only all and (orientation)");
 
     var features = [ "width", "height", "device-width", "device-height" ];
     var feature;
@@ -139,11 +122,8 @@ function run() {
       expression_should_be_parseable(feature + ": 0.001mm");
       expression_should_be_parseable(feature + ": 100000px");
       expression_should_not_be_parseable(feature + ": -1px");
-      expression_should_not_be_parseable(feature + ": '20px'");
       expression_should_not_be_parseable("min-" + feature + ": -1px");
       expression_should_not_be_parseable("max-" + feature + ": -1px");
-      expression_should_not_be_parseable("min-" + feature + ": '10px'");
-      expression_should_not_be_parseable("max-" + feature + ": '10px'");
       expression_should_not_be_parseable(feature + ": -0.00001mm");
       expression_should_not_be_parseable(feature + ": -100000em");
       expression_should_not_be_parseable("min-" + feature);
@@ -168,23 +148,23 @@ function run() {
                       "device-height": device_height };
     for (feature in features) {
       var value = features[feature];
-      should_apply("all and (" + feature + ": " + value + "px)", "all and (" + feature + ": " + feature + " px)");
-      should_not_apply("all and (" + feature + ": " + (value + 1) + "px)", "all and (" + feature + ": " + feature + " +1 px)");
-      should_not_apply("all and (" + feature + ": " + (value - 1) + "px)", "all and (" + feature + ": " + feature + " -1 px)");
-      should_apply("all and (min-" + feature + ": " + value + "px)", "all and (min-" + feature + ": " + feature + " px)");
-      should_not_apply("all and (min-" + feature + ": " + (value + 1) + "px)", "all and (min-" + feature + ": " + feature + " +1 px)");
-      should_apply("all and (min-" + feature + ": " + (value - 1) + "px)", "all and (min-" + feature + ": " + feature + " -1 px)");
-      should_apply("all and (max-" + feature + ": " + value + "px)", "all and (max-" + feature + ": " + feature + " px)");
-      should_apply("all and (max-" + feature + ": " + (value + 1) + "px)", "all and (max-" + feature + ": " + feature + " +1 px)");
-      should_not_apply("all and (max-" + feature + ": " + (value - 1) + "px)", "all and (max-" + feature + ": " + feature + " +1 px)");
+      should_apply("all and (" + feature + ": " + value + "px)");
+      should_not_apply("all and (" + feature + ": " + (value + 1) + "px)");
+      should_not_apply("all and (" + feature + ": " + (value - 1) + "px)");
+      should_apply("all and (min-" + feature + ": " + value + "px)");
+      should_not_apply("all and (min-" + feature + ": " + (value + 1) + "px)");
+      should_apply("all and (min-" + feature + ": " + (value - 1) + "px)");
+      should_apply("all and (max-" + feature + ": " + value + "px)");
+      should_apply("all and (max-" + feature + ": " + (value + 1) + "px)");
+      should_not_apply("all and (max-" + feature + ": " + (value - 1) + "px)");
       should_not_apply("all and (min-" + feature + ": " +
-                       (Math.ceil(value/em_size) + 1) + "em)", "all and (min-" + feature + ": " + feature + " +1 em)");
+                       (Math.ceil(value/em_size) + 1) + "em)");
       should_apply("all and (min-" + feature + ": " +
-                   (Math.floor(value/em_size) - 1) + "em)", "all and (min-" + feature + ": " + feature + " -1 em)");
+                   (Math.floor(value/em_size) - 1) + "em)");
       should_apply("all and (max-" + feature + ": " +
-                   (Math.ceil(value/em_size) + 1) + "em)", "all and (max-" + feature + ": " + feature + " +1 em)");
+                   (Math.ceil(value/em_size) + 1) + "em)");
       should_not_apply("all and (max-" + feature + ": " +
-                       (Math.floor(value/em_size) - 1) + "em)", "all and (max-" + feature + ": " + feature + " -1 em)");
+                       (Math.floor(value/em_size) - 1) + "em)");
     }
 
     iframe_style.width = "0";
@@ -258,25 +238,25 @@ function run() {
     var high_dar_2 = device_width + "/" + (device_height - 1);
     var low_dar_1 = (device_width - 1) + "/" + device_height;
     var low_dar_2 = device_width + "/" + (device_height + 1);
-    should_apply("(device-aspect-ratio: " + real_dar + ")", "(device-aspect-ratio: device-width / device-height)");
-    should_apply("not all and (device-aspect-ratio: " + high_dar_1 + ")", "not all and (device-aspect-ratio: device-width + 1 / device-height)");
-    should_not_apply("all and (device-aspect-ratio: " + high_dar_2 + ")", "all and (device-aspect-ratio: device-width / device-height - 1)");
-    should_not_apply("all and (device-aspect-ratio: " + low_dar_1 + ")", "all and (device-aspect-ratio: device-width - 1 / device-height)");
-    should_apply("not all and (device-aspect-ratio: " + low_dar_2 + ")", "not all and (device-aspect-ratio: device-width / device-height + 1)");
+    should_apply("(device-aspect-ratio: " + real_dar + ")");
+    should_apply("not all and (device-aspect-ratio: " + high_dar_1 + ")");
+    should_not_apply("all and (device-aspect-ratio: " + high_dar_2 + ")");
+    should_not_apply("all and (device-aspect-ratio: " + low_dar_1 + ")");
+    should_apply("not all and (device-aspect-ratio: " + low_dar_2 + ")");
     should_apply("(device-aspect-ratio)");
 
-    should_apply("(min-device-aspect-ratio: " + real_dar + ")", "(min-device-aspect-ratio: device-width / device-height)");
-    should_not_apply("all and (min-device-aspect-ratio: " + high_dar_1 + ")", "not all and (device-aspect-ratio: device-width + 1 / device-height)");
-    should_apply("not all and (min-device-aspect-ratio: " + high_dar_2 + ")", "not all and (min-device-aspect-ratio: device-width / device-height - 1)");
-    should_not_apply("not all and (min-device-aspect-ratio: " + low_dar_1 + ")", "not all and (min-device-aspect-ratio: device-width - 1 / device-height)" );
-    should_apply("all and (min-device-aspect-ratio: " + low_dar_2 + ")", "all and (min-device-aspect-ratio: device-width / device-height + 1)");
+    should_apply("(min-device-aspect-ratio: " + real_dar + ")");
+    should_not_apply("all and (min-device-aspect-ratio: " + high_dar_1 + ")");
+    should_apply("not all and (min-device-aspect-ratio: " + high_dar_2 + ")");
+    should_not_apply("not all and (min-device-aspect-ratio: " + low_dar_1 + ")");
+    should_apply("all and (min-device-aspect-ratio: " + low_dar_2 + ")");
     expression_should_not_be_parseable("min-device-aspect-ratio");
 
-    should_apply("all and (max-device-aspect-ratio: " + real_dar + ")", "all and (max-device-aspect-ratio: device-width / device-height)");
-    should_apply("(max-device-aspect-ratio: " + high_dar_1 + ")", "(max-device-aspect-ratio: device-width + 1 / device-height)");
-    should_apply("(max-device-aspect-ratio: " + high_dar_2 + ")", "(max-device-aspect-ratio: device-width / device-height - 1");
-    should_not_apply("all and (max-device-aspect-ratio: " + low_dar_1 + ")", "all and (max-device-aspect-ratio: device-width - 1 / device-height)");
-    should_apply("not all and (max-device-aspect-ratio: " + low_dar_2 + ")", "not all and (max-device-aspect-ratio: device-width / device-height + 1)");
+    should_apply("all and (max-device-aspect-ratio: " + real_dar + ")");
+    should_apply("(max-device-aspect-ratio: " + high_dar_1 + ")");
+    should_apply("(max-device-aspect-ratio: " + high_dar_2 + ")");
+    should_not_apply("all and (max-device-aspect-ratio: " + low_dar_1 + ")");
+    should_apply("not all and (max-device-aspect-ratio: " + low_dar_2 + ")");
     expression_should_not_be_parseable("max-device-aspect-ratio");
 
     features = [ "max-aspect-ratio", "device-aspect-ratio" ];
@@ -301,13 +281,12 @@ function run() {
 
     var is_monochrome = query_applies("all and (min-monochrome: 1)");
     var is_color = query_applies("all and (min-color: 1)");
-    var colorString = is_color ? "color" : "monochrome";
     test(function() {
       assert_not_equals(is_monochrome, is_color, "should be either monochrome or color");
     }, "monochrome_and_color");
 
     function depth_query(prefix, depth) {
-      return "all and (" + prefix + colorString +
+      return "all and (" + prefix + (is_color ? "color" : "monochrome") +
              ":" + depth + ")";
     }
 
@@ -318,16 +297,16 @@ function run() {
       }
     } while (query_applies(depth_query("min-", ++depth)));
     test(function() {
-      assert_false_wrapper(50 < depth);
+      assert_false(50 < depth);
     }, "find_depth");
     --depth;
 
-    should_apply(depth_query("", depth), "all and (" + colorString + ": depth)");
-    should_not_apply(depth_query("", depth - 1), "all and (" + colorString + ": depth - 1)");
-    should_not_apply(depth_query("", depth + 1), "all and (" + colorString + ": depth + 1)");
-    should_apply(depth_query("max-", depth), "all and (max-" + colorString + ": depth)");
-    should_not_apply(depth_query("max-", depth - 1), "all and (max-" + colorString + ": depth - 1)");
-    should_apply(depth_query("max-", depth + 1), "all and (max-" + colorString + ": depth + 1)");
+    should_apply(depth_query("", depth));
+    should_not_apply(depth_query("", depth - 1));
+    should_not_apply(depth_query("", depth + 1));
+    should_apply(depth_query("max-", depth));
+    should_not_apply(depth_query("max-", depth - 1));
+    should_apply(depth_query("max-", depth + 1));
 
     (is_color ? should_apply : should_not_apply)("all and (color)");
     expression_should_not_be_parseable("max-color");
@@ -340,7 +319,7 @@ function run() {
     (is_color ? should_apply : should_not_apply)("only all and (color)");
     (is_color ? should_not_apply : should_apply)("only all and (monochrome)");
 
-    features = [ "color", "min-monochrome" ];
+    features = [ "color", "min-monochrome", "max-color-index" ];
     for (i in features) {
       feature = features[i];
       expression_should_be_parseable(feature + ": 1");
@@ -351,56 +330,84 @@ function run() {
       expression_should_not_be_parseable(feature + ": 1/1");
     }
 
-    // Find the resolution using max-resolution
-    var resolution = 0;
-    var max_resolution = 1000;
-
-    if (query_applies("(resolution)")) {
-        do {
-          ++resolution;
-          if (resolution > max_resolution) {
-            break;
-          }
-        } while (!query_applies("(max-resolution: " + resolution + "dpi)"));
-    } else {
-        resolution = max_resolution + 1;
+    // Presume that we never support indexed color (at least not usefully
+    // enough to call it indexed color).
+    should_apply("(color-index: 0)");
+    should_not_apply("(color-index: 1)");
+    should_apply("(min-color-index: 0)");
+    should_not_apply("(min-color-index: 1)");
+    should_apply("(max-color-index: 0)");
+    should_apply("(max-color-index: 1)");
+    should_apply("(max-color-index: 157)");
+
+    features = [ "resolution", "min-resolution", "max-resolution" ];
+    for (i in features) {
+      feature = features[i];
+      expression_should_be_parseable(feature + ": 3dpi");
+      expression_should_be_parseable(feature + ":3dpi");
+      expression_should_be_parseable(feature + ": 3.0dpi");
+      expression_should_be_parseable(feature + ": 3.4dpi");
+      expression_should_be_parseable(feature + "\t: 120dpcm");
+      expression_should_not_be_parseable(feature + ": 0dpi");
+      expression_should_not_be_parseable(feature + ": -3dpi");
     }
 
+    // Find the resolution using max-resolution
+    var resolution = 0;
+    do {
+      ++resolution;
+      if (resolution > 10000) {
+        break;
+      }
+    } while (!query_applies("(max-resolution: " + resolution + "dpi)"));
     test(function() {
-      assert_false_wrapper(max_resolution < resolution);
+      assert_false(10000 < resolution);
     }, "find_resolution");
 
     // resolution should now be Math.ceil() of the actual resolution.
     var dpi_high;
     var dpi_low = resolution - 1;
-    var dpi_low_str = "dpi - 1";
-    var dpi_high_str = "dpi + 1";
     if (query_applies("(min-resolution: " + resolution + "dpi)")) {
       // It's exact!
-      should_apply("(resolution: " + resolution + "dpi)", "(resolution: dpi)");
-      should_not_apply("(resolution: " + (resolution + 1) + "dpi)", "(resolution: dpi + 1)");
-      should_not_apply("(resolution: " + (resolution - 1) + "dpi)", "(resolution: dpi - 1)");
+      should_apply("(resolution: " + resolution + "dpi)");
+      should_not_apply("(resolution: " + (resolution + 1) + "dpi)");
+      should_not_apply("(resolution: " + (resolution - 1) + "dpi)");
       dpi_high = resolution + 1;
     } else {
          // We have no way to test resolution applying since it need not be
          // an integer.
-      should_not_apply("(resolution: " + resolution + "dpi)", "(resolution: dpi)");
-      should_not_apply("(resolution: " + (resolution - 1) + "dpi)", "(resolution: dpi + 1)");
+      should_not_apply("(resolution: " + resolution + "dpi)");
+      should_not_apply("(resolution: " + (resolution - 1) + "dpi)");
       dpi_high = resolution;
     }
 
-    should_apply("(min-resolution: " + dpi_low + "dpi)", "(min-resolution: " + dpi_low_str + " )");
-    should_not_apply("not all and (min-resolution: " + dpi_low + "dpi)", "not all and (min-resolution: " + dpi_low_str + " )");
-    should_apply("not all and (min-resolution: " + dpi_high + "dpi)", "not all and (min-resolution: " + dpi_high_str + " )");
-    should_not_apply("all and (min-resolution: " + dpi_high + "dpi)", "all and (min-resolution: " + dpi_high_str + " )");
+    should_apply("(min-resolution: " + dpi_low + "dpi)");
+    should_not_apply("not all and (min-resolution: " + dpi_low + "dpi)");
+    should_apply("not all and (min-resolution: " + dpi_high + "dpi)");
+    should_not_apply("all and (min-resolution: " + dpi_high + "dpi)");
 
     // Test dpcm units based on what we computed in dpi.
     var dpcm_high = Math.ceil(dpi_high / 2.54);
     var dpcm_low = Math.floor(dpi_low / 2.54);
-    should_apply("(min-resolution: " + dpcm_low + "dpcm)", "(min-resolution: dpcm (" + dpi_low_str + ") )");
-    should_apply("(max-resolution: " + dpcm_high + "dpcm)", "(max-resolution: dpcm  (" + dpi_high_str + ") )");
-    should_not_apply("(max-resolution: " + dpcm_low + "dpcm)", "(max-resolution: dpcm  (" + dpi_low_str + ") )");
-    should_apply("not all and (min-resolution: " + dpcm_high + "dpcm)", "not all and (min-resolution: dpcm  (" + dpi_high_str + ") )");
+    should_apply("(min-resolution: " + dpcm_low + "dpcm)");
+    should_apply("(max-resolution: " + dpcm_high + "dpcm)");
+    should_not_apply("(max-resolution: " + dpcm_low + "dpcm)");
+    should_apply("not all and (min-resolution: " + dpcm_high + "dpcm)");
+
+    expression_should_be_parseable("scan");
+    expression_should_be_parseable("scan: progressive");
+    expression_should_be_parseable("scan:interlace");
+    expression_should_not_be_parseable("min-scan:interlace");
+    expression_should_not_be_parseable("scan: 1");
+    expression_should_not_be_parseable("max-scan");
+    expression_should_not_be_parseable("max-scan: progressive");
+    // Assume we don't support tv devices.
+    should_not_apply("(scan)");
+    should_not_apply("(scan: progressive)");
+    should_not_apply("(scan: interlace)");
+    should_apply("not all and (scan)");
+    should_apply("not all and (scan: progressive)");
+    should_apply("not all and (scan: interlace)");
 
     expression_should_be_parseable("grid");
     expression_should_be_parseable("grid: 0");
@@ -419,6 +426,42 @@ function run() {
     should_not_apply("(grid: 2)");
     should_not_apply("(grid: -1)");
 
+    // Parsing tests
+    // bug 454227
+    should_apply("(orientation");
+    should_not_apply("not all and (orientation");
+    should_not_apply("(orientation:");
+    should_apply("all,(orientation:");
+    should_not_apply("(orientation:,all");
+    should_apply("not all and (grid");
+    should_not_apply("only all and (grid");
+    should_not_apply("(grid");
+    should_apply("all,(grid");
+    should_not_apply("(grid,all");
+    // bug 454226
+    should_apply(",all");
+    should_apply("all,");
+    should_apply(",all,");
+    should_apply("all,badmedium");
+    should_apply("badmedium,all");
+    should_not_apply(",badmedium,");
+    should_apply("all,(badexpression)");
+    should_apply("(badexpression),all");
+    should_not_apply("(badexpression),badmedium");
+    should_not_apply("badmedium,(badexpression)");
+    should_apply("all,[badsyntax]");
+    should_apply("[badsyntax],all");
+    should_not_apply("badmedium,[badsyntax]");
+    should_not_apply("[badsyntax],badmedium");
+
+    // Parsing tests based on Acid3
+    query_should_not_be_parseable("all and color :");
+    query_should_not_be_parseable("all and color : 1");
+    should_not_apply("all and min-color : 1");
+    should_not_apply("(bogus)");
+    should_not_apply("not all and (bogus)")
+    should_not_apply("only all and (bogus)")
+
     done();
 }
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/w3c-import.log
new file mode 100644 (file)
index 0000000..30f146c
--- /dev/null
@@ -0,0 +1,68 @@
+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/w3c/web-platform-tests
+
+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/mediaqueries/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-003.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/aspect-ratio-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/min-width-tables-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-003.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-002.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-003.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004-expected.xht
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/relative-units-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries.html
index de3d09e..4587600 100644 (file)
@@ -3024,6 +3024,8 @@ webkit.org/b/175273 imported/w3c/web-platform-tests/html/browsers/windows/norefe
 webkit.org/b/175353 imported/w3c/web-platform-tests/css/css-ui-3/outline-004.html [ ImageOnlyFailure ]
 webkit.org/b/175353 imported/w3c/web-platform-tests/css/css-ui-3/outline-style-014.html [ ImageOnlyFailure ]
 
+imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html [ ImageOnlyFailure ]
+
 webkit.org/b/170698 [ Release ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors.html [ Pass Failure ]
 
 # This test tests a feature that only exists on iOS.
index 751fb19..a96cd11 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index 751fb19..a96cd11 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index 341f443..8c2d6bc 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index 751fb19..a96cd11 100644 (file)
@@ -38,7 +38,7 @@ PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
-FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
+PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
 PASS "green-1x1.png" is "green-1x1.png"
index 6d6bd6d..f13080a 100644 (file)
@@ -1,3 +1,48 @@
+2018-01-22  Chris Nardi  <csnardi1@gmail.com>
+
+        Parse calc() in CSS media queries
+        https://bugs.webkit.org/show_bug.cgi?id=181716
+
+        calc() was previously unsupported inside of media queries. This change
+        adds in support for parsing calc inside of media queries.
+
+        Reviewed by Antti Koivisto.
+
+        Tests: Imported web-platform-tests/css/mediaqueries
+
+        * css/MediaQueryExpression.cpp:
+        (WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
+        (WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
+        (WebCore::featureWithValidPositiveLength): Ditto.
+        (WebCore::featureExpectingPositiveInteger): Ditto.
+        (WebCore::featureWithPositiveInteger): Ditto.
+        (WebCore::featureWithPositiveNumber): Ditto.
+        (WebCore::featureWithZeroOrOne): Ditto.
+        (WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
+        * css/MediaQueryExpression.h:
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
+        * css/parser/CSSPropertyParserHelpers.h:
+        * css/parser/MediaQueryParser.cpp:
+        (WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
+        (WebCore::MediaQueryParser::readMediaNot): Ditto.
+        (WebCore::MediaQueryParser::readMediaType): Ditto.
+        (WebCore::MediaQueryParser::readAnd): Ditto.
+        (WebCore::MediaQueryParser::readFeatureStart): Ditto.
+        (WebCore::MediaQueryParser::readFeature): Ditto.
+        (WebCore::MediaQueryParser::readFeatureColon): Ditto.
+        (WebCore::MediaQueryParser::readFeatureValue): Ditto.
+        (WebCore::MediaQueryParser::readFeatureEnd): Ditto.
+        (WebCore::MediaQueryParser::skipUntilComma): Ditto.
+        (WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
+        (WebCore::MediaQueryParser::processToken): Ditto.
+        (WebCore::MediaQueryParser::parseInternal): Ditto.
+        (WebCore::MediaQueryData::clear): Removed reference to m_valueList
+        (WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
+        (WebCore::MediaQueryData::lastExpressionValid): New helper function.
+        (WebCore::MediaQueryData::removeLastExpression): New helper function.
+        * css/parser/MediaQueryParser.h:
+
 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
 
         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
index 407852c..223322a 100644 (file)
 #include "MediaQueryExpression.h"
 
 #include "CSSAspectRatioValue.h"
-#include "CSSParserToken.h"
 #include "CSSPrimitiveValue.h"
+#include "CSSPropertyParserHelpers.h"
 #include "MediaFeatureNames.h"
 #include <wtf/text/TextStream.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
-static inline bool featureWithValidIdent(const AtomicString& mediaFeature)
+static inline bool featureWithValidIdent(const AtomicString& mediaFeature, const CSSPrimitiveValue& value)
 {
+    if (value.primitiveType() != CSSPrimitiveValue::UnitType::CSS_IDENT)
+        return false;
+
     return mediaFeature == MediaFeatureNames::orientation
     || mediaFeature == MediaFeatureNames::colorGamut
     || mediaFeature == MediaFeatureNames::anyHover
@@ -52,9 +55,9 @@ static inline bool featureWithValidIdent(const AtomicString& mediaFeature)
     || mediaFeature == MediaFeatureNames::prefersReducedMotion;
 }
 
-static inline bool featureWithValidDensity(const String& mediaFeature, const CSSParserToken& token)
+static inline bool featureWithValidDensity(const String& mediaFeature, const CSSPrimitiveValue& value)
 {
-    if (!CSSPrimitiveValue::isResolution(static_cast<CSSPrimitiveValue::UnitType>(token.unitType())) || token.numericValue() <= 0)
+    if (!value.isResolution() || value.doubleValue() <= 0)
         return false;
     
     return mediaFeature == MediaFeatureNames::resolution
@@ -62,12 +65,11 @@ static inline bool featureWithValidDensity(const String& mediaFeature, const CSS
     || mediaFeature == MediaFeatureNames::maxResolution;
 }
 
-static inline bool featureWithValidPositiveLength(const String& mediaFeature, const CSSParserToken& token)
+static inline bool featureWithValidPositiveLength(const String& mediaFeature, const CSSPrimitiveValue& value)
 {
-    if (!(CSSPrimitiveValue::isLength(token.unitType()) || (token.type() == NumberToken && !token.numericValue())) || token.numericValue() < 0)
+    if (!(value.isLength() || (value.isNumber() && !value.doubleValue())) || value.doubleValue() < 0)
         return false;
     
-    
     return mediaFeature == MediaFeatureNames::height
     || mediaFeature == MediaFeatureNames::maxHeight
     || mediaFeature == MediaFeatureNames::minHeight
@@ -82,14 +84,11 @@ static inline bool featureWithValidPositiveLength(const String& mediaFeature, co
     || mediaFeature == MediaFeatureNames::maxDeviceWidth;
 }
 
-static inline bool featureWithPositiveInteger(const String& mediaFeature, const CSSParserToken& token)
+static inline bool featureExpectingPositiveInteger(const String& mediaFeature)
 {
-    if (token.numericValueType() != IntegerValueType || token.numericValue() < 0)
-        return false;
-    
     return mediaFeature == MediaFeatureNames::color
-    || mediaFeature == MediaFeatureNames:: maxColor
-    || mediaFeature == MediaFeatureNames:: minColor
+    || mediaFeature == MediaFeatureNames::maxColor
+    || mediaFeature == MediaFeatureNames::minColor
     || mediaFeature == MediaFeatureNames::colorIndex
     || mediaFeature == MediaFeatureNames::maxColorIndex
     || mediaFeature == MediaFeatureNames::minColorIndex
@@ -98,9 +97,16 @@ static inline bool featureWithPositiveInteger(const String& mediaFeature, const
     || mediaFeature == MediaFeatureNames::minMonochrome;
 }
 
-static inline bool featureWithPositiveNumber(const String& mediaFeature, const CSSParserToken& token)
+static inline bool featureWithPositiveInteger(const String& mediaFeature, const CSSPrimitiveValue& value)
 {
-    if (token.type() != NumberToken || token.numericValue() < 0)
+    if (!value.isNumber())
+        return false;
+    return featureExpectingPositiveInteger(mediaFeature);
+}
+
+static inline bool featureWithPositiveNumber(const String& mediaFeature, const CSSPrimitiveValue& value)
+{
+    if (!value.isNumber())
         return false;
     
     return mediaFeature == MediaFeatureNames::transform3d
@@ -112,9 +118,9 @@ static inline bool featureWithPositiveNumber(const String& mediaFeature, const C
     || mediaFeature == MediaFeatureNames::transform2d;
 }
 
-static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSParserToken& token)
+static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSPrimitiveValue& value)
 {
-    if (token.numericValueType() != IntegerValueType || !(token.numericValue() == 1 || !token.numericValue()))
+    if (!value.isNumber() || !(value.doubleValue() == 1 || !value.doubleValue()))
         return false;
     
     return mediaFeature == MediaFeatureNames::grid;
@@ -162,55 +168,62 @@ static inline bool isFeatureValidWithoutValue(const AtomicString& mediaFeature)
         || mediaFeature == MediaFeatureNames::videoPlayableInline;
 }
 
-MediaQueryExpression::MediaQueryExpression(const String& feature, const Vector<CSSParserToken, 4>& tokenList)
+inline RefPtr<CSSPrimitiveValue> consumeFirstValue(const String& mediaFeature, CSSParserTokenRange& range)
+{
+    if (auto value = CSSPropertyParserHelpers::consumeInteger(range, 0))
+        return value;
+
+    if (!featureExpectingPositiveInteger(mediaFeature) && !isAspectRatioFeature(mediaFeature)) {
+        if (auto value = CSSPropertyParserHelpers::consumeNumber(range, ValueRangeNonNegative))
+            return value;
+    }
+
+    if (auto value = CSSPropertyParserHelpers::consumeLength(range, HTMLStandardMode, ValueRangeNonNegative))
+        return value;
+
+    if (auto value = CSSPropertyParserHelpers::consumeResolution(range))
+        return value;
+
+    if (auto value = CSSPropertyParserHelpers::consumeIdent(range))
+        return value;
+
+    return nullptr;
+}
+
+MediaQueryExpression::MediaQueryExpression(const String& feature, CSSParserTokenRange& range)
     : m_mediaFeature(feature.convertToASCIILowercase())
     , m_isValid(false)
 {
-    // Create value for media query expression that must have 1 or more values.
-    if (!tokenList.size() && isFeatureValidWithoutValue(m_mediaFeature)) {
-        // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
-        m_isValid = true;
-    } else if (tokenList.size() == 1) {
-        CSSParserToken token = tokenList.first();
-        if (token.type() == IdentToken) {
-            CSSValueID ident = token.id();
-            if (!featureWithValidIdent(m_mediaFeature))
-                return;
-            m_value = CSSPrimitiveValue::createIdentifier(ident);
+    RefPtr<CSSPrimitiveValue> firstValue = consumeFirstValue(m_mediaFeature, range);
+    if (!firstValue) {
+        if (isFeatureValidWithoutValue(m_mediaFeature)) {
+            // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
             m_isValid = true;
-        } else if (token.type() == NumberToken || token.type() == PercentageToken || token.type() == DimensionToken) {
-            // Check for numeric token types since it is only safe for these types to call numericValue.
-            if (featureWithValidDensity(m_mediaFeature, token)
-                || featureWithValidPositiveLength(m_mediaFeature, token)) {
-                // Media features that must have non-negative <density>, ie. dppx, dpi or dpcm,
-                // or Media features that must have non-negative <length> or number value.
-                m_value = CSSPrimitiveValue::create(token.numericValue(), (CSSPrimitiveValue::UnitType) token.unitType());
-                m_isValid = true;
-            } else if (featureWithPositiveInteger(m_mediaFeature, token)
-                || featureWithPositiveNumber(m_mediaFeature, token)
-                || featureWithZeroOrOne(m_mediaFeature, token)) {
-                // Media features that must have non-negative integer value,
-                // or media features that must have non-negative number value,
-                // or media features that must have (0|1) value.
-                m_value = CSSPrimitiveValue::create(token.numericValue(), CSSPrimitiveValue::UnitType::CSS_NUMBER);
-                m_isValid = true;
-            }
         }
-    } else if (tokenList.size() == 3 && isAspectRatioFeature(m_mediaFeature)) {
-        // FIXME: <ratio> is supposed to allow whitespace around the '/'
-        // Applicable to device-aspect-ratio and aspect-ratio.
-        const CSSParserToken& numerator = tokenList[0];
-        const CSSParserToken& delimiter = tokenList[1];
-        const CSSParserToken& denominator = tokenList[2];
-        if (delimiter.type() != DelimiterToken || delimiter.delimiter() != '/')
+        return;
+    }
+    // Create value for media query expression that must have 1 or more values.
+    if (isAspectRatioFeature(m_mediaFeature)) {
+        if (!firstValue->isNumber() || !firstValue->doubleValue())
             return;
-        if (numerator.type() != NumberToken || numerator.numericValue() <= 0 || numerator.numericValueType() != IntegerValueType)
+        if (!CSSPropertyParserHelpers::consumeSlashIncludingWhitespace(range))
             return;
-        if (denominator.type() != NumberToken || denominator.numericValue() <= 0 || denominator.numericValueType() != IntegerValueType)
+        RefPtr<CSSPrimitiveValue> denominatorValue = CSSPropertyParserHelpers::consumePositiveInteger(range);
+        if (!denominatorValue)
             return;
-        
-        m_value = CSSAspectRatioValue::create(numerator.numericValue(), denominator.numericValue());
+
+        unsigned numerator = clampTo<unsigned>(firstValue->doubleValue());
+        unsigned denominator = clampTo<unsigned>(denominatorValue->doubleValue());
+        m_value = CSSAspectRatioValue::create(numerator, denominator);
+        m_isValid = true;
+        return;
+    }
+    if (featureWithPositiveInteger(m_mediaFeature, *firstValue) || featureWithPositiveNumber(m_mediaFeature, *firstValue)
+        || featureWithZeroOrOne(m_mediaFeature, *firstValue) || featureWithValidDensity(m_mediaFeature, *firstValue)
+        || featureWithValidPositiveLength(m_mediaFeature, *firstValue) || featureWithValidIdent(m_mediaFeature, *firstValue)) {
+        m_value = firstValue;
         m_isValid = true;
+        return;
     }
 }
 
index a4d08a0..8523092 100644 (file)
@@ -27,7 +27,7 @@
 
 #pragma once
 
-#include "CSSParserToken.h"
+#include "CSSParserTokenRange.h"
 #include "CSSValue.h"
 #include <memory>
 
@@ -40,7 +40,7 @@ namespace WebCore {
 class MediaQueryExpression {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit MediaQueryExpression(const String& mediaFeature, const Vector<CSSParserToken, 4>& tokenList);
+    explicit MediaQueryExpression(const String& mediaFeature, CSSParserTokenRange&);
 
     const AtomicString& mediaFeature() const;
     CSSValue* value() const;
index 853c24a..f0e25c7 100644 (file)
@@ -406,6 +406,18 @@ RefPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange& range, CSSParserMode
     return nullptr;
 }
 
+RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& range)
+{
+    const CSSParserToken& token = range.peek();
+    // Unlike the other types, calc() does not work with <resolution>.
+    if (token.type() != DimensionToken)
+        return nullptr;
+    CSSPrimitiveValue::UnitType unit = token.unitType();
+    if (unit == CSSPrimitiveValue::UnitType::CSS_DPPX || unit == CSSPrimitiveValue::UnitType::CSS_DPI || unit == CSSPrimitiveValue::UnitType::CSS_DPCM)
+        return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().numericValue(), unit);
+    return nullptr;
+}
+
 RefPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange& range)
 {
     if (range.peek().type() != IdentToken)
index db660ac..fbc393f 100644 (file)
@@ -67,6 +67,7 @@ RefPtr<CSSPrimitiveValue> consumePercent(CSSParserTokenRange&, ValueRange);
 RefPtr<CSSPrimitiveValue> consumeLengthOrPercent(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid);
 RefPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk = UnitlessQuirk::Forbid);
 RefPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid);
+RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange&);
 
 RefPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&);
 RefPtr<CSSPrimitiveValue> consumeIdentRange(CSSParserTokenRange&, CSSValueID lower, CSSValueID upper);
index a1e4d32..7e7c119 100644 (file)
@@ -83,17 +83,17 @@ void MediaQueryParser::setStateAndRestrict(State state, MediaQuery::Restrictor r
 }
 
 // State machine member functions start here
-void MediaQueryParser::readRestrictor(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readRestrictor(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
 {
-    readMediaType(type, token);
+    readMediaType(type, token, range);
 }
 
-void MediaQueryParser::readMediaNot(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readMediaNot(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
 {
     if (type == IdentToken && equalIgnoringASCIICase(token.value(), "not"))
         setStateAndRestrict(ReadFeatureStart, MediaQuery::Not);
     else
-        readFeatureStart(type, token);
+        readFeatureStart(type, token, range);
 }
 
 static bool isRestrictorOrLogicalOperator(const CSSParserToken& token)
@@ -105,7 +105,7 @@ static bool isRestrictorOrLogicalOperator(const CSSParserToken& token)
         || equalIgnoringASCIICase(token.value(), "only");
 }
 
-void MediaQueryParser::readMediaType(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readMediaType(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
 {
     if (type == LeftParenthesisToken) {
         if (m_mediaQueryData.restrictor() != MediaQuery::None)
@@ -129,7 +129,7 @@ void MediaQueryParser::readMediaType(CSSParserTokenType type, const CSSParserTok
     else {
         m_state = SkipUntilComma;
         if (type == CommaToken)
-            skipUntilComma(type, token);
+            skipUntilComma(type, token, range);
     }
 }
 
@@ -142,7 +142,7 @@ void MediaQueryParser::commitMediaQuery()
     m_querySet->addMediaQuery(WTFMove(mediaQuery));
 }
 
-void MediaQueryParser::readAnd(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readAnd(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
 {
     if (type == IdentToken && equalIgnoringASCIICase(token.value(), "and")) {
         m_state = ReadFeatureStart;
@@ -155,7 +155,7 @@ void MediaQueryParser::readAnd(CSSParserTokenType type, const CSSParserToken& to
         m_state = SkipUntilComma;
 }
 
-void MediaQueryParser::readFeatureStart(CSSParserTokenType type, const CSSParserToken& /*token*/)
+void MediaQueryParser::readFeatureStart(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
 {
     if (type == LeftParenthesisToken)
         m_state = ReadFeature;
@@ -163,7 +163,7 @@ void MediaQueryParser::readFeatureStart(CSSParserTokenType type, const CSSParser
         m_state = SkipUntilComma;
 }
 
-void MediaQueryParser::readFeature(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readFeature(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
 {
     if (type == IdentToken) {
         m_mediaQueryData.setMediaFeature(token.value().toString());
@@ -172,43 +172,47 @@ void MediaQueryParser::readFeature(CSSParserTokenType type, const CSSParserToken
         m_state = SkipUntilComma;
 }
 
-void MediaQueryParser::readFeatureColon(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readFeatureColon(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
 {
-    if (type == ColonToken)
-        m_state = ReadFeatureValue;
-    else if (type == RightParenthesisToken || type == EOFToken)
-        readFeatureEnd(type, token);
-    else
+    if (type == ColonToken) {
+        while (range.peek().type() == WhitespaceToken)
+            range.consume();
+        if (range.peek().type() == RightParenthesisToken || range.peek().type() == EOFToken)
+            m_state = SkipUntilBlockEnd;
+        else
+            m_state = ReadFeatureValue;
+    } else if (type == RightParenthesisToken || type == EOFToken) {
+        m_mediaQueryData.addExpression(range);
+        readFeatureEnd(type, token, range);
+    } else
         m_state = SkipUntilBlockEnd;
 }
 
-void MediaQueryParser::readFeatureValue(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readFeatureValue(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
 {
-    if (type == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::CSS_UNKNOWN)
+    if (type == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::CSS_UNKNOWN) {
+        range.consume();
         m_state = SkipUntilComma;
-    else {
-        if (m_mediaQueryData.tryAddParserToken(type, token))
-            m_state = ReadFeatureEnd;
-        else
-            m_state = SkipUntilBlockEnd;
+    } else {
+        m_mediaQueryData.addExpression(range);
+        m_state = ReadFeatureEnd;
     }
 }
 
-void MediaQueryParser::readFeatureEnd(CSSParserTokenType type, const CSSParserToken& token)
+void MediaQueryParser::readFeatureEnd(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
 {
     if (type == RightParenthesisToken || type == EOFToken) {
-        if (type != EOFToken && m_mediaQueryData.addExpression())
+        if (type != EOFToken && m_mediaQueryData.lastExpressionValid())
             m_state = ReadAnd;
         else
             m_state = SkipUntilComma;
-    } else if (type == DelimiterToken && token.delimiter() == '/') {
-        m_mediaQueryData.tryAddParserToken(type, token);
-        m_state = ReadFeatureValue;
-    } else
+    } else {
+        m_mediaQueryData.removeLastExpression();
         m_state = SkipUntilBlockEnd;
+    }
 }
 
-void MediaQueryParser::skipUntilComma(CSSParserTokenType type, const CSSParserToken& /*token*/)
+void MediaQueryParser::skipUntilComma(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
 {
     if ((type == CommaToken && !m_blockWatcher.blockLevel()) || type == EOFToken) {
         m_state = ReadRestrictor;
@@ -218,13 +222,13 @@ void MediaQueryParser::skipUntilComma(CSSParserTokenType type, const CSSParserTo
     }
 }
 
-void MediaQueryParser::skipUntilBlockEnd(CSSParserTokenType /*type */, const CSSParserToken& token)
+void MediaQueryParser::skipUntilBlockEnd(CSSParserTokenType /*type */, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
 {
     if (token.getBlockType() == CSSParserToken::BlockEnd && !m_blockWatcher.blockLevel())
         m_state = SkipUntilComma;
 }
 
-void MediaQueryParser::done(CSSParserTokenType /*type*/, const CSSParserToken& /*token*/) { }
+void MediaQueryParser::done(CSSParserTokenType /*type*/, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/) { }
 
 void MediaQueryParser::handleBlocks(const CSSParserToken& token)
 {
@@ -233,27 +237,30 @@ void MediaQueryParser::handleBlocks(const CSSParserToken& token)
             m_state = SkipUntilBlockEnd;
 }
 
-void MediaQueryParser::processToken(const CSSParserToken& token)
+void MediaQueryParser::processToken(const CSSParserToken& token, CSSParserTokenRange& range)
 {
     CSSParserTokenType type = token.type();
 
-    handleBlocks(token);
-    m_blockWatcher.handleToken(token);
+    if (m_state != ReadFeatureValue || type == WhitespaceToken) {
+        handleBlocks(token);
+        m_blockWatcher.handleToken(token);
+        range.consume();
+    }
 
     // Call the function that handles current state
     if (type != WhitespaceToken)
-        ((this)->*(m_state))(type, token);
+        ((this)->*(m_state))(type, token, range);
 }
 
 // The state machine loop
 RefPtr<MediaQuerySet> MediaQueryParser::parseInternal(CSSParserTokenRange range)
 {
     while (!range.atEnd())
-        processToken(range.consume());
+        processToken(range.peek(), range);
 
     // FIXME: Can we get rid of this special case?
     if (m_parserType == MediaQuerySetParser)
-        processToken(CSSParserToken(EOFToken));
+        processToken(CSSParserToken(EOFToken), range);
 
     if (m_state != ReadAnd && m_state != ReadRestrictor && m_state != Done && m_state != ReadMediaNot) {
         MediaQuery query = MediaQuery(MediaQuery::Not, "all", Vector<MediaQueryExpression>());
@@ -277,28 +284,23 @@ void MediaQueryData::clear()
     m_mediaType = "all";
     m_mediaTypeSet = false;
     m_mediaFeature = String();
-    m_valueList.clear();
     m_expressions.clear();
 }
 
-bool MediaQueryData::addExpression()
+void MediaQueryData::addExpression(CSSParserTokenRange& range)
 {
-    MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, m_valueList);
-    bool isValid = expression.isValid();
+    MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, range);
     m_expressions.append(WTFMove(expression));
-    m_valueList.clear();
-    return isValid;
 }
 
-bool MediaQueryData::tryAddParserToken(CSSParserTokenType type, const CSSParserToken& token)
+bool MediaQueryData::lastExpressionValid()
 {
-    if (type == NumberToken || type == PercentageToken || type == DimensionToken
-        || type == DelimiterToken || type == IdentToken) {
-        m_valueList.append(token);
-        return true;
-    }
+    return m_expressions.last().isValid();
+}
 
-    return false;
+void MediaQueryData::removeLastExpression()
+{
+    m_expressions.removeLast();
 }
 
 void MediaQueryData::setMediaType(const String& mediaType)
index af03989..4bbdf2b 100644 (file)
@@ -45,8 +45,9 @@ class MediaQueryData {
 public:
     MediaQueryData();
     void clear();
-    bool addExpression();
-    bool tryAddParserToken(CSSParserTokenType, const CSSParserToken&);
+    void addExpression(CSSParserTokenRange&);
+    bool lastExpressionValid();
+    void removeLastExpression();
     void setMediaType(const String&);
     
     MediaQuery::Restrictor restrictor() const { return m_restrictor; };
@@ -68,7 +69,6 @@ private:
     String m_mediaType;
     Vector<MediaQueryExpression> m_expressions;
     String m_mediaFeature;
-    Vector<CSSParserToken, 4> m_valueList;
     bool m_mediaTypeSet;
 };
 
@@ -90,22 +90,22 @@ private:
 
     RefPtr<MediaQuerySet> parseInternal(CSSParserTokenRange);
 
-    void processToken(const CSSParserToken&);
-
-    void readRestrictor(CSSParserTokenType, const CSSParserToken&);
-    void readMediaNot(CSSParserTokenType, const CSSParserToken&);
-    void readMediaType(CSSParserTokenType, const CSSParserToken&);
-    void readAnd(CSSParserTokenType, const CSSParserToken&);
-    void readFeatureStart(CSSParserTokenType, const CSSParserToken&);
-    void readFeature(CSSParserTokenType, const CSSParserToken&);
-    void readFeatureColon(CSSParserTokenType, const CSSParserToken&);
-    void readFeatureValue(CSSParserTokenType, const CSSParserToken&);
-    void readFeatureEnd(CSSParserTokenType, const CSSParserToken&);
-    void skipUntilComma(CSSParserTokenType, const CSSParserToken&);
-    void skipUntilBlockEnd(CSSParserTokenType, const CSSParserToken&);
-    void done(CSSParserTokenType, const CSSParserToken&);
-
-    using State = void (MediaQueryParser::*)(CSSParserTokenType, const CSSParserToken&);
+    void processToken(const CSSParserToken&, CSSParserTokenRange&);
+
+    void readRestrictor(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readMediaNot(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readMediaType(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readAnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readFeatureStart(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readFeature(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readFeatureColon(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readFeatureValue(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void readFeatureEnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void skipUntilComma(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void skipUntilBlockEnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+    void done(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
+
+    using State = void (MediaQueryParser::*)(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
 
     void setStateAndRestrict(State, MediaQuery::Restrictor);
     void handleBlocks(const CSSParserToken&);