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

Unified Diff: Source/bindings/v8/V8GCController.cpp

Issue 48633006: Teach V8GCController how to traverse TemplateContentDocumentFragment::host (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 1 month 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 | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8GCController.cpp
diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp
index 483d6480c733435afe8ee098cce49b29528bc2b1..23b00b4d20db69379835ee9e5ae93cc0230f1217 100644
--- a/Source/bindings/v8/V8GCController.cpp
+++ b/Source/bindings/v8/V8GCController.cpp
@@ -42,9 +42,11 @@
#include "bindings/v8/WrapperTypeInfo.h"
#include "core/dom/Attr.h"
#include "core/dom/NodeTraversal.h"
+#include "core/dom/TemplateContentDocumentFragment.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/html/HTMLImageElement.h"
+#include "core/html/HTMLTemplateElement.h"
#include "platform/TraceEvent.h"
namespace WebCore {
@@ -84,7 +86,7 @@ Node* V8GCController::opaqueRootForGC(Node* node, v8::Isolate*)
node = ownerElement;
}
- while (Node* parent = node->parentOrShadowHostNode())
+ while (Node* parent = node->parentOrShadowHostOrTemplateHostNode())
node = parent;
return node;
@@ -179,6 +181,12 @@ private:
return false;
}
}
+ // <template> has a |content| property holding a DOM fragment which we must traverse,
+ // just like we do for the shadow trees above.
+ if (node->hasTagName(HTMLNames::templateTag)) {
+ if (!traverseTree(toHTMLTemplateElement(node)->content(), newSpaceNodes))
+ return false;
+ }
}
return true;
}
@@ -188,8 +196,8 @@ private:
Vector<Node*, initialNodeVectorSize> newSpaceNodes;
Node* node = startNode;
- while (node->parentOrShadowHostNode())
- node = node->parentOrShadowHostNode();
+ while (Node* parent = node->parentOrShadowHostOrTemplateHostNode())
+ node = parent;
if (!traverseTree(node, &newSpaceNodes))
return;
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698