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

Unified Diff: Source/core/dom/Element.cpp

Issue 166573003: Port ParentNode API to ElementTraversal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/dom/Document.cpp ('k') | Source/core/dom/ElementTraversal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 7d8e57ca9a253b1367f79f33a58685e8c1660af9..363d78cfbfcfe1656af3b4b7dc9daa02f23ddf18 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -48,6 +48,7 @@
#include "core/dom/DatasetDOMStringMap.h"
#include "core/dom/ElementDataCache.h"
#include "core/dom/ElementRareData.h"
+#include "core/dom/ElementTraversal.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/FullscreenElementStack.h"
#include "core/dom/MutationObserverInterestGroup.h"
@@ -1880,7 +1881,7 @@ void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* be
// |afterChange| is 0 in the parser case, so it works out that we'll skip this block.
if (childrenAffectedByFirstChildRules() && afterChange) {
// Find our new first child.
- Node* newFirstChild = firstElementChild();
+ Element* newFirstChild = ElementTraversal::firstWithin(*this);
RenderStyle* newFirstChildStyle = newFirstChild ? newFirstChild->renderStyle() : 0;
// Find the first element node following |afterChange|
@@ -1900,7 +1901,7 @@ void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* be
// In the DOM case, we only need to do something if |afterChange| is not 0.
if (childrenAffectedByLastChildRules() && beforeChange) {
// Find our new last child.
- Node* newLastChild = lastElementChild();
+ Node* newLastChild = ElementTraversal::lastWithin(*this);
RenderStyle* newLastChildStyle = newLastChild ? newLastChild->renderStyle() : 0;
// Find the last element node going backwards from |beforeChange|
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ElementTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698