OLD | NEW |
1 /** | 1 /** |
2 * There are three basic use cases of dumpAsMarkup | 2 * There are three basic use cases of dumpAsMarkup |
3 * | 3 * |
4 * 1. Dump the entire DOM when the page is loaded | 4 * 1. Dump the entire DOM when the page is loaded |
5 * When this script is included but no method of Markup is called, | 5 * When this script is included but no method of Markup is called, |
6 * it dumps the DOM of each frame loaded. | 6 * it dumps the DOM of each frame loaded. |
7 * | 7 * |
8 * 2. Dump the content of a specific element when the page is loaded | 8 * 2. Dump the content of a specific element when the page is loaded |
9 * When Markup.setNodeToDump is called with some element or the id of some el
ement, | 9 * When Markup.setNodeToDump is called with some element or the id of some el
ement, |
10 * it dumps the content of the specified element as supposed to the entire DO
M tree. | 10 * it dumps the content of the specified element as supposed to the entire DO
M tree. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 for (var j = 0; j < node.attributes.length; j += 1) { | 193 for (var j = 0; j < node.attributes.length; j += 1) { |
194 var name = Markup._namespace(node.attributes[j]) | 194 var name = Markup._namespace(node.attributes[j]) |
195 name += node.attributes[j].localName || node.attributes[j].nodeN
ame; | 195 name += node.attributes[j].localName || node.attributes[j].nodeN
ame; |
196 attrNames.push(name); | 196 attrNames.push(name); |
197 attrPos[name] = j; | 197 attrPos[name] = j; |
198 } | 198 } |
199 if (attrNames.length > 0) { | 199 if (attrNames.length > 0) { |
200 attrNames.sort(); | 200 attrNames.sort(); |
201 for (var j = 0; j < attrNames.length; j += 1) { | 201 for (var j = 0; j < attrNames.length; j += 1) { |
202 str += Markup._indent(depth + 1) + attrNames[j]; | 202 str += Markup._indent(depth + 1) + attrNames[j]; |
203 str += '="' + node.attributes[attrPos[attrNames[j]]].nodeValue +
'"'; | 203 str += '="' + node.attributes[attrPos[attrNames[j]]].value + '"'
; |
204 } | 204 } |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 if (!Markup._useHTML5libOutputFormat && window.internals) { | 208 if (!Markup._useHTML5libOutputFormat && window.internals) { |
209 var pseudoId = window.internals.shadowPseudoId(node); | 209 var pseudoId = window.internals.shadowPseudoId(node); |
210 if (pseudoId) | 210 if (pseudoId) |
211 str += Markup._indent(depth + 1) + 'shadow:pseudoId="' + pseudoI
d + '"'; | 211 str += Markup._indent(depth + 1) + 'shadow:pseudoId="' + pseudoI
d + '"'; |
212 } | 212 } |
213 | 213 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return Markup._SELECTION_CARET; | 357 return Markup._SELECTION_CARET; |
358 else | 358 else |
359 return Markup._SELECTION_ANCHOR; | 359 return Markup._SELECTION_ANCHOR; |
360 } else if (index == sel.focusOffset && node == sel.focusNode) | 360 } else if (index == sel.focusOffset && node == sel.focusNode) |
361 return Markup._SELECTION_FOCUS; | 361 return Markup._SELECTION_FOCUS; |
362 | 362 |
363 return ''; | 363 return ''; |
364 } | 364 } |
365 | 365 |
366 window.addEventListener('load', Markup.notifyDone, false); | 366 window.addEventListener('load', Markup.notifyDone, false); |
OLD | NEW |