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

Side by Side Diff: LayoutTests/fast/dom/setAttributeNS-namespace-errors.html

Issue 122083002: createElementNS handles element name 'xmlns' correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed feedback. Created 6 years, 11 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
4 <script>
5 description("Test that calling setAttributeNS() throws an error when http://www. w3.org/TR/dom/#dom-element-setattributens says it should.");
6
7 window.elem = document.createElement('test');
8
9 // Spec: http://www.w3.org/TR/dom/#dom-element-setattributens
10
11 // Step 5.
12 shouldThrow("elem.setAttributeNS(null, 'foo:bar', 'baz')", '"NamespaceError: Fai led to execute \'setAttributeNS\' on \'Element\': \'\' is an invalid namespace f or attributes."');
13
14 // Step 6.
15 shouldNotThrow("elem.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml :abc', 'foo')");
16 shouldThrow("elem.setAttributeNS('http://www.w3.org/not-XML/1998/namespace', 'xm l:abc', 'foo')", '"NamespaceError: Failed to execute \'setAttributeNS\' on \'Ele ment\': \'http://www.w3.org/not-XML/1998/namespace\' is an invalid namespace for attributes."');
17
18 // Step 7.
19 shouldNotThrow("elem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', 'h ttp://wwww.example.org')");
20 shouldThrow("elem.setAttributeNS('http://www.w3.org/2000/not-xmlns/', 'xmlns', ' http://wwww.example.org')", '"NamespaceError: Failed to execute \'setAttributeNS \' on \'Element\': \'http://www.w3.org/2000/not-xmlns/\' is an invalid namespace for attributes."');
21 shouldNotThrow("elem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:abc' , 'http://wwww.example.org')");
22 shouldThrow("elem.setAttributeNS('http://www.w3.org/2000/not-xmlns/', 'xmlns:abc ', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'setAttribu teNS\' on \'Element\': \'http://www.w3.org/2000/not-xmlns/\' is an invalid names pace for attributes."');
23
24 // Step 8.
25 shouldThrow("elem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'badprefix:xml ns', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'setAttri buteNS\' on \'Element\': \'http://www.w3.org/2000/xmlns/\' is an invalid namespa ce for attributes."');
26 shouldThrow("elem.setAttributeNS('http://www.w3.org/2000/xmlns/', 'notxmlns', 'h ttp://wwww.example.org')", '"NamespaceError: Failed to execute \'setAttributeNS\ ' on \'Element\': \'http://www.w3.org/2000/xmlns/\' is an invalid namespace for attributes."');
27 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/setAttributeNS-expected.txt ('k') | LayoutTests/fast/dom/setAttributeNS-namespace-errors-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698