Changeset 227295 in webkit


Ignore:
Timestamp:
Jan 22, 2018 8:07:13 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Parse calc() in CSS media queries
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:
Location:
trunk
Files:
57 added
1 deleted
21 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r227280 r227295  
     12018-01-22  Chris Nardi  <csnardi1@gmail.com>
     2
     3        Parse calc() in CSS media queries
     4        https://bugs.webkit.org/show_bug.cgi?id=181716
     5
     6        Imported CSS mediaqueries tests from WPT, deleting our (old) copy of one test. Updated
     7        expectations.
     8
     9        Reviewed by Antti Koivisto.
     10
     11        * TestExpectations:
     12        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
     13        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
     14        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
     15        * fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:
     16        * fast/media/w3c/README: Removed.
     17        * fast/media/w3c/test_media_queries-expected.txt: Removed.
     18        * platform/ios/TestExpectations:
     19        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt:
     20        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt:
     21        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt:
     22        * platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt:
     23
    1242018-01-19  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/LayoutTests/TestExpectations

    r227264 r227295  
    517517imported/w3c/web-platform-tests/css/selectors4/selector-read-write-type-change-002.html [ ImageOnlyFailure ]
    518518imported/w3c/web-platform-tests/css/selectors4/selector-required-type-change-002.html [ ImageOnlyFailure ]
     519
     520# https://github.com/w3c/web-platform-tests/issues/8547
     521imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html [ Skip ]
     522imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html [ Skip ]
     523
     524imported/w3c/web-platform-tests/css/mediaqueries/min-width-001.xht [ ImageOnlyFailure ]
     525webkit.org/b/156684 imported/w3c/web-platform-tests/css/mediaqueries/relative-units-001.html [ ImageOnlyFailure ]
     526webkit.org/b/156684 imported/w3c/web-platform-tests/css/mediaqueries/mq-calc-005.html [ ImageOnlyFailure ]
    519527
    520528# nth-child tests takes long time and Debug build sometimes timeouts because there are many test cases.
  • trunk/LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt

    r205905 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt

    r205905 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt

    r205905 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt

    r205905 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r227288 r227295  
     12018-01-22  Chris Nardi  <csnardi1@gmail.com>
     2
     3        Parse calc() in CSS media queries
     4        https://bugs.webkit.org/show_bug.cgi?id=181716
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * resources/import-expectations.json:
     9        * resources/resource-files.json:
     10        * web-platform-tests/css/mediaqueries/OWNERS: Added.
     11        * web-platform-tests/css/mediaqueries/aspect-ratio-001-expected.xht: Added.
     12        * web-platform-tests/css/mediaqueries/aspect-ratio-001.html: Added.
     13        * web-platform-tests/css/mediaqueries/aspect-ratio-002-expected.xht: Added.
     14        * web-platform-tests/css/mediaqueries/aspect-ratio-002.html: Added.
     15        * web-platform-tests/css/mediaqueries/aspect-ratio-003-expected.xht: Added.
     16        * web-platform-tests/css/mediaqueries/aspect-ratio-003.html: Added.
     17        * web-platform-tests/css/mediaqueries/aspect-ratio-004-expected.xht: Added.
     18        * web-platform-tests/css/mediaqueries/aspect-ratio-004.html: Added.
     19        * web-platform-tests/css/mediaqueries/device-aspect-ratio-001-expected.xht: Added.
     20        * web-platform-tests/css/mediaqueries/device-aspect-ratio-001.html: Added.
     21        * web-platform-tests/css/mediaqueries/device-aspect-ratio-002-expected.xht: Added.
     22        * web-platform-tests/css/mediaqueries/device-aspect-ratio-002.html: Added.
     23        * web-platform-tests/css/mediaqueries/device-aspect-ratio-003-expected.xht: Added.
     24        * web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html: Added.
     25        * web-platform-tests/css/mediaqueries/device-aspect-ratio-004-expected.xht: Added.
     26        * web-platform-tests/css/mediaqueries/device-aspect-ratio-004.html: Added.
     27        * web-platform-tests/css/mediaqueries/device-aspect-ratio-005-expected.xht: Added.
     28        * web-platform-tests/css/mediaqueries/device-aspect-ratio-005.html: Added.
     29        * web-platform-tests/css/mediaqueries/device-aspect-ratio-006-expected.xht: Added.
     30        * web-platform-tests/css/mediaqueries/device-aspect-ratio-006.html: Added.
     31        * web-platform-tests/css/mediaqueries/min-width-001-expected.xht: Added.
     32        * web-platform-tests/css/mediaqueries/min-width-001.xht: Added.
     33        * web-platform-tests/css/mediaqueries/min-width-tables-001-expected.xht: Added.
     34        * web-platform-tests/css/mediaqueries/min-width-tables-001.html: Added.
     35        * web-platform-tests/css/mediaqueries/mq-calc-001-expected.xht: Added.
     36        * web-platform-tests/css/mediaqueries/mq-calc-001.html: Added.
     37        * web-platform-tests/css/mediaqueries/mq-calc-002-expected.xht: Added.
     38        * web-platform-tests/css/mediaqueries/mq-calc-002.html: Added.
     39        * web-platform-tests/css/mediaqueries/mq-calc-003-expected.xht: Added.
     40        * web-platform-tests/css/mediaqueries/mq-calc-003.html: Added.
     41        * web-platform-tests/css/mediaqueries/mq-calc-004-expected.xht: Added.
     42        * web-platform-tests/css/mediaqueries/mq-calc-004.html: Added.
     43        * web-platform-tests/css/mediaqueries/mq-calc-005-expected.xht: Added.
     44        * web-platform-tests/css/mediaqueries/mq-calc-005.html: Added.
     45        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-001-expected.xht: Added.
     46        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-001.html: Added.
     47        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-002-expected.xht: Added.
     48        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-002.html: Added.
     49        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-003-expected.xht: Added.
     50        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-003.html: Added.
     51        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-004-expected.xht: Added.
     52        * web-platform-tests/css/mediaqueries/mq-invalid-media-type-004.html: Added.
     53        * web-platform-tests/css/mediaqueries/relative-units-001-expected.xht: Added.
     54        * web-platform-tests/css/mediaqueries/relative-units-001.html: Added.
     55        * web-platform-tests/css/mediaqueries/relative-units-002-expected.xht: Added.
     56        * web-platform-tests/css/mediaqueries/relative-units-002.html: Added.
     57        * web-platform-tests/css/mediaqueries/relative-units-003-expected.xht: Added.
     58        * web-platform-tests/css/mediaqueries/relative-units-003.html: Added.
     59        * web-platform-tests/css/mediaqueries/relative-units-004-expected.xht: Added.
     60        * web-platform-tests/css/mediaqueries/relative-units-004.html: Added.
     61        * web-platform-tests/css/mediaqueries/support/media_queries_iframe.html: Renamed from LayoutTests/fast/media/w3c/resources/media_queries_iframe.html.
     62        * web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html: Added.
     63        * web-platform-tests/css/mediaqueries/support/w3c-import.log: Added.
     64        * web-platform-tests/css/mediaqueries/test_media_queries-expected.txt: Renamed from LayoutTests/fast/media/w3c/test_media_queries-expected.txt.
     65        * web-platform-tests/css/mediaqueries/test_media_queries.html: Renamed from LayoutTests/fast/media/w3c/test_media_queries.html.
     66        * web-platform-tests/css/mediaqueries/w3c-import.log: Added.
     67
    1682018-01-22  Manuel Rego Casasnovas  <rego@igalia.com>
    269
  • trunk/LayoutTests/imported/w3c/resources/import-expectations.json

    r227054 r227295  
    6868    "web-platform-tests/css/css-ui-3": "import",
    6969    "web-platform-tests/css/geometry-1/": "import",
     70    "web-platform-tests/css/mediaqueries": "import",
    7071    "web-platform-tests/css/reference": "import",
    7172    "web-platform-tests/css/resources": "import",
  • trunk/LayoutTests/imported/w3c/resources/resource-files.json

    r225593 r227295  
    278278        "web-platform-tests/css/css-ui-3/text-overflow-018.html",
    279279        "web-platform-tests/css/css-ui-3/text-overflow-019.html",
     280        "web-platform-tests/css/mediaqueries/support/media_queries_iframe.html",
     281        "web-platform-tests/css/mediaqueries/support/min-width-tables-001-iframe.html",
    280282        "web-platform-tests/cssom-view/iframe.html",
    281283        "web-platform-tests/cssom/support/xmlss-pi.xhtml",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/support/media_queries_iframe.html

    r227294 r227295  
    55        <title>Media Queries Test inner frame</title>
    66        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    7         <link rel="author" title="L. David Baron" href="http://dbaron.org/">
    8         <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/">
     7        <link rel="author" title="L. David Baron" href="https://dbaron.org/">
    98        <meta http-equiv="Content-Style-Type" content="text/css">
    109        <style type="text/css" id="style" media="all">
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/test_media_queries.html

    r227294 r227295  
    33<head>
    44  <title>Media Queries Self-Contained Test Suite</title>
    5   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
     5  <link rel="author" title="L. David Baron" href="https://dbaron.org/">
    66  <link rel="author" title="Anne van Kesteren" href="http://annevankesteren.nl/">
    77  <link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
    88  <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/">
    9   <script type="text/javascript" src="../../../resources/testharness.js"></script>
    10   <script type="text/javascript" src="../../../resources/testharnessreport.js"></script>
     9  <script type="text/javascript" src="/resources/testharness.js"></script>
     10  <script type="text/javascript" src="/resources/testharnessreport.js"></script>
    1111</head>
    1212<body onload="run()">
    1313<div id=log></div>
    14 <iframe id="subdoc" src="resources/media_queries_iframe.html"></iframe>
     14<iframe id="subdoc" src="support/media_queries_iframe.html"></iframe>
    1515<div id="content" style="display: none"></div>
    1616
    1717<script type="text/javascript">
    1818setup({ "explicit_done": true });
    19 
    20 function assert_false_wrapper(fnc) {
    21     try {
    22       assert_false(fnc);
    23     } catch (e) {
    24       throw {message: e.message, stack: undefined};
    25     }
    26 }
    27 
    28 function assert_true_wrapper(fnc) {
    29     try {
    30       assert_true(fnc);
    31     } catch (e) {
    32       throw {message: e.message, stack: undefined};
    33     }
    34 }
    35 
    3619
    3720function run() {
     
    4124    var iframe_style = document.getElementById("subdoc").style;
    4225    var body_cs = subdoc.defaultView.getComputedStyle(subdoc.body, "");
     26    var testNum = 0;
    4327
    4428    function query_applies(q) {
    4529      style.setAttribute("media", q);
    46       return body_cs.getPropertyValue("text-decoration") == "underline";
    47     }
    48 
    49     function should_apply(q, message) {
    50       test(function() {
    51         assert_true_wrapper(query_applies(q));
    52       }, (message !== undefined ? message : q) + " should apply");
    53     }
    54 
    55     function should_not_apply(q, message) {
    56       test(function() {
    57         assert_false_wrapper(query_applies(q));
    58       }, (message !== undefined ? message : q) + " should not apply");
     30      return body_cs.getPropertyValue("text-decoration-line") == "underline";
     31    }
     32
     33    function should_apply(q) {
     34      test(function() {
     35        assert_true(query_applies(q));
     36      }, "subtest_" + ++testNum, {assert: q + " should apply"});
     37    }
     38
     39    function should_not_apply(q) {
     40      test(function() {
     41        assert_false(query_applies(q));
     42      }, "subtest_" + ++testNum, {assert: q + " should not apply"});
    5943    }
    6044
     
    8468    function query_should_be_parseable(q) {
    8569      test(function() {
    86         assert_true_wrapper(query_is_parseable(q))
    87       },"query " + q + " should be parseable");
     70        assert_true(query_is_parseable(q))
     71      }, "subtest_" + ++testNum, {assert: "query " + q + " should be parseable"});
    8872    }
    8973
    9074    function query_should_not_be_parseable(q) {
    9175      test(function() {
    92         assert_false_wrapper(query_is_parseable(q))
    93       },"query " + q + " should not be parseable");
     76        assert_false(query_is_parseable(q))
     77      }, "subtest_" + ++testNum, {assert: "query " + q + " should not be parseable"});
    9478    }
    9579
     
    10488    function expression_should_be_parseable(e) {
    10589      test(function() {
    106         assert_true_wrapper(expression_is_parseable(e));
    107       },"expression " + e + " should be parseable");
     90        assert_true(expression_is_parseable(e));
     91      }, "subtest_" + ++testNum, {assert: "expression " + e + " should be parseable"});
    10892    }
    10993
    11094    function expression_should_not_be_parseable(e) {
    11195      test(function() {
    112         assert_false_wrapper(expression_is_parseable(e));
    113       },"expression " + e + " should not be parseable");
     96        assert_false(expression_is_parseable(e));
     97      }, "subtest_" + ++testNum, {assert: "expression " + e + " should not be parseable"});
    11498    }
    11599
     
    120104    query_should_be_parseable("all and (orientation)");
    121105    query_should_be_parseable("not all and (orientation)");
    122     query_should_be_parseable("only all and (orientation)")
    123     query_should_not_be_parseable("(orientation: 'landscape')");
     106    query_should_be_parseable("only all and (orientation)");
    124107
    125108    var features = [ "width", "height", "device-width", "device-height" ];
     
    140123      expression_should_be_parseable(feature + ": 100000px");
    141124      expression_should_not_be_parseable(feature + ": -1px");
    142       expression_should_not_be_parseable(feature + ": '20px'");
    143125      expression_should_not_be_parseable("min-" + feature + ": -1px");
    144126      expression_should_not_be_parseable("max-" + feature + ": -1px");
    145       expression_should_not_be_parseable("min-" + feature + ": '10px'");
    146       expression_should_not_be_parseable("max-" + feature + ": '10px'");
    147127      expression_should_not_be_parseable(feature + ": -0.00001mm");
    148128      expression_should_not_be_parseable(feature + ": -100000em");
     
    169149    for (feature in features) {
    170150      var value = features[feature];
    171       should_apply("all and (" + feature + ": " + value + "px)", "all and (" + feature + ": " + feature + " px)");
    172       should_not_apply("all and (" + feature + ": " + (value + 1) + "px)", "all and (" + feature + ": " + feature + " +1 px)");
    173       should_not_apply("all and (" + feature + ": " + (value - 1) + "px)", "all and (" + feature + ": " + feature + " -1 px)");
    174       should_apply("all and (min-" + feature + ": " + value + "px)", "all and (min-" + feature + ": " + feature + " px)");
    175       should_not_apply("all and (min-" + feature + ": " + (value + 1) + "px)", "all and (min-" + feature + ": " + feature + " +1 px)");
    176       should_apply("all and (min-" + feature + ": " + (value - 1) + "px)", "all and (min-" + feature + ": " + feature + " -1 px)");
    177       should_apply("all and (max-" + feature + ": " + value + "px)", "all and (max-" + feature + ": " + feature + " px)");
    178       should_apply("all and (max-" + feature + ": " + (value + 1) + "px)", "all and (max-" + feature + ": " + feature + " +1 px)");
    179       should_not_apply("all and (max-" + feature + ": " + (value - 1) + "px)", "all and (max-" + feature + ": " + feature + " +1 px)");
     151      should_apply("all and (" + feature + ": " + value + "px)");
     152      should_not_apply("all and (" + feature + ": " + (value + 1) + "px)");
     153      should_not_apply("all and (" + feature + ": " + (value - 1) + "px)");
     154      should_apply("all and (min-" + feature + ": " + value + "px)");
     155      should_not_apply("all and (min-" + feature + ": " + (value + 1) + "px)");
     156      should_apply("all and (min-" + feature + ": " + (value - 1) + "px)");
     157      should_apply("all and (max-" + feature + ": " + value + "px)");
     158      should_apply("all and (max-" + feature + ": " + (value + 1) + "px)");
     159      should_not_apply("all and (max-" + feature + ": " + (value - 1) + "px)");
    180160      should_not_apply("all and (min-" + feature + ": " +
    181                        (Math.ceil(value/em_size) + 1) + "em)", "all and (min-" + feature + ": " + feature + " +1 em)");
     161                       (Math.ceil(value/em_size) + 1) + "em)");
    182162      should_apply("all and (min-" + feature + ": " +
    183                    (Math.floor(value/em_size) - 1) + "em)", "all and (min-" + feature + ": " + feature + " -1 em)");
     163                   (Math.floor(value/em_size) - 1) + "em)");
    184164      should_apply("all and (max-" + feature + ": " +
    185                    (Math.ceil(value/em_size) + 1) + "em)", "all and (max-" + feature + ": " + feature + " +1 em)");
     165                   (Math.ceil(value/em_size) + 1) + "em)");
    186166      should_not_apply("all and (max-" + feature + ": " +
    187                        (Math.floor(value/em_size) - 1) + "em)", "all and (max-" + feature + ": " + feature + " -1 em)");
     167                       (Math.floor(value/em_size) - 1) + "em)");
    188168    }
    189169
     
    259239    var low_dar_1 = (device_width - 1) + "/" + device_height;
    260240    var low_dar_2 = device_width + "/" + (device_height + 1);
    261     should_apply("(device-aspect-ratio: " + real_dar + ")", "(device-aspect-ratio: device-width / device-height)");
    262     should_apply("not all and (device-aspect-ratio: " + high_dar_1 + ")", "not all and (device-aspect-ratio: device-width + 1 / device-height)");
    263     should_not_apply("all and (device-aspect-ratio: " + high_dar_2 + ")", "all and (device-aspect-ratio: device-width / device-height - 1)");
    264     should_not_apply("all and (device-aspect-ratio: " + low_dar_1 + ")", "all and (device-aspect-ratio: device-width - 1 / device-height)");
    265     should_apply("not all and (device-aspect-ratio: " + low_dar_2 + ")", "not all and (device-aspect-ratio: device-width / device-height + 1)");
     241    should_apply("(device-aspect-ratio: " + real_dar + ")");
     242    should_apply("not all and (device-aspect-ratio: " + high_dar_1 + ")");
     243    should_not_apply("all and (device-aspect-ratio: " + high_dar_2 + ")");
     244    should_not_apply("all and (device-aspect-ratio: " + low_dar_1 + ")");
     245    should_apply("not all and (device-aspect-ratio: " + low_dar_2 + ")");
    266246    should_apply("(device-aspect-ratio)");
    267247
    268     should_apply("(min-device-aspect-ratio: " + real_dar + ")", "(min-device-aspect-ratio: device-width / device-height)");
    269     should_not_apply("all and (min-device-aspect-ratio: " + high_dar_1 + ")", "not all and (device-aspect-ratio: device-width + 1 / device-height)");
    270     should_apply("not all and (min-device-aspect-ratio: " + high_dar_2 + ")", "not all and (min-device-aspect-ratio: device-width / device-height - 1)");
    271     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)" );
    272     should_apply("all and (min-device-aspect-ratio: " + low_dar_2 + ")", "all and (min-device-aspect-ratio: device-width / device-height + 1)");
     248    should_apply("(min-device-aspect-ratio: " + real_dar + ")");
     249    should_not_apply("all and (min-device-aspect-ratio: " + high_dar_1 + ")");
     250    should_apply("not all and (min-device-aspect-ratio: " + high_dar_2 + ")");
     251    should_not_apply("not all and (min-device-aspect-ratio: " + low_dar_1 + ")");
     252    should_apply("all and (min-device-aspect-ratio: " + low_dar_2 + ")");
    273253    expression_should_not_be_parseable("min-device-aspect-ratio");
    274254
    275     should_apply("all and (max-device-aspect-ratio: " + real_dar + ")", "all and (max-device-aspect-ratio: device-width / device-height)");
    276     should_apply("(max-device-aspect-ratio: " + high_dar_1 + ")", "(max-device-aspect-ratio: device-width + 1 / device-height)");
    277     should_apply("(max-device-aspect-ratio: " + high_dar_2 + ")", "(max-device-aspect-ratio: device-width / device-height - 1");
    278     should_not_apply("all and (max-device-aspect-ratio: " + low_dar_1 + ")", "all and (max-device-aspect-ratio: device-width - 1 / device-height)");
    279     should_apply("not all and (max-device-aspect-ratio: " + low_dar_2 + ")", "not all and (max-device-aspect-ratio: device-width / device-height + 1)");
     255    should_apply("all and (max-device-aspect-ratio: " + real_dar + ")");
     256    should_apply("(max-device-aspect-ratio: " + high_dar_1 + ")");
     257    should_apply("(max-device-aspect-ratio: " + high_dar_2 + ")");
     258    should_not_apply("all and (max-device-aspect-ratio: " + low_dar_1 + ")");
     259    should_apply("not all and (max-device-aspect-ratio: " + low_dar_2 + ")");
    280260    expression_should_not_be_parseable("max-device-aspect-ratio");
    281261
     
    302282    var is_monochrome = query_applies("all and (min-monochrome: 1)");
    303283    var is_color = query_applies("all and (min-color: 1)");
    304     var colorString = is_color ? "color" : "monochrome";
    305284    test(function() {
    306285      assert_not_equals(is_monochrome, is_color, "should be either monochrome or color");
     
    308287
    309288    function depth_query(prefix, depth) {
    310       return "all and (" + prefix + colorString +
     289      return "all and (" + prefix + (is_color ? "color" : "monochrome") +
    311290             ":" + depth + ")";
    312291    }
     
    319298    } while (query_applies(depth_query("min-", ++depth)));
    320299    test(function() {
    321       assert_false_wrapper(50 < depth);
     300      assert_false(50 < depth);
    322301    }, "find_depth");
    323302    --depth;
    324303
    325     should_apply(depth_query("", depth), "all and (" + colorString + ": depth)");
    326     should_not_apply(depth_query("", depth - 1), "all and (" + colorString + ": depth - 1)");
    327     should_not_apply(depth_query("", depth + 1), "all and (" + colorString + ": depth + 1)");
    328     should_apply(depth_query("max-", depth), "all and (max-" + colorString + ": depth)");
    329     should_not_apply(depth_query("max-", depth - 1), "all and (max-" + colorString + ": depth - 1)");
    330     should_apply(depth_query("max-", depth + 1), "all and (max-" + colorString + ": depth + 1)");
     304    should_apply(depth_query("", depth));
     305    should_not_apply(depth_query("", depth - 1));
     306    should_not_apply(depth_query("", depth + 1));
     307    should_apply(depth_query("max-", depth));
     308    should_not_apply(depth_query("max-", depth - 1));
     309    should_apply(depth_query("max-", depth + 1));
    331310
    332311    (is_color ? should_apply : should_not_apply)("all and (color)");
     
    341320    (is_color ? should_not_apply : should_apply)("only all and (monochrome)");
    342321
    343     features = [ "color", "min-monochrome" ];
     322    features = [ "color", "min-monochrome", "max-color-index" ];
    344323    for (i in features) {
    345324      feature = features[i];
     
    352331    }
    353332
     333    // Presume that we never support indexed color (at least not usefully
     334    // enough to call it indexed color).
     335    should_apply("(color-index: 0)");
     336    should_not_apply("(color-index: 1)");
     337    should_apply("(min-color-index: 0)");
     338    should_not_apply("(min-color-index: 1)");
     339    should_apply("(max-color-index: 0)");
     340    should_apply("(max-color-index: 1)");
     341    should_apply("(max-color-index: 157)");
     342
     343    features = [ "resolution", "min-resolution", "max-resolution" ];
     344    for (i in features) {
     345      feature = features[i];
     346      expression_should_be_parseable(feature + ": 3dpi");
     347      expression_should_be_parseable(feature + ":3dpi");
     348      expression_should_be_parseable(feature + ": 3.0dpi");
     349      expression_should_be_parseable(feature + ": 3.4dpi");
     350      expression_should_be_parseable(feature + "\t: 120dpcm");
     351      expression_should_not_be_parseable(feature + ": 0dpi");
     352      expression_should_not_be_parseable(feature + ": -3dpi");
     353    }
     354
    354355    // Find the resolution using max-resolution
    355356    var resolution = 0;
    356     var max_resolution = 1000;
    357 
    358     if (query_applies("(resolution)")) {
    359         do {
    360           ++resolution;
    361           if (resolution > max_resolution) {
    362             break;
    363           }
    364         } while (!query_applies("(max-resolution: " + resolution + "dpi)"));
    365     } else {
    366         resolution = max_resolution + 1;
    367     }
    368 
     357    do {
     358      ++resolution;
     359      if (resolution > 10000) {
     360        break;
     361      }
     362    } while (!query_applies("(max-resolution: " + resolution + "dpi)"));
    369363    test(function() {
    370       assert_false_wrapper(max_resolution < resolution);
     364      assert_false(10000 < resolution);
    371365    }, "find_resolution");
    372366
     
    374368    var dpi_high;
    375369    var dpi_low = resolution - 1;
    376     var dpi_low_str = "dpi - 1";
    377     var dpi_high_str = "dpi + 1";
    378370    if (query_applies("(min-resolution: " + resolution + "dpi)")) {
    379371      // It's exact!
    380       should_apply("(resolution: " + resolution + "dpi)", "(resolution: dpi)");
    381       should_not_apply("(resolution: " + (resolution + 1) + "dpi)", "(resolution: dpi + 1)");
    382       should_not_apply("(resolution: " + (resolution - 1) + "dpi)", "(resolution: dpi - 1)");
     372      should_apply("(resolution: " + resolution + "dpi)");
     373      should_not_apply("(resolution: " + (resolution + 1) + "dpi)");
     374      should_not_apply("(resolution: " + (resolution - 1) + "dpi)");
    383375      dpi_high = resolution + 1;
    384376    } else {
    385377          // We have no way to test resolution applying since it need not be
    386378          // an integer.
    387       should_not_apply("(resolution: " + resolution + "dpi)", "(resolution: dpi)");
    388       should_not_apply("(resolution: " + (resolution - 1) + "dpi)", "(resolution: dpi + 1)");
     379      should_not_apply("(resolution: " + resolution + "dpi)");
     380      should_not_apply("(resolution: " + (resolution - 1) + "dpi)");
    389381      dpi_high = resolution;
    390382    }
    391383
    392     should_apply("(min-resolution: " + dpi_low + "dpi)", "(min-resolution: " + dpi_low_str + " )");
    393     should_not_apply("not all and (min-resolution: " + dpi_low + "dpi)", "not all and (min-resolution: " + dpi_low_str + " )");
    394     should_apply("not all and (min-resolution: " + dpi_high + "dpi)", "not all and (min-resolution: " + dpi_high_str + " )");
    395     should_not_apply("all and (min-resolution: " + dpi_high + "dpi)", "all and (min-resolution: " + dpi_high_str + " )");
     384    should_apply("(min-resolution: " + dpi_low + "dpi)");
     385    should_not_apply("not all and (min-resolution: " + dpi_low + "dpi)");
     386    should_apply("not all and (min-resolution: " + dpi_high + "dpi)");
     387    should_not_apply("all and (min-resolution: " + dpi_high + "dpi)");
    396388
    397389    // Test dpcm units based on what we computed in dpi.
    398390    var dpcm_high = Math.ceil(dpi_high / 2.54);
    399391    var dpcm_low = Math.floor(dpi_low / 2.54);
    400     should_apply("(min-resolution: " + dpcm_low + "dpcm)", "(min-resolution: dpcm (" + dpi_low_str + ") )");
    401     should_apply("(max-resolution: " + dpcm_high + "dpcm)", "(max-resolution: dpcm  (" + dpi_high_str + ") )");
    402     should_not_apply("(max-resolution: " + dpcm_low + "dpcm)", "(max-resolution: dpcm  (" + dpi_low_str + ") )");
    403     should_apply("not all and (min-resolution: " + dpcm_high + "dpcm)", "not all and (min-resolution: dpcm  (" + dpi_high_str + ") )");
     392    should_apply("(min-resolution: " + dpcm_low + "dpcm)");
     393    should_apply("(max-resolution: " + dpcm_high + "dpcm)");
     394    should_not_apply("(max-resolution: " + dpcm_low + "dpcm)");
     395    should_apply("not all and (min-resolution: " + dpcm_high + "dpcm)");
     396
     397    expression_should_be_parseable("scan");
     398    expression_should_be_parseable("scan: progressive");
     399    expression_should_be_parseable("scan:interlace");
     400    expression_should_not_be_parseable("min-scan:interlace");
     401    expression_should_not_be_parseable("scan: 1");
     402    expression_should_not_be_parseable("max-scan");
     403    expression_should_not_be_parseable("max-scan: progressive");
     404    // Assume we don't support tv devices.
     405    should_not_apply("(scan)");
     406    should_not_apply("(scan: progressive)");
     407    should_not_apply("(scan: interlace)");
     408    should_apply("not all and (scan)");
     409    should_apply("not all and (scan: progressive)");
     410    should_apply("not all and (scan: interlace)");
    404411
    405412    expression_should_be_parseable("grid");
     
    420427    should_not_apply("(grid: -1)");
    421428
     429    // Parsing tests
     430    // bug 454227
     431    should_apply("(orientation");
     432    should_not_apply("not all and (orientation");
     433    should_not_apply("(orientation:");
     434    should_apply("all,(orientation:");
     435    should_not_apply("(orientation:,all");
     436    should_apply("not all and (grid");
     437    should_not_apply("only all and (grid");
     438    should_not_apply("(grid");
     439    should_apply("all,(grid");
     440    should_not_apply("(grid,all");
     441    // bug 454226
     442    should_apply(",all");
     443    should_apply("all,");
     444    should_apply(",all,");
     445    should_apply("all,badmedium");
     446    should_apply("badmedium,all");
     447    should_not_apply(",badmedium,");
     448    should_apply("all,(badexpression)");
     449    should_apply("(badexpression),all");
     450    should_not_apply("(badexpression),badmedium");
     451    should_not_apply("badmedium,(badexpression)");
     452    should_apply("all,[badsyntax]");
     453    should_apply("[badsyntax],all");
     454    should_not_apply("badmedium,[badsyntax]");
     455    should_not_apply("[badsyntax],badmedium");
     456
     457    // Parsing tests based on Acid3
     458    query_should_not_be_parseable("all and color :");
     459    query_should_not_be_parseable("all and color : 1");
     460    should_not_apply("all and min-color : 1");
     461    should_not_apply("(bogus)");
     462    should_not_apply("not all and (bogus)")
     463    should_not_apply("only all and (bogus)")
     464
    422465    done();
    423466}
  • trunk/LayoutTests/platform/ios/TestExpectations

    r227272 r227295  
    30253025webkit.org/b/175353 imported/w3c/web-platform-tests/css/css-ui-3/outline-style-014.html [ ImageOnlyFailure ]
    30263026
     3027imported/w3c/web-platform-tests/css/mediaqueries/device-aspect-ratio-003.html [ ImageOnlyFailure ]
     3028
    30273029webkit.org/b/170698 [ Release ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors.html [ Pass Failure ]
    30283030
  • trunk/LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-1-expected.txt

    r205911 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-2-expected.txt

    r205911 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-3-expected.txt

    r205911 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/LayoutTests/platform/ios/fast/dom/HTMLImageElement/sizes/image-sizes-w3c-4-expected.txt

    r205911 r227295  
    3939PASS "green-1x1.png" is "green-1x1.png"
    4040PASS "green-1x1.png" is "green-1x1.png"
    41 FAIL "green-16x16.png" should be green-1x1.png. Was green-16x16.png.
     41PASS "green-1x1.png" is "green-1x1.png"
    4242PASS "green-1x1.png" is "green-1x1.png"
    4343PASS "green-1x1.png" is "green-1x1.png"
  • trunk/Source/WebCore/ChangeLog

    r227292 r227295  
     12018-01-22  Chris Nardi  <csnardi1@gmail.com>
     2
     3        Parse calc() in CSS media queries
     4        https://bugs.webkit.org/show_bug.cgi?id=181716
     5
     6        calc() was previously unsupported inside of media queries. This change
     7        adds in support for parsing calc inside of media queries.
     8
     9        Reviewed by Antti Koivisto.
     10
     11        Tests: Imported web-platform-tests/css/mediaqueries
     12
     13        * css/MediaQueryExpression.cpp:
     14        (WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
     15        (WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
     16        (WebCore::featureWithValidPositiveLength): Ditto.
     17        (WebCore::featureExpectingPositiveInteger): Ditto.
     18        (WebCore::featureWithPositiveInteger): Ditto.
     19        (WebCore::featureWithPositiveNumber): Ditto.
     20        (WebCore::featureWithZeroOrOne): Ditto.
     21        (WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
     22        * css/MediaQueryExpression.h:
     23        * css/parser/CSSPropertyParserHelpers.cpp:
     24        (WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
     25        * css/parser/CSSPropertyParserHelpers.h:
     26        * css/parser/MediaQueryParser.cpp:
     27        (WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
     28        (WebCore::MediaQueryParser::readMediaNot): Ditto.
     29        (WebCore::MediaQueryParser::readMediaType): Ditto.
     30        (WebCore::MediaQueryParser::readAnd): Ditto.
     31        (WebCore::MediaQueryParser::readFeatureStart): Ditto.
     32        (WebCore::MediaQueryParser::readFeature): Ditto.
     33        (WebCore::MediaQueryParser::readFeatureColon): Ditto.
     34        (WebCore::MediaQueryParser::readFeatureValue): Ditto.
     35        (WebCore::MediaQueryParser::readFeatureEnd): Ditto.
     36        (WebCore::MediaQueryParser::skipUntilComma): Ditto.
     37        (WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
     38        (WebCore::MediaQueryParser::processToken): Ditto.
     39        (WebCore::MediaQueryParser::parseInternal): Ditto.
     40        (WebCore::MediaQueryData::clear): Removed reference to m_valueList
     41        (WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
     42        (WebCore::MediaQueryData::lastExpressionValid): New helper function.
     43        (WebCore::MediaQueryData::removeLastExpression): New helper function.
     44        * css/parser/MediaQueryParser.h:
     45
    1462018-01-22  Zan Dobersek  <zdobersek@igalia.com>
    247
  • trunk/Source/WebCore/css/MediaQueryExpression.cpp

    r225639 r227295  
    3030
    3131#include "CSSAspectRatioValue.h"
    32 #include "CSSParserToken.h"
    3332#include "CSSPrimitiveValue.h"
     33#include "CSSPropertyParserHelpers.h"
    3434#include "MediaFeatureNames.h"
    3535#include <wtf/text/TextStream.h>
     
    3838namespace WebCore {
    3939
    40 static inline bool featureWithValidIdent(const AtomicString& mediaFeature)
    41 {
     40static inline bool featureWithValidIdent(const AtomicString& mediaFeature, const CSSPrimitiveValue& value)
     41{
     42    if (value.primitiveType() != CSSPrimitiveValue::UnitType::CSS_IDENT)
     43        return false;
     44
    4245    return mediaFeature == MediaFeatureNames::orientation
    4346    || mediaFeature == MediaFeatureNames::colorGamut
     
    5356}
    5457
    55 static inline bool featureWithValidDensity(const String& mediaFeature, const CSSParserToken& token)
    56 {
    57     if (!CSSPrimitiveValue::isResolution(static_cast<CSSPrimitiveValue::UnitType>(token.unitType())) || token.numericValue() <= 0)
     58static inline bool featureWithValidDensity(const String& mediaFeature, const CSSPrimitiveValue& value)
     59{
     60    if (!value.isResolution() || value.doubleValue() <= 0)
    5861        return false;
    5962   
     
    6366}
    6467
    65 static inline bool featureWithValidPositiveLength(const String& mediaFeature, const CSSParserToken& token)
    66 {
    67     if (!(CSSPrimitiveValue::isLength(token.unitType()) || (token.type() == NumberToken && !token.numericValue())) || token.numericValue() < 0)
    68         return false;
    69    
     68static inline bool featureWithValidPositiveLength(const String& mediaFeature, const CSSPrimitiveValue& value)
     69{
     70    if (!(value.isLength() || (value.isNumber() && !value.doubleValue())) || value.doubleValue() < 0)
     71        return false;
    7072   
    7173    return mediaFeature == MediaFeatureNames::height
     
    8385}
    8486
    85 static inline bool featureWithPositiveInteger(const String& mediaFeature, const CSSParserToken& token)
    86 {
    87     if (token.numericValueType() != IntegerValueType || token.numericValue() < 0)
    88         return false;
    89    
     87static inline bool featureExpectingPositiveInteger(const String& mediaFeature)
     88{
    9089    return mediaFeature == MediaFeatureNames::color
    91     || mediaFeature == MediaFeatureNames:: maxColor
    92     || mediaFeature == MediaFeatureNames:: minColor
     90    || mediaFeature == MediaFeatureNames::maxColor
     91    || mediaFeature == MediaFeatureNames::minColor
    9392    || mediaFeature == MediaFeatureNames::colorIndex
    9493    || mediaFeature == MediaFeatureNames::maxColorIndex
     
    9998}
    10099
    101 static inline bool featureWithPositiveNumber(const String& mediaFeature, const CSSParserToken& token)
    102 {
    103     if (token.type() != NumberToken || token.numericValue() < 0)
     100static inline bool featureWithPositiveInteger(const String& mediaFeature, const CSSPrimitiveValue& value)
     101{
     102    if (!value.isNumber())
     103        return false;
     104    return featureExpectingPositiveInteger(mediaFeature);
     105}
     106
     107static inline bool featureWithPositiveNumber(const String& mediaFeature, const CSSPrimitiveValue& value)
     108{
     109    if (!value.isNumber())
    104110        return false;
    105111   
     
    113119}
    114120
    115 static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSParserToken& token)
    116 {
    117     if (token.numericValueType() != IntegerValueType || !(token.numericValue() == 1 || !token.numericValue()))
     121static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSPrimitiveValue& value)
     122{
     123    if (!value.isNumber() || !(value.doubleValue() == 1 || !value.doubleValue()))
    118124        return false;
    119125   
     
    163169}
    164170
    165 MediaQueryExpression::MediaQueryExpression(const String& feature, const Vector<CSSParserToken, 4>& tokenList)
     171inline RefPtr<CSSPrimitiveValue> consumeFirstValue(const String& mediaFeature, CSSParserTokenRange& range)
     172{
     173    if (auto value = CSSPropertyParserHelpers::consumeInteger(range, 0))
     174        return value;
     175
     176    if (!featureExpectingPositiveInteger(mediaFeature) && !isAspectRatioFeature(mediaFeature)) {
     177        if (auto value = CSSPropertyParserHelpers::consumeNumber(range, ValueRangeNonNegative))
     178            return value;
     179    }
     180
     181    if (auto value = CSSPropertyParserHelpers::consumeLength(range, HTMLStandardMode, ValueRangeNonNegative))
     182        return value;
     183
     184    if (auto value = CSSPropertyParserHelpers::consumeResolution(range))
     185        return value;
     186
     187    if (auto value = CSSPropertyParserHelpers::consumeIdent(range))
     188        return value;
     189
     190    return nullptr;
     191}
     192
     193MediaQueryExpression::MediaQueryExpression(const String& feature, CSSParserTokenRange& range)
    166194    : m_mediaFeature(feature.convertToASCIILowercase())
    167195    , m_isValid(false)
    168196{
     197    RefPtr<CSSPrimitiveValue> firstValue = consumeFirstValue(m_mediaFeature, range);
     198    if (!firstValue) {
     199        if (isFeatureValidWithoutValue(m_mediaFeature)) {
     200            // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
     201            m_isValid = true;
     202        }
     203        return;
     204    }
    169205    // Create value for media query expression that must have 1 or more values.
    170     if (!tokenList.size() && isFeatureValidWithoutValue(m_mediaFeature)) {
    171         // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
     206    if (isAspectRatioFeature(m_mediaFeature)) {
     207        if (!firstValue->isNumber() || !firstValue->doubleValue())
     208            return;
     209        if (!CSSPropertyParserHelpers::consumeSlashIncludingWhitespace(range))
     210            return;
     211        RefPtr<CSSPrimitiveValue> denominatorValue = CSSPropertyParserHelpers::consumePositiveInteger(range);
     212        if (!denominatorValue)
     213            return;
     214
     215        unsigned numerator = clampTo<unsigned>(firstValue->doubleValue());
     216        unsigned denominator = clampTo<unsigned>(denominatorValue->doubleValue());
     217        m_value = CSSAspectRatioValue::create(numerator, denominator);
    172218        m_isValid = true;
    173     } else if (tokenList.size() == 1) {
    174         CSSParserToken token = tokenList.first();
    175         if (token.type() == IdentToken) {
    176             CSSValueID ident = token.id();
    177             if (!featureWithValidIdent(m_mediaFeature))
    178                 return;
    179             m_value = CSSPrimitiveValue::createIdentifier(ident);
    180             m_isValid = true;
    181         } else if (token.type() == NumberToken || token.type() == PercentageToken || token.type() == DimensionToken) {
    182             // Check for numeric token types since it is only safe for these types to call numericValue.
    183             if (featureWithValidDensity(m_mediaFeature, token)
    184                 || featureWithValidPositiveLength(m_mediaFeature, token)) {
    185                 // Media features that must have non-negative <density>, ie. dppx, dpi or dpcm,
    186                 // or Media features that must have non-negative <length> or number value.
    187                 m_value = CSSPrimitiveValue::create(token.numericValue(), (CSSPrimitiveValue::UnitType) token.unitType());
    188                 m_isValid = true;
    189             } else if (featureWithPositiveInteger(m_mediaFeature, token)
    190                 || featureWithPositiveNumber(m_mediaFeature, token)
    191                 || featureWithZeroOrOne(m_mediaFeature, token)) {
    192                 // Media features that must have non-negative integer value,
    193                 // or media features that must have non-negative number value,
    194                 // or media features that must have (0|1) value.
    195                 m_value = CSSPrimitiveValue::create(token.numericValue(), CSSPrimitiveValue::UnitType::CSS_NUMBER);
    196                 m_isValid = true;
    197             }
    198         }
    199     } else if (tokenList.size() == 3 && isAspectRatioFeature(m_mediaFeature)) {
    200         // FIXME: <ratio> is supposed to allow whitespace around the '/'
    201         // Applicable to device-aspect-ratio and aspect-ratio.
    202         const CSSParserToken& numerator = tokenList[0];
    203         const CSSParserToken& delimiter = tokenList[1];
    204         const CSSParserToken& denominator = tokenList[2];
    205         if (delimiter.type() != DelimiterToken || delimiter.delimiter() != '/')
    206             return;
    207         if (numerator.type() != NumberToken || numerator.numericValue() <= 0 || numerator.numericValueType() != IntegerValueType)
    208             return;
    209         if (denominator.type() != NumberToken || denominator.numericValue() <= 0 || denominator.numericValueType() != IntegerValueType)
    210             return;
    211        
    212         m_value = CSSAspectRatioValue::create(numerator.numericValue(), denominator.numericValue());
     219        return;
     220    }
     221    if (featureWithPositiveInteger(m_mediaFeature, *firstValue) || featureWithPositiveNumber(m_mediaFeature, *firstValue)
     222        || featureWithZeroOrOne(m_mediaFeature, *firstValue) || featureWithValidDensity(m_mediaFeature, *firstValue)
     223        || featureWithValidPositiveLength(m_mediaFeature, *firstValue) || featureWithValidIdent(m_mediaFeature, *firstValue)) {
     224        m_value = firstValue;
    213225        m_isValid = true;
     226        return;
    214227    }
    215228}
  • trunk/Source/WebCore/css/MediaQueryExpression.h

    r220812 r227295  
    2828#pragma once
    2929
    30 #include "CSSParserToken.h"
     30#include "CSSParserTokenRange.h"
    3131#include "CSSValue.h"
    3232#include <memory>
     
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     explicit MediaQueryExpression(const String& mediaFeature, const Vector<CSSParserToken, 4>& tokenList);
     43    explicit MediaQueryExpression(const String& mediaFeature, CSSParserTokenRange&);
    4444
    4545    const AtomicString& mediaFeature() const;
  • trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

    r224165 r227295  
    404404            return calcParser.consumeValue();
    405405    }
     406    return nullptr;
     407}
     408
     409RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange& range)
     410{
     411    const CSSParserToken& token = range.peek();
     412    // Unlike the other types, calc() does not work with <resolution>.
     413    if (token.type() != DimensionToken)
     414        return nullptr;
     415    CSSPrimitiveValue::UnitType unit = token.unitType();
     416    if (unit == CSSPrimitiveValue::UnitType::CSS_DPPX || unit == CSSPrimitiveValue::UnitType::CSS_DPI || unit == CSSPrimitiveValue::UnitType::CSS_DPCM)
     417        return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().numericValue(), unit);
    406418    return nullptr;
    407419}
  • trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h

    r218588 r227295  
    6868RefPtr<CSSPrimitiveValue> consumeAngle(CSSParserTokenRange&, CSSParserMode, UnitlessQuirk = UnitlessQuirk::Forbid);
    6969RefPtr<CSSPrimitiveValue> consumeTime(CSSParserTokenRange&, CSSParserMode, ValueRange, UnitlessQuirk = UnitlessQuirk::Forbid);
     70RefPtr<CSSPrimitiveValue> consumeResolution(CSSParserTokenRange&);
    7071
    7172RefPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&);
  • trunk/Source/WebCore/css/parser/MediaQueryParser.cpp

    r223728 r227295  
    8484
    8585// State machine member functions start here
    86 void MediaQueryParser::readRestrictor(CSSParserTokenType type, const CSSParserToken& token)
    87 {
    88     readMediaType(type, token);
    89 }
    90 
    91 void MediaQueryParser::readMediaNot(CSSParserTokenType type, const CSSParserToken& token)
     86void MediaQueryParser::readRestrictor(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
     87{
     88    readMediaType(type, token, range);
     89}
     90
     91void MediaQueryParser::readMediaNot(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
    9292{
    9393    if (type == IdentToken && equalIgnoringASCIICase(token.value(), "not"))
    9494        setStateAndRestrict(ReadFeatureStart, MediaQuery::Not);
    9595    else
    96         readFeatureStart(type, token);
     96        readFeatureStart(type, token, range);
    9797}
    9898
     
    106106}
    107107
    108 void MediaQueryParser::readMediaType(CSSParserTokenType type, const CSSParserToken& token)
     108void MediaQueryParser::readMediaType(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
    109109{
    110110    if (type == LeftParenthesisToken) {
     
    130130        m_state = SkipUntilComma;
    131131        if (type == CommaToken)
    132             skipUntilComma(type, token);
     132            skipUntilComma(type, token, range);
    133133    }
    134134}
     
    143143}
    144144
    145 void MediaQueryParser::readAnd(CSSParserTokenType type, const CSSParserToken& token)
     145void MediaQueryParser::readAnd(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
    146146{
    147147    if (type == IdentToken && equalIgnoringASCIICase(token.value(), "and")) {
     
    156156}
    157157
    158 void MediaQueryParser::readFeatureStart(CSSParserTokenType type, const CSSParserToken& /*token*/)
     158void MediaQueryParser::readFeatureStart(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
    159159{
    160160    if (type == LeftParenthesisToken)
     
    164164}
    165165
    166 void MediaQueryParser::readFeature(CSSParserTokenType type, const CSSParserToken& token)
     166void MediaQueryParser::readFeature(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
    167167{
    168168    if (type == IdentToken) {
     
    173173}
    174174
    175 void MediaQueryParser::readFeatureColon(CSSParserTokenType type, const CSSParserToken& token)
    176 {
    177     if (type == ColonToken)
    178         m_state = ReadFeatureValue;
    179     else if (type == RightParenthesisToken || type == EOFToken)
    180         readFeatureEnd(type, token);
    181     else
     175void MediaQueryParser::readFeatureColon(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
     176{
     177    if (type == ColonToken) {
     178        while (range.peek().type() == WhitespaceToken)
     179            range.consume();
     180        if (range.peek().type() == RightParenthesisToken || range.peek().type() == EOFToken)
     181            m_state = SkipUntilBlockEnd;
     182        else
     183            m_state = ReadFeatureValue;
     184    } else if (type == RightParenthesisToken || type == EOFToken) {
     185        m_mediaQueryData.addExpression(range);
     186        readFeatureEnd(type, token, range);
     187    } else
    182188        m_state = SkipUntilBlockEnd;
    183189}
    184190
    185 void MediaQueryParser::readFeatureValue(CSSParserTokenType type, const CSSParserToken& token)
    186 {
    187     if (type == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::CSS_UNKNOWN)
    188         m_state = SkipUntilComma;
    189     else {
    190         if (m_mediaQueryData.tryAddParserToken(type, token))
    191             m_state = ReadFeatureEnd;
    192         else
    193             m_state = SkipUntilBlockEnd;
    194     }
    195 }
    196 
    197 void MediaQueryParser::readFeatureEnd(CSSParserTokenType type, const CSSParserToken& token)
     191void MediaQueryParser::readFeatureValue(CSSParserTokenType type, const CSSParserToken& token, CSSParserTokenRange& range)
     192{
     193    if (type == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::CSS_UNKNOWN) {
     194        range.consume();
     195        m_state = SkipUntilComma;
     196    } else {
     197        m_mediaQueryData.addExpression(range);
     198        m_state = ReadFeatureEnd;
     199    }
     200}
     201
     202void MediaQueryParser::readFeatureEnd(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
    198203{
    199204    if (type == RightParenthesisToken || type == EOFToken) {
    200         if (type != EOFToken && m_mediaQueryData.addExpression())
     205        if (type != EOFToken && m_mediaQueryData.lastExpressionValid())
    201206            m_state = ReadAnd;
    202207        else
    203208            m_state = SkipUntilComma;
    204     } else if (type == DelimiterToken && token.delimiter() == '/') {
    205         m_mediaQueryData.tryAddParserToken(type, token);
    206         m_state = ReadFeatureValue;
    207     } else
     209    } else {
     210        m_mediaQueryData.removeLastExpression();
    208211        m_state = SkipUntilBlockEnd;
    209 }
    210 
    211 void MediaQueryParser::skipUntilComma(CSSParserTokenType type, const CSSParserToken& /*token*/)
     212    }
     213}
     214
     215void MediaQueryParser::skipUntilComma(CSSParserTokenType type, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/)
    212216{
    213217    if ((type == CommaToken && !m_blockWatcher.blockLevel()) || type == EOFToken) {
     
    219223}
    220224
    221 void MediaQueryParser::skipUntilBlockEnd(CSSParserTokenType /*type */, const CSSParserToken& token)
     225void MediaQueryParser::skipUntilBlockEnd(CSSParserTokenType /*type */, const CSSParserToken& token, CSSParserTokenRange& /*range*/)
    222226{
    223227    if (token.getBlockType() == CSSParserToken::BlockEnd && !m_blockWatcher.blockLevel())
     
    225229}
    226230
    227 void MediaQueryParser::done(CSSParserTokenType /*type*/, const CSSParserToken& /*token*/) { }
     231void MediaQueryParser::done(CSSParserTokenType /*type*/, const CSSParserToken& /*token*/, CSSParserTokenRange& /*range*/) { }
    228232
    229233void MediaQueryParser::handleBlocks(const CSSParserToken& token)
     
    234238}
    235239
    236 void MediaQueryParser::processToken(const CSSParserToken& token)
     240void MediaQueryParser::processToken(const CSSParserToken& token, CSSParserTokenRange& range)
    237241{
    238242    CSSParserTokenType type = token.type();
    239243
    240     handleBlocks(token);
    241     m_blockWatcher.handleToken(token);
     244    if (m_state != ReadFeatureValue || type == WhitespaceToken) {
     245        handleBlocks(token);
     246        m_blockWatcher.handleToken(token);
     247        range.consume();
     248    }
    242249
    243250    // Call the function that handles current state
    244251    if (type != WhitespaceToken)
    245         ((this)->*(m_state))(type, token);
     252        ((this)->*(m_state))(type, token, range);
    246253}
    247254
     
    250257{
    251258    while (!range.atEnd())
    252         processToken(range.consume());
     259        processToken(range.peek(), range);
    253260
    254261    // FIXME: Can we get rid of this special case?
    255262    if (m_parserType == MediaQuerySetParser)
    256         processToken(CSSParserToken(EOFToken));
     263        processToken(CSSParserToken(EOFToken), range);
    257264
    258265    if (m_state != ReadAnd && m_state != ReadRestrictor && m_state != Done && m_state != ReadMediaNot) {
     
    278285    m_mediaTypeSet = false;
    279286    m_mediaFeature = String();
    280     m_valueList.clear();
    281287    m_expressions.clear();
    282288}
    283289
    284 bool MediaQueryData::addExpression()
    285 {
    286     MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, m_valueList);
    287     bool isValid = expression.isValid();
     290void MediaQueryData::addExpression(CSSParserTokenRange& range)
     291{
     292    MediaQueryExpression expression = MediaQueryExpression(m_mediaFeature, range);
    288293    m_expressions.append(WTFMove(expression));
    289     m_valueList.clear();
    290     return isValid;
    291 }
    292 
    293 bool MediaQueryData::tryAddParserToken(CSSParserTokenType type, const CSSParserToken& token)
    294 {
    295     if (type == NumberToken || type == PercentageToken || type == DimensionToken
    296         || type == DelimiterToken || type == IdentToken) {
    297         m_valueList.append(token);
    298         return true;
    299     }
    300 
    301     return false;
     294}
     295
     296bool MediaQueryData::lastExpressionValid()
     297{
     298    return m_expressions.last().isValid();
     299}
     300
     301void MediaQueryData::removeLastExpression()
     302{
     303    m_expressions.removeLast();
    302304}
    303305
  • trunk/Source/WebCore/css/parser/MediaQueryParser.h

    r218588 r227295  
    4646    MediaQueryData();
    4747    void clear();
    48     bool addExpression();
    49     bool tryAddParserToken(CSSParserTokenType, const CSSParserToken&);
     48    void addExpression(CSSParserTokenRange&);
     49    bool lastExpressionValid();
     50    void removeLastExpression();
    5051    void setMediaType(const String&);
    5152   
     
    6970    Vector<MediaQueryExpression> m_expressions;
    7071    String m_mediaFeature;
    71     Vector<CSSParserToken, 4> m_valueList;
    7272    bool m_mediaTypeSet;
    7373};
     
    9191    RefPtr<MediaQuerySet> parseInternal(CSSParserTokenRange);
    9292
    93     void processToken(const CSSParserToken&);
     93    void processToken(const CSSParserToken&, CSSParserTokenRange&);
    9494
    95     void readRestrictor(CSSParserTokenType, const CSSParserToken&);
    96     void readMediaNot(CSSParserTokenType, const CSSParserToken&);
    97     void readMediaType(CSSParserTokenType, const CSSParserToken&);
    98     void readAnd(CSSParserTokenType, const CSSParserToken&);
    99     void readFeatureStart(CSSParserTokenType, const CSSParserToken&);
    100     void readFeature(CSSParserTokenType, const CSSParserToken&);
    101     void readFeatureColon(CSSParserTokenType, const CSSParserToken&);
    102     void readFeatureValue(CSSParserTokenType, const CSSParserToken&);
    103     void readFeatureEnd(CSSParserTokenType, const CSSParserToken&);
    104     void skipUntilComma(CSSParserTokenType, const CSSParserToken&);
    105     void skipUntilBlockEnd(CSSParserTokenType, const CSSParserToken&);
    106     void done(CSSParserTokenType, const CSSParserToken&);
     95    void readRestrictor(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     96    void readMediaNot(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     97    void readMediaType(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     98    void readAnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     99    void readFeatureStart(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     100    void readFeature(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     101    void readFeatureColon(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     102    void readFeatureValue(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     103    void readFeatureEnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     104    void skipUntilComma(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     105    void skipUntilBlockEnd(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
     106    void done(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
    107107
    108     using State = void (MediaQueryParser::*)(CSSParserTokenType, const CSSParserToken&);
     108    using State = void (MediaQueryParser::*)(CSSParserTokenType, const CSSParserToken&, CSSParserTokenRange&);
    109109
    110110    void setStateAndRestrict(State, MediaQuery::Restrictor);
Note: See TracChangeset for help on using the changeset viewer.