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

Unified Diff: third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h

Issue 2039113003: Make removeChild faster with active ranges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-06T16:21:06 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/Range.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h
diff --git a/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h b/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h
index 401a563078cd906d230b6eb010c7f4819295cefc..7816917472ca3e7ee40f95fe443d98d37f4cafac 100644
--- a/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h
+++ b/third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h
@@ -211,8 +211,10 @@ inline void RangeBoundaryPoint::setToEndOfNode(Node& container)
inline void RangeBoundaryPoint::childBeforeWillBeRemoved()
{
- DCHECK(m_offsetInContainer);
m_childBeforeBoundary = m_childBeforeBoundary->previousSibling();
+ if (!isOffsetValid())
+ return;
+ DCHECK_GT(m_offsetInContainer, 0);
if (!m_childBeforeBoundary)
m_offsetInContainer = 0;
else if (m_offsetInContainer > 0)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698