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

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

Issue 2541163003: Fix TextIterator's behavior with first-letter (Closed)
Patch Set: Change relevant bug number Created 4 years 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 92a004942be699cf510908f7a81f7e4840795c6f..6da02720e0a95586911d8b7acf75977b8b04c7b0 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -138,6 +138,10 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
bool handleNonTextNode();
void handleTextBox();
void handleTextNodeFirstLetter(LayoutTextFragment*);
+ bool prepareForFirstLetterInitialization();
yosin_UTC9 2016/12/01 09:41:42 Could you add a comment to explain what |bool| res
Xiaocheng 2016/12/01 10:09:56 Done.
+ bool hasNotAdvancedToStartPosition();
+ int adjustedStartForFirstLetter(Node*, LayoutText*, int, int);
+ int adjustedStartForRemainingText(Node*, LayoutText*, int, int);
void spliceBuffer(UChar,
Node* textNode,
Node* offsetBaseNode,
@@ -257,6 +261,11 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
// |SelectionToStringWithShadowTree|, we should not use other purpose.
bool m_handleShadowRoot;
+ // Used for adjusting the initialization and the output when the start
+ // container is a text node with :first-letter.
+ int m_firstLetterStartOffset;
+ int m_remainingTextStartOffset;
+
// Contains state of emitted text.
TextIteratorTextState m_textState;
};

Powered by Google App Engine
This is Rietveld 408576698