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

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 482903002: Get rid of loops looking for the first Element ancestor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 6 years, 4 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 | « Source/core/rendering/TextAutosizer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index 8ed8307aa3f33f9ab87f3c1c04a7d3fc444866af..7f0e69fd65e9e60ac1595b5732ab4bbccc4ff458 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -801,10 +801,10 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
while (parentElement) {
elemStack.append(parentElement);
- ContainerNode* n = parentElement->parentNode();
- if (!n || !n->isElementNode())
+ Element* grandParentElement = parentElement->parentElement();
+ if (!grandParentElement)
break;
- parentElement = toElement(n);
+ parentElement = grandParentElement;
}
if (elemStack.isEmpty())
« no previous file with comments | « Source/core/rendering/TextAutosizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698