Changeset 142149 in webkit


Ignore:
Timestamp:
Feb 7, 2013 10:21:12 AM (11 years ago)
Author:
mvujovic@adobe.com
Message:

[CSS Shaders] Add WebKitCSSFilterRule to DOMWindow.idl
https://bugs.webkit.org/show_bug.cgi?id=109082

Source/WebCore:

Reviewed by Dean Jackson.

Add an entry for WebKitCSSFilterRuleConstructor in DOMWindow.idl.

Tests: css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html

css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html

  • page/DOMWindow.idl:

LayoutTests:

Move the at-rule parsing tests to the recently added folder named
"custom-with-at-rule-parsing".

Remove the "custom-filter" prefix from the test filenames to
match the new convention.

Update the tests to use the "shouldHaveConstructor" JS helper function instead of the
"shouldBeType" JS helper function. Among other things, using "shouldHaveConstructor" tests
that window.WebKitCSSFilterRule is defined. "shouldHaveConstructor" has the same
behavior in JSC and V8, unlike "shouldBeType". Therefore, remove the Chromium-specific text
expectation file that was previously needed for "shouldBeType".

Reviewed by Dean Jackson.

  • css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid-expected.txt: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-invalid-expected.txt.
  • css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-invalid.html.
  • css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid-expected.txt: Added.
  • css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-valid.html.
  • css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-invalid.js: Renamed from LayoutTests/css3/filters/script-tests/custom-filter-parsing-at-rule-invalid.js.

(testInvalidFilterAtRule):

  • css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-valid.js: Renamed from LayoutTests/css3/filters/script-tests/custom-filter-parsing-at-rule-valid.js.

(testFilterAtRule):
(testNestedRules):
(checkRule):

  • css3/filters/custom/custom-filter-parsing-at-rule-valid-expected.txt: Removed.
  • platform/chromium/css3/filters/custom/custom-filter-parsing-at-rule-valid-expected.txt: Removed.
Location:
trunk
Files:
1 added
2 deleted
3 edited
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142148 r142149  
     12013-02-07  Max Vujovic  <mvujovic@adobe.com>
     2
     3        [CSS Shaders] Add WebKitCSSFilterRule to DOMWindow.idl
     4        https://bugs.webkit.org/show_bug.cgi?id=109082
     5
     6        Move the at-rule parsing tests to the recently added folder named
     7        "custom-with-at-rule-parsing".
     8
     9        Remove the "custom-filter" prefix from the test filenames to
     10        match the new convention.
     11
     12        Update the tests to use the "shouldHaveConstructor" JS helper function instead of the
     13        "shouldBeType" JS helper function. Among other things, using "shouldHaveConstructor" tests
     14        that window.WebKitCSSFilterRule is defined. "shouldHaveConstructor" has the same
     15        behavior in JSC and V8, unlike "shouldBeType". Therefore, remove the Chromium-specific text
     16        expectation file that was previously needed for "shouldBeType".
     17
     18        Reviewed by Dean Jackson.
     19
     20        * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid-expected.txt: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-invalid-expected.txt.
     21        * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-invalid.html.
     22        * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid-expected.txt: Added.
     23        * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html: Renamed from LayoutTests/css3/filters/custom/custom-filter-parsing-at-rule-valid.html.
     24        * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-invalid.js: Renamed from LayoutTests/css3/filters/script-tests/custom-filter-parsing-at-rule-invalid.js.
     25        (testInvalidFilterAtRule):
     26        * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-valid.js: Renamed from LayoutTests/css3/filters/script-tests/custom-filter-parsing-at-rule-valid.js.
     27        (testFilterAtRule):
     28        (testNestedRules):
     29        (checkRule):
     30        * css3/filters/custom/custom-filter-parsing-at-rule-valid-expected.txt: Removed.
     31        * platform/chromium/css3/filters/custom/custom-filter-parsing-at-rule-valid-expected.txt: Removed.
     32
    1332013-02-07  Vsevolod Vlasov  <vsevik@chromium.org>
    234
  • trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid-expected.txt

    r142148 r142149  
    55
    66
     7========================================
     8Filter at-rule symbol tests.
     9========================================
     10
    711Unprefixed rule.
    812@filter my-filter { }
    913PASS insertRuleException instanceof DOMException is true
    10 PASS insertRuleException.code is 12
     14PASS insertRuleException.code is DOMException.SYNTAX_ERR
     15
     16========================================
     17Filter name tests.
     18========================================
    1119
    1220Missing filter name identifier.
    1321@-webkit-filter { }
    1422PASS insertRuleException instanceof DOMException is true
    15 PASS insertRuleException.code is 12
     23PASS insertRuleException.code is DOMException.SYNTAX_ERR
    1624
    1725Filter name as string.
    1826@-webkit-filter 'my-filter' { }
    1927PASS insertRuleException instanceof DOMException is true
    20 PASS insertRuleException.code is 12
     28PASS insertRuleException.code is DOMException.SYNTAX_ERR
    2129
    2230Filter name as number.
    2331@-webkit-filter 123 { }
    2432PASS insertRuleException instanceof DOMException is true
    25 PASS insertRuleException.code is 12
     33PASS insertRuleException.code is DOMException.SYNTAX_ERR
     34
     35========================================
     36Filter at-rule body tests.
     37========================================
    2638
    2739Missing rule body.
    2840@-webkit-filter my-filter
    2941PASS insertRuleException instanceof DOMException is true
    30 PASS insertRuleException.code is 12
     42PASS insertRuleException.code is DOMException.SYNTAX_ERR
    3143
    3244Missing opening brace.
    3345@-webkit-filter my-filter }
    3446PASS insertRuleException instanceof DOMException is true
    35 PASS insertRuleException.code is 12
     47PASS insertRuleException.code is DOMException.SYNTAX_ERR
    3648
    3749Missing closing brace.
    3850@-webkit-filter my-filter {
    3951PASS insertRuleException instanceof DOMException is true
    40 PASS insertRuleException.code is 12
     52PASS insertRuleException.code is DOMException.SYNTAX_ERR
    4153PASS successfullyParsed is true
    4254
  • trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html

    r142148 r142149  
    99<div id="console"></div>
    1010<script src="../script-tests/custom-filter-parsing-common.js"></script>
    11 <script src="../script-tests/custom-filter-parsing-at-rule-valid.js"></script>
     11<script src="script-tests/parsing-at-rule-invalid.js"></script>
    1212<script src="../../../fast/js/resources/js-test-post.js"></script>
    1313</body>
  • trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html

    r142148 r142149  
    99<div id="console"></div>
    1010<script src="../script-tests/custom-filter-parsing-common.js"></script>
    11 <script src="../script-tests/custom-filter-parsing-at-rule-invalid.js"></script>
     11<script src="script-tests/parsing-at-rule-valid.js"></script>
    1212<script src="../../../fast/js/resources/js-test-post.js"></script>
    1313</body>
  • trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-invalid.js

    r142148 r142149  
    1616        insertRuleException = e;
    1717        shouldBeTrue("insertRuleException instanceof DOMException");
    18         shouldEvaluateTo("insertRuleException.code", DOMException.SYNTAX_ERR)
     18        shouldEvaluateTo("insertRuleException.code", "DOMException.SYNTAX_ERR")
    1919    }
    2020}
    2121
     22heading("Filter at-rule symbol tests.");
    2223testInvalidFilterAtRule("Unprefixed rule.", "@filter my-filter { }");
    2324
     25heading("Filter name tests.");
    2426testInvalidFilterAtRule("Missing filter name identifier.", "@-webkit-filter { }");
    2527testInvalidFilterAtRule("Filter name as string.", "@-webkit-filter 'my-filter' { }");
    2628testInvalidFilterAtRule("Filter name as number.", "@-webkit-filter 123 { }");
    2729
     30heading("Filter at-rule body tests.");
    2831testInvalidFilterAtRule("Missing rule body.", "@-webkit-filter my-filter");
    2932testInvalidFilterAtRule("Missing opening brace.", "@-webkit-filter my-filter }");
  • trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-valid.js

    r142148 r142149  
    1414    // Check the rule's text and type.
    1515    cssRule = stylesheet.cssRules.item(0);
    16     checkRule(expectedValue, CSSRule.WEBKIT_FILTER_RULE, "WebKitCSSFilterRule");
     16    checkRule(expectedValue, "CSSRule.WEBKIT_FILTER_RULE", "WebKitCSSFilterRule");
    1717
    1818    // Check the rule's CSSStyleDeclaration properties.
     
    3636
    3737    cssRule = stylesheet.cssRules.item(0);
    38     checkRule(parentExpectations.cssText, parentExpectations.ruleType, parentExpectations.jsType);
     38    checkRule(parentExpectations.cssText, parentExpectations.ruleType, parentExpectations.constructorName);
    3939
    4040    if (childExpectations) {
    4141        cssRule = cssRule.cssRules[0];
    42         checkRule(childExpectations.cssText, childExpectations.ruleType, childExpectations.jsType);
     42        checkRule(childExpectations.cssText, childExpectations.ruleType, childExpectations.constructorName);
    4343
    4444        for (var i = 0; i < cssRule.cssText.length; i++) {
     
    5050
    5151// Checks the global "cssRule" against some expected properties.
    52 function checkRule(expectedCSSText, expectedRuleType, expectedJSType)
     52function checkRule(expectedCSSText, expectedRuleType, expectedConstructorName)
    5353{
    5454    shouldBeEqualToString("cssRule.cssText", expectedCSSText);
    5555    shouldEvaluateTo("cssRule.type", expectedRuleType);
    56     shouldBeType("cssRule", expectedJSType);   
     56    shouldHaveConstructor("cssRule", expectedConstructorName);
    5757}
    5858
     59heading("Filter at-rule tests.");
    5960testFilterAtRule("Empty rule, separated by single spaces.",
    6061    "@-webkit-filter my-filter { }",
    6162    "@-webkit-filter my-filter { }");
    62 
    6363testFilterAtRule("Empty rule, separated by multiple spaces.",
    6464    "   @-webkit-filter   my-filter   {   }   ",
    6565    "@-webkit-filter my-filter { }");
    66 
    6766testFilterAtRule("Empty rule, no extra whitespace.",
    6867    "@-webkit-filter my-filter{}",
    6968    "@-webkit-filter my-filter { }");
    70 
    7169testFilterAtRule("Rule with arbitrary properties.",
    7270    "@-webkit-filter my-filter { width: 100px; height: 100px; }",
     
    7472    {width: "100px", height: "100px"});
    7573
     74heading("Nested filter at-rule tests.");
    7675testNestedRules("Nested rule.",
    7776    "@-webkit-filter parent-filter { @-webkit-filter child-filter { } }",
     
    7978        cssText: "@-webkit-filter parent-filter { }",
    8079        ruleType: CSSRule.WEBKIT_FILTER_RULE,
    81         jsType: "WebKitCSSFilterRule"
     80        constructorName: "WebKitCSSFilterRule"
    8281    });
    83 
    8482testNestedRules("Twice nested rule.",
    8583    "@-webkit-filter parent-filter { @-webkit-filter child-filter { @-webkit-filter grandchild-filter } }",
     
    8785        cssText: "@-webkit-filter parent-filter { }",
    8886        ruleType: CSSRule.WEBKIT_FILTER_RULE,
    89         jsType: "WebKitCSSFilterRule"
     87        constructorName: "WebKitCSSFilterRule"
    9088    });
    91 
    9289testNestedRules("Nested rule inside arbitrary rule.",
    9390    "@font-face { @-webkit-filter child-filter { } }",
     
    9592        cssText: "@font-face { }",
    9693        ruleType: CSSRule.FONT_FACE_RULE,
    97         jsType: "CSSFontFaceRule"
     94        constructorName: "CSSFontFaceRule"
    9895    });
    99 
    10096testNestedRules("Nested rule inside media query.",
    10197    "@media screen { @-webkit-filter child-filter { } }",
     
    10399        cssText: "@media screen { \n  @-webkit-filter child-filter { }\n}",
    104100        ruleType: CSSRule.MEDIA_RULE,
    105         jsType: "CSSMediaRule",
     101        constructorName: "CSSMediaRule",
    106102    },
    107103    {
    108104        cssText: "@-webkit-filter child-filter { }",
    109105        ruleType: CSSRule.WEBKIT_FILTER_RULE,
    110         jsType: "WebKitCSSFilterRule",
     106        constructorName: "WebKitCSSFilterRule",
    111107    });
  • trunk/Source/WebCore/ChangeLog

    r142148 r142149  
     12013-02-07  Max Vujovic  <mvujovic@adobe.com>
     2
     3        [CSS Shaders] Add WebKitCSSFilterRule to DOMWindow.idl
     4        https://bugs.webkit.org/show_bug.cgi?id=109082
     5
     6        Reviewed by Dean Jackson.
     7
     8        Add an entry for WebKitCSSFilterRuleConstructor in DOMWindow.idl.
     9
     10        Tests: css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html
     11               css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html
     12
     13        * page/DOMWindow.idl:
     14
    1152013-02-07  Vsevolod Vlasov  <vsevik@chromium.org>
    216
  • trunk/Source/WebCore/page/DOMWindow.idl

    r141578 r142149  
    336336
    337337#if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS
     338    attribute WebKitCSSFilterRuleConstructor WebKitCSSFilterRule;
    338339    attribute WebKitCSSMixFunctionValueConstructor WebKitCSSMixFunctionValue;
    339340#endif
Note: See TracChangeset for help on using the changeset viewer.