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

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

Issue 624483002: Make TextIterator not stop at IMG element for finding text separating inline image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « Source/core/editing/TextIterator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TextIterator.cpp
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 32bc25c6781e39d607c8da1a6323486b01c41739..0b48f881ad8c46e93780de8646050ba26e34a898 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -266,6 +266,7 @@ TextIterator::TextIterator(const Range* range, TextIteratorBehaviorFlags behavio
, m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText)
, m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots)
, m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplacementCharacter)
+ , m_breaksAtReplacedElement(!(behavior & TextIteratorDoesNotBreakAtReplacedElement))
{
if (range)
initialize(range->startPosition(), range->endPosition());
@@ -297,6 +298,7 @@ TextIterator::TextIterator(const Position& start, const Position& end, TextItera
, m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText)
, m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots)
, m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplacementCharacter)
+ , m_breaksAtReplacedElement(!(behavior & TextIteratorDoesNotBreakAtReplacedElement))
{
initialize(start, end);
}
@@ -1746,7 +1748,7 @@ void CharacterIterator::advance(int count)
for (m_textIterator.advance(); !atEnd(); m_textIterator.advance()) {
int runLength = m_textIterator.length();
if (!runLength) {
- m_atBreak = true;
+ m_atBreak = m_textIterator.breaksAtReplacedElement();
} else {
// see whether this is m_textIterator to use
if (count < runLength) {
@@ -2376,7 +2378,7 @@ tryAgain:
return matchLength;
}
-static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextIteratorEntersTextControls | TextIteratorEntersAuthorShadowRoots;
+static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextIteratorEntersTextControls | TextIteratorEntersAuthorShadowRoots | TextIteratorDoesNotBreakAtReplacedElement;
PassRefPtrWillBeRawPtr<Range> findPlainText(const Range* range, const String& target, FindOptions options)
{
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698