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

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

Issue 1189543002: Do not traverse nodes not having a layout object while searching editable visible position. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch Created 5 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 | « no previous file | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PositionIterator.cpp
diff --git a/Source/core/dom/PositionIterator.cpp b/Source/core/dom/PositionIterator.cpp
index cf18d99daa24fda35d57fbb4d1052a962c686916..6e3d4874c15aca1e36e6a55c631c55078475f168 100644
--- a/Source/core/dom/PositionIterator.cpp
+++ b/Source/core/dom/PositionIterator.cpp
@@ -93,7 +93,7 @@ void PositionIteratorAlgorithm<Strategy>::increment()
return;
}
- if (!Strategy::hasChildren(*m_anchorNode) && m_offsetInAnchor < Strategy::lastOffsetForEditing(m_anchorNode)) {
+ if (m_anchorNode->layoutObject() && !Strategy::hasChildren(*m_anchorNode) && m_offsetInAnchor < Strategy::lastOffsetForEditing(m_anchorNode)) {
m_offsetInAnchor = PositionAlgorithm<Strategy>::uncheckedNextOffset(m_anchorNode, m_offsetInAnchor);
} else {
m_nodeAfterPositionInAnchor = m_anchorNode;
@@ -126,7 +126,7 @@ void PositionIteratorAlgorithm<Strategy>::decrement()
m_anchorNode = Strategy::lastChild(*m_anchorNode);
m_offsetInAnchor = Strategy::hasChildren(*m_anchorNode)? 0 : Strategy::lastOffsetForEditing(m_anchorNode);
} else {
- if (m_offsetInAnchor) {
+ if (m_offsetInAnchor && m_anchorNode->layoutObject()) {
m_offsetInAnchor = PositionAlgorithm<Strategy>::uncheckedPreviousOffset(m_anchorNode, m_offsetInAnchor);
} else {
m_nodeAfterPositionInAnchor = m_anchorNode;
« no previous file with comments | « no previous file | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698