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

Unified Diff: Source/core/editing/iterators/TextIterator.cpp

Issue 1293703006: Make TextIterator to stop when it falls to handle shadow tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-20T17:53:45 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/iterators/TextIterator.cpp
diff --git a/Source/core/editing/iterators/TextIterator.cpp b/Source/core/editing/iterators/TextIterator.cpp
index b1c57bc7f7e2f8453306112f343dcf4b131232b2..0c9aa7edc6b851be5426c5e81f8d33c49afe9bb8 100644
--- a/Source/core/editing/iterators/TextIterator.cpp
+++ b/Source/core/editing/iterators/TextIterator.cpp
@@ -368,6 +368,11 @@ void TextIteratorAlgorithm<Strategy>::advance()
if (!next && !parentNode && m_shadowDepth > 0) {
// 4. Reached the top of a shadow root. If it's created by author, then try to visit the next
// sibling shadow root, if any.
+ if (!m_node->isShadowRoot()) {
+ ASSERT_NOT_REACHED();
+ m_shouldStop = true;
+ return;
+ }
ShadowRoot* shadowRoot = toShadowRoot(m_node);
if (shadowRoot->type() == ShadowRootType::OpenByDefault || shadowRoot->type() == ShadowRootType::Open) {
ShadowRoot* nextShadowRoot = shadowRoot->olderShadowRoot();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698