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

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

Issue 2888463002: Refactor some first-letter handling code in TextIterator (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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void ExitNode(); 133 void ExitNode();
134 bool ShouldRepresentNodeOffsetZero(); 134 bool ShouldRepresentNodeOffsetZero();
135 bool ShouldEmitSpaceBeforeAndAfterNode(Node*); 135 bool ShouldEmitSpaceBeforeAndAfterNode(Node*);
136 void RepresentNodeOffsetZero(); 136 void RepresentNodeOffsetZero();
137 bool HandleTextNode(); 137 bool HandleTextNode();
138 bool HandleReplacedElement(); 138 bool HandleReplacedElement();
139 bool HandleNonTextNode(); 139 bool HandleNonTextNode();
140 void HandleTextBox(); 140 void HandleTextBox();
141 void HandleTextNodeFirstLetter(LayoutTextFragment*); 141 void HandleTextNodeFirstLetter(LayoutTextFragment*);
142 bool ShouldHandleFirstLetter(const LayoutText&) const;
143 bool ShouldProceedToRemainingText() const;
144 void ProceedToRemainingText();
142 // Helper function during initialization. Returns true if the start position 145 // Helper function during initialization. Returns true if the start position
143 // is in a text node with first-letter, in which case it also sets up related 146 // is in a text node with first-letter, in which case it also sets up related
144 // parameters. Returns false otherwise. 147 // parameters. Returns false otherwise.
145 bool PrepareForFirstLetterInitialization(); 148 bool PrepareForFirstLetterInitialization();
146 bool HasNotAdvancedToStartPosition(); 149 bool HasNotAdvancedToStartPosition();
147 int AdjustedStartForFirstLetter(const Node&, const LayoutText&, int, int); 150 int AdjustedStartForFirstLetter(const Node&, const LayoutText&, int, int);
148 int AdjustedStartForRemainingText(const Node&, const LayoutText&, int, int); 151 int AdjustedStartForRemainingText(const Node&, const LayoutText&, int, int);
149 void SpliceBuffer(UChar, 152 void SpliceBuffer(UChar,
150 Node* text_node, 153 Node* text_node,
151 Node* offset_base_node, 154 Node* offset_base_node,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 TextIteratorAlgorithm<EditingStrategy>; 272 TextIteratorAlgorithm<EditingStrategy>;
270 extern template class CORE_EXTERN_TEMPLATE_EXPORT 273 extern template class CORE_EXTERN_TEMPLATE_EXPORT
271 TextIteratorAlgorithm<EditingInFlatTreeStrategy>; 274 TextIteratorAlgorithm<EditingInFlatTreeStrategy>;
272 275
273 using TextIterator = TextIteratorAlgorithm<EditingStrategy>; 276 using TextIterator = TextIteratorAlgorithm<EditingStrategy>;
274 using TextIteratorInFlatTree = TextIteratorAlgorithm<EditingInFlatTreeStrategy>; 277 using TextIteratorInFlatTree = TextIteratorAlgorithm<EditingInFlatTreeStrategy>;
275 278
276 } // namespace blink 279 } // namespace blink
277 280
278 #endif // TextIterator_h 281 #endif // TextIterator_h
OLDNEW
« 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