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

Unified Diff: third_party/WebKit/LayoutTests/resources/dump-as-markup.js

Issue 2643773007: Remove internals.address(node) (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/resources/dump-as-markup.js
diff --git a/third_party/WebKit/LayoutTests/resources/dump-as-markup.js b/third_party/WebKit/LayoutTests/resources/dump-as-markup.js
index ee22396e6cefec7ec3c723db2446302c3123b5b7..e068429d8cfe35144fefeaeaee8401ba4a4ef3db 100644
--- a/third_party/WebKit/LayoutTests/resources/dump-as-markup.js
+++ b/third_party/WebKit/LayoutTests/resources/dump-as-markup.js
@@ -126,8 +126,7 @@ Markup.useHTML5libOutputFormat = function()
Markup.get = function(node)
{
- var shadowRootList = {};
- var markup = Markup._getShadowHostIfPossible(node, 0, shadowRootList);
+ var markup = Markup._getShadowHostIfPossible(node, 0);
if (markup)
return markup.substring(1);
@@ -136,13 +135,13 @@ Markup.get = function(node)
// Don't print any markup for the root node.
for (var i = 0, len = node.childNodes.length; i < len; i++)
- markup += Markup._get(node.childNodes[i], 0, shadowRootList);
+ markup += Markup._get(node.childNodes[i], 0);
return markup.substring(1);
}
// Returns the markup for the given node. To be used for cases where a test needs
// to get the markup but not clobber the whole page.
-Markup._get = function(node, depth, shadowRootList)
+Markup._get = function(node, depth)
{
var str = Markup._indent(depth);
@@ -217,24 +216,25 @@ Markup._get = function(node, depth, shadowRootList)
break;
case Node.DOCUMENT_FRAGMENT_NODE:
- if (shadowRootList && internals.address(node) in shadowRootList)
+ if (node.constructor.name == "ShadowRoot")
str += "<shadow:root>";
else
str += "content";
}
+ // TODO(esprehn): This should definitely be ==.
dglazkov 2017/01/20 16:37:26 Could you expand on this comment? What does it mea
esprehn 2017/01/20 17:51:50 It's using single equal instead of double equal. S
dglazkov 2017/01/23 04:29:36 Oh, I missed it. I was looking at the node.tagName
if (node.namespaceURI = 'http://www.w3.org/1999/xhtml' && node.tagName == 'TEMPLATE')
- str += Markup._get(node.content, depth + 1, shadowRootList);
+ str += Markup._get(node.content, depth + 1);
for (var i = 0, len = node.childNodes.length; i < len; i++) {
var selection = Markup._getSelectionMarker(node, i);
if (selection)
str += Markup._indent(depth + 1) + selection;
- str += Markup._get(node.childNodes[i], depth + 1, shadowRootList);
+ str += Markup._get(node.childNodes[i], depth + 1);
}
- str += Markup._getShadowHostIfPossible(node, depth, shadowRootList);
+ str += Markup._getShadowHostIfPossible(node, depth);
var selection = Markup._getSelectionMarker(node, i);
if (selection)
@@ -243,13 +243,12 @@ Markup._get = function(node, depth, shadowRootList)
return str;
}
-Markup._getShadowHostIfPossible = function (node, depth, shadowRootList)
+Markup._getShadowHostIfPossible = function (node, depth)
{
if (!Markup._useHTML5libOutputFormat && node.nodeType == Node.ELEMENT_NODE && window.internals) {
var root = window.internals.shadowRoot(node);
if (root) {
- shadowRootList[internals.address(root)] = true;
- return Markup._get(root, depth + 1, shadowRootList);
+ return Markup._get(root, depth + 1);
}
}
return '';
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698