Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / css-namespace-rule.html
blob1f7f08d1972f97cc6b36efcd5f66effde9aa2832
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;
9 my-namespace|body {
10 color:red;
12 </style>
13 Here is some text!
14 <script>
15 description('Check the basic attribute support of CSSOM CSSNamespaceRule');
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("http://www.w3.org/1999/xhtml");');
26 shouldBeEqualToString('getComputedStyle(document.body).color', 'rgb(255, 0, 0)');
28 debug("Deleting namespace rule when other rules are present should throw InvalidStateException.");
29 try {
30 styleSheet.deleteRule(namespacerule);
31 } catch (e) {
32 shouldBe(e.code, '11');
35 debug("Inserting new namespace rule when other rules are present should throw InvalidStateException.");
36 try {
37 styleSheet.insertRule("@namespace new-namespace url('test-namespace');", styleSheet.cssRules.length);
38 } catch (e) {
39 shouldBe(e.code, '11');
42 </script>