Index: Source/bindings/v8/V8GCController.cpp |
diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp |
index 483d6480c733435afe8ee098cce49b29528bc2b1..eca9566fe8f35a312e6350ec32375da60a2c33ca 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,10 @@ private: |
return false; |
} |
} |
+ if (node->hasTagName(HTMLNames::templateTag)) { |
haraken
2013/10/31 22:32:53
Let's add a comment about this.
adamk
2013/11/04 19:15:41
Done.
|
+ if (!traverseTree(toHTMLTemplateElement(node)->content(), newSpaceNodes)) |
+ return false; |
+ } |
} |
return true; |
} |
@@ -188,8 +194,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; |