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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 if (m_textState.positionNode()) { 361 if (m_textState.positionNode()) {
362 m_iterationProgress = HandledChildren; 362 m_iterationProgress = HandledChildren;
363 return; 363 return;
364 } 364 }
365 next = Strategy::nextSibling(*m_node); 365 next = Strategy::nextSibling(*m_node);
366 } 366 }
367 367
368 if (!next && !parentNode && m_shadowDepth > 0) { 368 if (!next && !parentNode && m_shadowDepth > 0) {
369 // 4. Reached the top of a shadow root. If it's created by a uthor, then try to visit the next 369 // 4. Reached the top of a shadow root. If it's created by a uthor, then try to visit the next
370 // sibling shadow root, if any. 370 // sibling shadow root, if any.
371 if (!m_node->isShadowRoot()) {
372 ASSERT_NOT_REACHED();
373 m_shouldStop = true;
374 return;
375 }
371 ShadowRoot* shadowRoot = toShadowRoot(m_node); 376 ShadowRoot* shadowRoot = toShadowRoot(m_node);
372 if (shadowRoot->type() == ShadowRootType::OpenByDefault || s hadowRoot->type() == ShadowRootType::Open) { 377 if (shadowRoot->type() == ShadowRootType::OpenByDefault || s hadowRoot->type() == ShadowRootType::Open) {
373 ShadowRoot* nextShadowRoot = shadowRoot->olderShadowRoot (); 378 ShadowRoot* nextShadowRoot = shadowRoot->olderShadowRoot ();
374 if (nextShadowRoot && nextShadowRoot->type() == ShadowRo otType::OpenByDefault) { 379 if (nextShadowRoot && nextShadowRoot->type() == ShadowRo otType::OpenByDefault) {
375 m_fullyClippedStack.pop(); 380 m_fullyClippedStack.pop();
376 m_node = nextShadowRoot; 381 m_node = nextShadowRoot;
377 m_iterationProgress = HandledNone; 382 m_iterationProgress = HandledNone;
378 // m_shadowDepth is unchanged since we exit from a s hadow root and enter another. 383 // m_shadowDepth is unchanged since we exit from a s hadow root and enter another.
379 m_fullyClippedStack.pushFullyClippedState(m_node); 384 m_fullyClippedStack.pushFullyClippedState(m_node);
380 } else { 385 } else {
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 1118
1114 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior Flags behavior) 1119 String plainText(const EphemeralRangeInComposedTree& range, TextIteratorBehavior Flags behavior)
1115 { 1120 {
1116 return createPlainText<EditingInComposedTreeStrategy>(range, behavior); 1121 return createPlainText<EditingInComposedTreeStrategy>(range, behavior);
1117 } 1122 }
1118 1123
1119 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; 1124 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>;
1120 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>; 1125 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>;
1121 1126
1122 } // namespace blink 1127 } // namespace blink
OLDNEW
« 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