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

Side by Side Diff: LayoutTests/dom/xhtml/level3/core/nodecomparedocumentposition19.js

Issue 756123002: Remove tabs and trailing whitspace in LayoutTests/dom/.../*.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years 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 | Annotate | Revision Log
OLDNEW
1
2 /* 1 /*
3 Copyright © 2001-2004 World Wide Web Consortium, 2 Copyright © 2001-2004 World Wide Web Consortium,
4 (Massachusetts Institute of Technology, European Research Consortium 3 (Massachusetts Institute of Technology, European Research Consortium
5 for Informatics and Mathematics, Keio University). All 4 for Informatics and Mathematics, Keio University). All
6 Rights Reserved. This work is distributed under the W3C® Software License [1] i n the 5 Rights Reserved. This work is distributed under the W3C® Software License [1] i n the
7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even 6 hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 8
10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 9 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
11 */ 10 */
12 11
13
14
15 /** 12 /**
16 * Gets URI that identifies the test. 13 * Gets URI that identifies the test.
17 * @return uri identifier of test 14 * @return uri identifier of test
18 */ 15 */
19 function getTargetURI() { 16 function getTargetURI() {
20 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodecomparedocum entposition19"; 17 return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodecomparedocum entposition19";
21 } 18 }
22 19
23 var docsLoaded = -1000000; 20 var docsLoaded = -1000000;
24 var builder = null; 21 var builder = null;
(...skipping 11 matching lines...) Expand all
36 setUpPageStatus = 'running'; 33 setUpPageStatus = 'running';
37 try { 34 try {
38 // 35 //
39 // creates test document builder, may throw exception 36 // creates test document builder, may throw exception
40 // 37 //
41 builder = createConfiguredBuilder(); 38 builder = createConfiguredBuilder();
42 setImplementationAttribute("coalescing", false); 39 setImplementationAttribute("coalescing", false);
43 setImplementationAttribute("namespaceAware", true); 40 setImplementationAttribute("namespaceAware", true);
44 41
45 docsLoaded = 0; 42 docsLoaded = 0;
46 43
47 var docRef = null; 44 var docRef = null;
48 if (typeof(this.doc) != 'undefined') { 45 if (typeof(this.doc) != 'undefined') {
49 docRef = this.doc; 46 docRef = this.doc;
50 } 47 }
51 docsLoaded += preload(docRef, "doc", "hc_staff"); 48 docsLoaded += preload(docRef, "doc", "hc_staff");
52 49
53 if (docsLoaded == 1) { 50 if (docsLoaded == 1) {
54 setUpPageStatus = 'complete'; 51 setUpPageStatus = 'complete';
55 } 52 }
56 } catch(ex) { 53 } catch(ex) {
57 » catchInitializationError(builder, ex); 54 catchInitializationError(builder, ex);
58 setUpPageStatus = 'complete'; 55 setUpPageStatus = 'complete';
59 } 56 }
60 } 57 }
61 58
62
63
64 // 59 //
65 // This method is called on the completion of 60 // This method is called on the completion of
66 // each asychronous load started in setUpTests. 61 // each asychronous load started in setUpTests.
67 // 62 //
68 // When every synchronous loaded document has completed, 63 // When every synchronous loaded document has completed,
69 // the page status is changed which allows the 64 // the page status is changed which allows the
70 // body of the test to be executed. 65 // body of the test to be executed.
71 function loadComplete() { 66 function loadComplete() {
72 if (++docsLoaded == 1) { 67 if (++docsLoaded == 1) {
73 setUpPageStatus = 'complete'; 68 setUpPageStatus = 'complete';
74 } 69 }
75 } 70 }
76 71
72 /**
73 *
74 The method compareDocumentPosition compares a node with this node with regar d to their position in the
75 document and according to the document order.
77 76
78 /** 77 Using compareDocumentPosition check if the document position of the first CD ATASection node
79 * 78 of the second element whose localName is name compared with the second CDATA Section node
80 » The method compareDocumentPosition compares a node with this node with r egard to their position in the 79 is PRECEDING and is FOLLOWING vice versa.
81 » document and according to the document order.
82 »
83 » Using compareDocumentPosition check if the document position of the firs t CDATASection node
84 » of the second element whose localName is name compared with the second C DATASection node
85 » is PRECEDING and is FOLLOWING vice versa.
86 80
87 * @author IBM 81 * @author IBM
88 * @author Jenny Hsu 82 * @author Jenny Hsu
89 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-compar eDocumentPosition 83 * @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-compar eDocumentPosition
90 */ 84 */
91 function nodecomparedocumentposition19() { 85 function nodecomparedocumentposition19() {
92 var success; 86 var success;
93 if(checkInitialization(builder, "nodecomparedocumentposition19") != null) re turn; 87 if(checkInitialization(builder, "nodecomparedocumentposition19") != null) re turn;
94 var doc; 88 var doc;
95 var elemList; 89 var elemList;
96 var elemStrong; 90 var elemStrong;
97 var cdata1; 91 var cdata1;
98 var cdata2; 92 var cdata2;
99 var aNode; 93 var aNode;
100 var cdata1Position; 94 var cdata1Position;
101 var cdata2Position; 95 var cdata2Position;
102 96
103 var docRef = null; 97 var docRef = null;
104 if (typeof(this.doc) != 'undefined') { 98 if (typeof(this.doc) != 'undefined') {
105 docRef = this.doc; 99 docRef = this.doc;
106 } 100 }
107 doc = load(docRef, "doc", "hc_staff"); 101 doc = load(docRef, "doc", "hc_staff");
108 elemList = doc.getElementsByTagNameNS("*","strong"); 102 elemList = doc.getElementsByTagNameNS("*","strong");
109 elemStrong = elemList.item(1); 103 elemStrong = elemList.item(1);
110 cdata2 = elemStrong.lastChild; 104 cdata2 = elemStrong.lastChild;
111 105
112 aNode = cdata2.previousSibling; 106 aNode = cdata2.previousSibling;
113 107
114 cdata1 = aNode.previousSibling; 108 cdata1 = aNode.previousSibling;
115 109
116 cdata1Position = cdata1.compareDocumentPosition(cdata2); 110 cdata1Position = cdata1.compareDocumentPosition(cdata2);
117 assertEquals("nodecomparedocumentposition19_cdata2Follows",4,cdata1Positio n); 111 assertEquals("nodecomparedocumentposition19_cdata2Follows",4,cdata1Positio n);
118 cdata2Position = cdata2.compareDocumentPosition(cdata1); 112 cdata2Position = cdata2.compareDocumentPosition(cdata1);
119 assertEquals("nodecomparedocumentposition_cdata1Precedes",2,cdata2Position ); 113 assertEquals("nodecomparedocumentposition_cdata1Precedes",2,cdata2Position );
120 114
121 } 115 }
122 116
123
124
125
126 function runTest() { 117 function runTest() {
127 nodecomparedocumentposition19(); 118 nodecomparedocumentposition19();
128 } 119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698