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

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

Issue 2894263003: WIP TextIterator with clean collapsed whitespace handling (Closed)
Patch Set: Created 3 years, 7 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 | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86efdcbbdd633f36861edb6af42683d5e653a1ff..932fe3b0e976d0ca1c8832fab12023f61c702d72 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -112,7 +112,7 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
static bool ShouldEmitTabBeforeNode(Node*);
static bool ShouldEmitNewlineBeforeNode(Node&);
static bool ShouldEmitNewlineAfterNode(Node&);
- static bool ShouldEmitNewlineForNode(Node*, bool emits_original_text);
+ static bool ShouldEmitNewlineForNode(Node*, bool = false);
static bool SupportsAltText(Node*);
@@ -135,6 +135,7 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
bool ShouldEmitSpaceBeforeAndAfterNode(Node*);
void RepresentNodeOffsetZero();
bool HandleTextNode();
+ bool HandlePreFormattedTextNode();
bool HandleReplacedElement();
bool HandleNonTextNode();
void HandleTextBox();
@@ -142,6 +143,14 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
bool ShouldHandleFirstLetter(const LayoutText&) const;
bool ShouldProceedToRemainingText() const;
void ProceedToRemainingText();
+ void ProceedToNextTextBox();
+ bool MayHaveMoreTextRuns() const;
+ void HandleNextTextRun();
+
+ // Return true if any white space character needs to be emitted.
+// bool HandleCollapsedLeadingWhiteSpaces();
+// bool HandleCollapsedTrailingWhiteSpaces();
+
void SpliceBuffer(UChar,
Node* text_node,
Node* offset_base_node,
@@ -151,50 +160,6 @@ class CORE_TEMPLATE_CLASS_EXPORT TextIteratorAlgorithm {
LayoutText* layout_object,
int text_start_offset,
int text_end_offset);
- size_t RestoreCollapsedTrailingSpace(InlineTextBox* next_text_box,
- size_t subrun_end);
-
- // Used by selection preservation code. There should be one character emitted
- // between every VisiblePosition in the Range used to create the TextIterator.
- // FIXME <rdar://problem/6028818>: This functionality should eventually be
- // phased out when we rewrite moveParagraphs to not clone/destroy moved
- // content.
- bool EmitsCharactersBetweenAllVisiblePositions() const {
- return behavior_.EmitsCharactersBetweenAllVisiblePositions();
- }
-
- bool EntersTextControls() const { return behavior_.EntersTextControls(); }
-
- // Used in pasting inside password field.
- bool EmitsOriginalText() const { return behavior_.EmitsOriginalText(); }
-
- // Used when the visibility of the style should not affect text gathering.
- bool IgnoresStyleVisibility() const {
- return behavior_.IgnoresStyleVisibility();
- }
-
- // Used when the iteration should stop if form controls are reached.
- bool StopsOnFormControls() const { return behavior_.StopsOnFormControls(); }
-
- bool EmitsImageAltText() const { return behavior_.EmitsImageAltText(); }
-
- bool EntersOpenShadowRoots() const {
- return behavior_.EntersOpenShadowRoots();
- }
-
- bool EmitsObjectReplacementCharacter() const {
- return behavior_.EmitsObjectReplacementCharacter();
- }
-
- bool ExcludesAutofilledValue() const {
- return behavior_.ExcludeAutofilledValue();
- }
-
- bool DoesNotBreakAtReplacedElement() const {
- return behavior_.DoesNotBreakAtReplacedElement();
- }
-
- bool ForInnerText() const { return behavior_.ForInnerText(); }
bool IsBetweenSurrogatePair(int position) const;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698