Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js

Issue 23530010: Make CSSStyleSheet.insertRule() / deleteRule() arguments mandatory (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description( 1 description(
2 'This tests the behavior of non-numeric values in contexts where the DOM has a n umeric parameter.' 2 'This tests the behavior of non-numeric values in contexts where the DOM has a n umeric parameter.'
3 ); 3 );
4 4
5 function nonNumericPolicy(template) 5 function nonNumericPolicy(template)
6 { 6 {
7 var x = 0; 7 var x = 0;
8 try { 8 try {
9 eval(template); 9 eval(template);
10 } catch (e) { 10 } catch (e) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return "mixed"; 93 return "mixed";
94 } 94 }
95 95
96 var selector = "a"; 96 var selector = "a";
97 var styleText = "font-size: smaller"; 97 var styleText = "font-size: smaller";
98 var ruleText = selector + " { " + styleText + " }"; 98 var ruleText = selector + " { " + styleText + " }";
99 99
100 var testElementContainer = document.createElement("div"); 100 var testElementContainer = document.createElement("div");
101 document.body.appendChild(testElementContainer); 101 document.body.appendChild(testElementContainer);
102 102
103 function createCSSStyleSheet()
104 {
105 return document.createElement("style").sheet;
106 }
107
108 function createFromMarkup(markup) 103 function createFromMarkup(markup)
109 { 104 {
110 var range = document.createRange(); 105 var range = document.createRange();
111 var fragmentContainer = document.createElement("div"); 106 var fragmentContainer = document.createElement("div");
112 range.selectNodeContents(fragmentContainer); 107 range.selectNodeContents(fragmentContainer);
113 testElementContainer.appendChild(fragmentContainer); 108 testElementContainer.appendChild(fragmentContainer);
114 var fragment = range.createContextualFragment(markup); 109 var fragment = range.createContextualFragment(markup);
115 fragmentContainer.appendChild(fragment); 110 fragmentContainer.appendChild(fragment);
116 return fragmentContainer.firstChild; 111 return fragmentContainer.firstChild;
117 } 112 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // CSSRuleList 196 // CSSRuleList
202 197
203 shouldBe("nonNumericPolicy('createCSSRuleList().item(x)')", "'any type allowed ( but not omitted)'"); 198 shouldBe("nonNumericPolicy('createCSSRuleList().item(x)')", "'any type allowed ( but not omitted)'");
204 199
205 // CSSStyleDeclaration 200 // CSSStyleDeclaration
206 201
207 shouldBe("nonNumericPolicy('createCSSStyleDeclaration().item(x)')", "'any type a llowed'"); 202 shouldBe("nonNumericPolicy('createCSSStyleDeclaration().item(x)')", "'any type a llowed'");
208 203
209 // CSSStyleSheet 204 // CSSStyleSheet
210 205
211 shouldBe("nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)')", "' any type allowed'"); 206 shouldBe("nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)')", "' any type allowed (but not omitted)'");
212 shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type a llowed'"); 207 shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type a llowed (but not omitted)'");
213 shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x )')", "'any type allowed'"); 208 shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x )')", "'any type allowed'");
214 shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type a llowed'"); 209 shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type a llowed'");
215 210
216 // CSSValueList 211 // CSSValueList
217 212
218 shouldBe("nonNumericPolicy('createCSSValueList().item(x)')", "'any type allowed (but not omitted)'"); 213 shouldBe("nonNumericPolicy('createCSSValueList().item(x)')", "'any type allowed (but not omitted)'");
219 214
220 // Document 215 // Document
221 216
222 shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allow ed'"); 217 shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allow ed'");
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 ../../../../WebCore/svg/SVGSVGElement.idl: attribute float curre ntScale 635 ../../../../WebCore/svg/SVGSVGElement.idl: attribute float curre ntScale
641 636
642 ../../../../WebCore/svg/SVGMatrix.idl: attribute double a; 637 ../../../../WebCore/svg/SVGMatrix.idl: attribute double a;
643 ../../../../WebCore/svg/SVGMatrix.idl: attribute double b; 638 ../../../../WebCore/svg/SVGMatrix.idl: attribute double b;
644 ../../../../WebCore/svg/SVGMatrix.idl: attribute double c; 639 ../../../../WebCore/svg/SVGMatrix.idl: attribute double c;
645 ../../../../WebCore/svg/SVGMatrix.idl: attribute double d; 640 ../../../../WebCore/svg/SVGMatrix.idl: attribute double d;
646 ../../../../WebCore/svg/SVGMatrix.idl: attribute double e; 641 ../../../../WebCore/svg/SVGMatrix.idl: attribute double e;
647 ../../../../WebCore/svg/SVGMatrix.idl: attribute double f; 642 ../../../../WebCore/svg/SVGMatrix.idl: attribute double f;
648 643
649 */ 644 */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698