Skip to content

Commit

Permalink
Remove WEBKIT_KEYFRAMES_RULE and WEBKIT_KEYFRAME_RULE
Browse files Browse the repository at this point in the history
Remove WEBKIT_KEYFRAMES_RULE and WEBKIT_KEYFRAME_RULE
from CSSRule interface.

Intent to Remove thread:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/mW1njtgDPHA

BUG=689681
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2795223002
Cr-Commit-Position: refs/heads/master@{#466930}
  • Loading branch information
shanmuga-m authored and Commit bot committed Apr 25, 2017
1 parent da89e55 commit 0363d88
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ interface CSSRule
attribute PAGE_RULE
attribute STYLE_RULE
attribute SUPPORTS_RULE
attribute WEBKIT_KEYFRAMES_RULE
attribute WEBKIT_KEYFRAME_RULE
getter cssText
getter parentRule
getter parentStyleSheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ This test checks that the CSSRule RuleTypes for keyframe-related rules are what
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS ruleType is 7
PASS ruleType is 8
PASS ruleType is 7
PASS ruleType is 8
If we got to this point then we did not crash and the test has passed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Tests parsing the @-webkit-keyframes rule without closing brace. "User agents must close all open constructs ... at the end of the style sheet." (http://www.w3.org/TR/CSS21/syndata.html#parsing-errors). So it must be parsed as if all braces are closed.
Tests parsing the @keyframes rule without closing brace. "User agents must close all open constructs ... at the end of the style sheet." (http://www.w3.org/TR/CSS21/syndata.html#parsing-errors). So it must be parsed as if all braces are closed.
PASS: keyframes rule has length 4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Tests CSS parser autocloses braces.</title>
<style type="text/css" media="screen">
@-webkit-keyframes foo {
@keyframes foo {
from { left: 100px; }
40% { left: 200px; }
60% { left: 200px; }
Expand All @@ -18,7 +18,7 @@
var ss = document.styleSheets;
for (var i = 0; i < ss.length; ++i) {
for (var j = 0; j < ss[i].cssRules.length; ++j) {
if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RULE && ss[i].cssRules[j].name == rule)
if (ss[i].cssRules[j].type == window.CSSRule.KEYFRAMES_RULE && ss[i].cssRules[j].name == rule)
return ss[i].cssRules[j];
}
}
Expand All @@ -41,7 +41,7 @@
</script>
</head>
<body onload="test()">
<div>Tests parsing the @-webkit-keyframes rule without closing brace. &quot;User agents must close all open constructs ... at the end of the style sheet.&quot;
<div>Tests parsing the @keyframes rule without closing brace. &quot;User agents must close all open constructs ... at the end of the style sheet.&quot;
(<a href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">http://www.w3.org/TR/CSS21/syndata.html#parsing-errors</a>). So it must be parsed as if
all braces are closed.</div>
<div id="console"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Constants
PASS CSSKeyframeRule exists on Window object
PASS CSSKeyframesRule exists on Window object
PASS WEBKIT_KEYFRAME_RULE exists on Window.CSSRule object
PASS WEBKIT_KEYFRAMES_RULE exists on Window.CSSRule object
PASS WEBKIT_KEYFRAME_RULE does not exist on Window.CSSRule object
PASS WEBKIT_KEYFRAMES_RULE does not exist on Window.CSSRule object
PASS KEYFRAME_RULE exists on Window.CSSRule object
PASS KEYFRAMES_RULE exists on Window.CSSRule object

Basic queries
PASS keyframes1.type is window.CSSRule.WEBKIT_KEYFRAMES_RULE
PASS keyframes1.type is window.CSSRule.KEYFRAMES_RULE
PASS keyframes1.name is 'test1'
PASS rules1.length is 2
PASS rules1.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules1.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules1.item(0).cssText is '0% { left: 10px; }'
PASS rules1.item(1).cssText is '100% { left: 20px; }'

Expand All @@ -32,10 +32,10 @@ PASS rules2.length is 6
PASS rules2.item(5).cssText is '10% { left: 30px; }'

Keys
PASS keyframes3.type is window.CSSRule.WEBKIT_KEYFRAMES_RULE
PASS keyframes3.type is window.CSSRule.KEYFRAMES_RULE
PASS keyframes3.name is 'test3'
PASS rules3.length is 3
PASS rules3.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules3.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules3.item(0).keyText is '0%'
PASS rules3.item(1).keyText is '50%, 60%'
PASS rules3.item(2).keyText is '90%, 100%'
Expand All @@ -46,77 +46,77 @@ PASS rules3.item(2).cssText is '90%, 100% { left: 20px; }'
Find a rule
PASS rules3.item(0).style is an instance of CSSStyleDeclaration
PASS rules3.item(0).style.length is 1
PASS rule.type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rule.type is window.CSSRule.KEYFRAME_RULE
PASS rule.cssText is '0% { left: 10px; }'

Find a rule with multiple key values
PASS rule.type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rule.type is window.CSSRule.KEYFRAME_RULE
PASS rule.cssText is '50%, 60% { left: 30px; }'

Find a rule using from and to
PASS keyframes4.type is window.CSSRule.WEBKIT_KEYFRAMES_RULE
PASS rule.type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS keyframes4.type is window.CSSRule.KEYFRAMES_RULE
PASS rule.type is window.CSSRule.KEYFRAME_RULE
PASS rule.cssText is '0% { left: 10px; }'
PASS rule.type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rule.type is window.CSSRule.KEYFRAME_RULE
PASS rule.cssText is '100% { left: 20px; }'

Try to find a rule that doesn't exist
PASS Non-existent rule was not found

Delete a rule
PASS rules5.length is 2
PASS rules5.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules5.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules5.item(0).keyText is '0%'
PASS rules5.item(1).keyText is '90%, 100%'

Delete a from rule
PASS rules6.length is 2
PASS rules6.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules6.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules6.item(0).keyText is '50%'
PASS rules6.item(1).keyText is '100%'

Delete a rule that doesn't exist
PASS rules7.length is 2
PASS rules7.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules7.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules7.item(0).keyText is '0%'
PASS rules7.item(1).keyText is '90%, 100%'

Set a keyframe key
PASS rules8.length is 2
PASS rules8.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules8.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules8.item(0).keyText is '70%'
PASS rules8.item(1).keyText is '90%, 100%'

Set a keyframe key with 'from'
PASS rules9.length is 2
PASS rules9.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules9.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules9.item(0).keyText is '0%'
PASS rules9.item(1).keyText is '90%, 100%'

Set a keyframe key with multiple values
PASS rules10.length is 2
PASS rules10.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules10.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules10.item(0).keyText is '0%, 10%, 0%, 20%, 30%, 100%'
PASS rules10.item(1).keyText is '90%, 100%'

Set a keyframe key with an out-of-range value
PASS rules11.item(0).keyText = "40%, -50%, 60%"; threw exception SyntaxError: Failed to set the 'keyText' property on 'CSSKeyframeRule': The key '40%, -50%, 60%' is invalid and cannot be parsed.
PASS rules11.length is 2
PASS rules11.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules11.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules11.item(0).keyText is '0%'
PASS rules11.item(1).keyText is '90%, 100%'

Set a keyframe key with an invalid value
PASS rules12.item(0).keyText = "foo"; threw exception SyntaxError: Failed to set the 'keyText' property on 'CSSKeyframeRule': The key 'foo' is invalid and cannot be parsed.
PASS rules12.length is 2
PASS rules12.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules12.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules12.item(0).keyText is '0%'
PASS rules12.item(1).keyText is '90%, 100%'

Set a keyframe key with a null value
PASS rules13.item(0).keyText = null; threw exception SyntaxError: Failed to set the 'keyText' property on 'CSSKeyframeRule': The key 'null' is invalid and cannot be parsed.
PASS rules13.length is 2
PASS rules13.item(0).type is window.CSSRule.WEBKIT_KEYFRAME_RULE
PASS rules13.item(0).type is window.CSSRule.KEYFRAME_RULE
PASS rules13.item(0).keyText is '0%'
PASS rules13.item(1).keyText is '90%, 100%'
PASS successfullyParsed is true
Expand Down
Loading

0 comments on commit 0363d88

Please sign in to comment.