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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.h

Issue 1604783002: ALL-IN-ONE: Optimization to previousBoundary() and nextBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@progressive_accumulator
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
index 1262719d2b8ffffc4e32385e7f2203ba29487869..3393c803cb3bceb2a8989290f6db8e7f0339a0f6 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -54,6 +54,10 @@ template<typename Strategy>
class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
STACK_ALLOCATED();
public:
+
+ using PositionType = PositionTemplate<Strategy>;
+ static const TextIteratorDirection direction = TextIteratorDirection::TextIteratorForward;
+
// [start, end] indicates the document range that the iteration should take place within (both ends inclusive).
TextIteratorAlgorithm(const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end, TextIteratorBehaviorFlags = TextIteratorDefaultBehavior);
~TextIteratorAlgorithm();
@@ -75,6 +79,7 @@ public:
const TextIteratorTextState& text() const { return m_textState; }
int length() const { return m_textState.length(); }
+ UChar characterAt(unsigned index) const { return m_textState.characterAt(index); }
bool breaksAtReplacedElement() { return !(m_behavior & TextIteratorDoesNotBreakAtReplacedElement); }

Powered by Google App Engine
This is Rietveld 408576698