Index: LayoutTests/resources/dump-as-markup.js |
=================================================================== |
--- LayoutTests/resources/dump-as-markup.js (revision 109271) |
+++ LayoutTests/resources/dump-as-markup.js (working copy) |
@@ -126,14 +126,16 @@ |
Markup.get = function(node) |
{ |
+ var markup = Markup._getShadowHostIfPossible(node, 0); |
+ if (markup) |
+ return markup.substring(1); |
+ |
if (!node.firstChild) |
return '| '; |
// Don't print any markup for the root node. |
- var markup = ''; |
- for (var i = 0, len = node.childNodes.length; i < len; i++) { |
+ for (var i = 0, len = node.childNodes.length; i < len; i++) |
markup += Markup._get(node.childNodes[i], 0); |
- } |
return markup.substring(1); |
} |
@@ -227,11 +229,7 @@ |
str += Markup._get(node.childNodes[i], depth + 1); |
} |
- if (!Markup._useHTML5libOutputFormat && node.nodeType == Node.ELEMENT_NODE && window.internals) { |
- var root = window.internals.shadowRoot(node); |
- if (root) |
- str += Markup._get(root, depth + 1); |
- } |
+ str += Markup._getShadowHostIfPossible(node, depth); |
var selection = Markup._getSelectionMarker(node, i); |
if (selection) |
@@ -240,6 +238,16 @@ |
return str; |
} |
+Markup._getShadowHostIfPossible = function (node, depth) |
+{ |
+ if (!Markup._useHTML5libOutputFormat && node.nodeType == Node.ELEMENT_NODE && window.internals) { |
+ var root = window.internals.shadowRoot(node); |
+ if (root) |
+ return Markup._get(root, depth + 1); |
+ } |
+ return ''; |
+} |
+ |
Markup._namespace = function(node) |
{ |
if (Markup._NAMESPACE_URI_MAP[node.namespaceURI]) |