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

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

Issue 201383002: Use new is*Element() helper functions more in bindings/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor clean up Created 6 years, 9 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 | Source/bindings/v8/V8WindowShell.cpp » ('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 027481fe0c688d0565082a10fb6e41e994a81f60..bffb6fcecc5927aa591c355713f3316f9b94e48f 100644
--- a/Source/bindings/v8/V8GCController.cpp
+++ b/Source/bindings/v8/V8GCController.cpp
@@ -70,11 +70,12 @@ static void addReferencesForNodeWithEventListeners(v8::Isolate* isolate, Node* n
Node* V8GCController::opaqueRootForGC(Node* node, v8::Isolate*)
{
+ ASSERT(node);
// FIXME: Remove the special handling for image elements.
// The same special handling is in V8GCController::gcTree().
// Maybe should image elements be active DOM nodes?
// See https://code.google.com/p/chromium/issues/detail?id=164882
- if (node->inDocument() || (node->hasTagName(HTMLNames::imgTag) && toHTMLImageElement(node)->hasPendingActivity()))
+ if (node->inDocument() || (isHTMLImageElement(*node) && toHTMLImageElement(*node).hasPendingActivity()))
return &node->document();
if (node->isAttributeNode()) {
@@ -134,7 +135,7 @@ public:
// The same special handling is in V8GCController::opaqueRootForGC().
// Maybe should image elements be active DOM nodes?
// See https://code.google.com/p/chromium/issues/detail?id=164882
- if (node->hasTagName(HTMLNames::imgTag) && toHTMLImageElement(node)->hasPendingActivity())
+ if (isHTMLImageElement(*node) && toHTMLImageElement(*node).hasPendingActivity())
return;
// FIXME: Remove the special handling for SVG context elements.
if (node->isSVGElement() && toSVGElement(node)->isContextElement())
@@ -187,8 +188,8 @@ private:
}
// <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(), partiallyDependentNodes))
+ if (isHTMLTemplateElement(*node)) {
+ if (!traverseTree(toHTMLTemplateElement(*node).content(), partiallyDependentNodes))
return false;
}
}
« no previous file with comments | « no previous file | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698