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

Unified Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 2034023003: Make appendChild/insertBefore faster with active ranges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-06T14:17:03 Adopt for review comments Created 4 years, 6 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 | « third_party/WebKit/Source/core/dom/ContainerNode.h ('k') | third_party/WebKit/Source/core/dom/Range.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index d7f3ac0c07bc72120e077f48712cfacdb70a4443..2f7a45335c8c3922b46955a5755e994329ba536d 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -772,10 +772,18 @@ void ContainerNode::detach(const AttachContext& context)
Node::detach(context);
}
+bool ContainerNode::shouldNotUpdateRangesAfterChildrenChanged(const ChildrenChange& change)
+{
+ return change.byParser
+ || change.type == TextChanged
+ || change.type == ElementInserted
+ || change.type == NonElementInserted;
+}
+
void ContainerNode::childrenChanged(const ChildrenChange& change)
{
document().incDOMTreeVersion();
- if (!change.byParser && change.type != TextChanged)
+ if (!shouldNotUpdateRangesAfterChildrenChanged(change))
document().updateRangesAfterChildrenChanged(this);
invalidateNodeListCachesInAncestors();
if (change.isChildInsertion() && !childNeedsStyleRecalc()) {
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.h ('k') | third_party/WebKit/Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698