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

Side by Side Diff: LayoutTests/fast/dom/createElementNS-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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3
4 <script>
5 description("Test that calling createElementNS() throws an error when http://www .w3.org/TR/dom/#dom-document-createelementns says it should.");
6
7 // Spec: http://www.w3.org/TR/dom/#dom-document-createelementns
8
9 // Step 5.
10 shouldThrow("document.createElementNS(null, 'foo:bar', 'baz')", '"NamespaceError : Failed to execute \'createElementNS\' on \'Document\': The namespace URI provi ded (\'\') is not valid for the qualified name provided (\'foo:bar\')."');
11
12 // Step 6.
13 shouldNotThrow("document.createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:abc', 'foo')");
14 shouldThrow("document.createElementNS('http://www.w3.org/not-XML/1998/namespace' , 'xml:abc', 'foo')", '"NamespaceError: Failed to execute \'createElementNS\' on \'Document\': The namespace URI provided (\'http://www.w3.org/not-XML/1998/name space\') is not valid for the qualified name provided (\'xml:abc\')."');
15
16 // Step 7.
17 shouldNotThrow("document.createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns ', 'http://wwww.example.org')");
18 shouldThrow("document.createElementNS('http://www.w3.org/2000/not-xmlns/', 'xmln s', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'createEle mentNS\' on \'Document\': The namespace URI provided (\'http://www.w3.org/2000/n ot-xmlns/\') is not valid for the qualified name provided (\'xmlns\')."');
19 shouldNotThrow("document.createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns :abc', 'http://wwww.example.org')");
20 shouldThrow("document.createElementNS('http://www.w3.org/2000/not-xmlns/', 'xmln s:abc', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'creat eElementNS\' on \'Document\': The namespace URI provided (\'http://www.w3.org/20 00/not-xmlns/\') is not valid for the qualified name provided (\'xmlns:abc\')."' );
21
22 // Step 8.
23 shouldThrow("document.createElementNS('http://www.w3.org/2000/xmlns/', 'badprefi x:xmlns', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'cre ateElementNS\' on \'Document\': The namespace URI provided (\'http://www.w3.org/ 2000/xmlns/\') is not valid for the qualified name provided (\'badprefix:xmlns\' )."');
24 shouldThrow("document.createElementNS('http://www.w3.org/2000/xmlns/', 'notxmlns ', 'http://wwww.example.org')", '"NamespaceError: Failed to execute \'createElem entNS\' on \'Document\': The namespace URI provided (\'http://www.w3.org/2000/xm lns/\') is not valid for the qualified name provided (\'notxmlns\')."');
25 </script>
26
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698