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

Side by Side Diff: LayoutTests/fast/css/css-namespace-rule.html

Issue 1321943002: Support for CSSOM CSSNamespaceRule interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <style id="style1">
4 @namespace my-namespace url(http://www.w3.org/1999/xhtml);
5 body {
6 color:black;
7 }
8 my-namespace|body {
9 color:red;
10 }
11 </style>
12 Here is some text!
13 <script>
14 description('Check the basic attribute support of CSSOM CSSNamespaceRule');
15
16 shouldBe('CSSRule.NAMESPACE_RULE','10');
17 var styleSheet = document.getElementById("style1").sheet;
18 var namespacerule = styleSheet.cssRules[0];
19 shouldBe('namespacerule.type','10');
20 shouldBeEqualToString('namespacerule.namespaceURI','http://www.w3.org/1999/xhtml ');
21 shouldBeEqualToString('namespacerule.prefix','my-namespace');
22 shouldBeEqualToString('namespacerule.cssText','@namespace my-namespace url("http ://www.w3.org/1999/xhtml");');
23 shouldBeEqualToString('getComputedStyle(document.body).color', 'rgb(255, 0, 0)') ;
24
25 debug("Deleting namespace rule when other rules are present should throw Invalid StateException.");
26 try {
27 styleSheet.deleteRule(namespacerule);
28 } catch (e) {
29 shouldBe(e.code, '11');
30 }
31
32 debug("Inserting new namespace rule when other rules are present should throw In validStateException.");
33 try {
34 styleSheet.insertRule("@namespace new-namespace url('test-namespace');", styleSheet.cssRules.length);
35 } catch (e) {
36 shouldBe(e.code, '11');
37 }
38
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698