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

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 url(default);
5 @namespace my-namespace url(http://www.w3.org/1999/xhtml);
6 body {
7 color:black;
8 }
9 my-namespace|body {
10 color:red;
11 }
12 </style>
13 Here is some text!
14 <script>
15 description('Check the basic attribute support of CSSOM CSSNamespaceRule');
16
17 shouldBe('CSSRule.NAMESPACE_RULE','10');
18 var styleSheet = document.getElementById("style1").sheet;
19 var defaultNamespacerule = styleSheet.cssRules[0];
20 var namespacerule = styleSheet.cssRules[1];
21 shouldBe('namespacerule.type','10');
22 shouldBeEqualToString('namespacerule.namespaceURI','http://www.w3.org/1999/xhtml ');
23 shouldBeEqualToString('namespacerule.prefix','my-namespace');
24 shouldBeEqualToString('defaultNamespacerule.cssText', '@namespace url("default") ;');
25 shouldBeEqualToString('namespacerule.cssText', '@namespace my-namespace url("htt p://www.w3.org/1999/xhtml");');
26 shouldBeEqualToString('getComputedStyle(document.body).color', 'rgb(255, 0, 0)') ;
27
28 debug("Deleting namespace rule when other rules are present should throw Invalid StateException.");
29 try {
30 styleSheet.deleteRule(namespacerule);
31 } catch (e) {
32 shouldBe(e.code, '11');
33 }
34
35 debug("Inserting new namespace rule when other rules are present should throw In validStateException.");
36 try {
37 styleSheet.insertRule("@namespace new-namespace url('test-namespace');", styleSheet.cssRules.length);
38 } catch (e) {
39 shouldBe(e.code, '11');
40 }
41
42 </script>
OLDNEW
« no previous file with comments | « LayoutTests/cssom/insertrule-namespace-mapping.html ('k') | LayoutTests/fast/css/css-namespace-rule-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698