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

Side by Side Diff: third_party/WebKit/Source/platform/text/TextBreakIterator.h

Issue 2865903002: [LayoutNG] Inline margin/border/padding, inter-item breaking, and tests (Closed)
Patch Set: ikilpatrick review Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> 2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 next_breakable = NextBreakablePositionIgnoringNBSP(pos); 210 next_breakable = NextBreakablePositionIgnoringNBSP(pos);
211 } 211 }
212 } 212 }
213 return pos == next_breakable; 213 return pos == next_breakable;
214 } 214 }
215 215
216 inline bool IsBreakable(int pos, int& next_breakable) const { 216 inline bool IsBreakable(int pos, int& next_breakable) const {
217 return IsBreakable(pos, next_breakable, break_type_); 217 return IsBreakable(pos, next_breakable, break_type_);
218 } 218 }
219 219
220 inline bool IsBreakable(int pos) const {
221 int next_breakable = -1;
222 return IsBreakable(pos, next_breakable, break_type_);
223 }
224
220 // Returns the break opportunity at or after |offset|. 225 // Returns the break opportunity at or after |offset|.
221 unsigned NextBreakOpportunity(unsigned offset) const; 226 unsigned NextBreakOpportunity(unsigned offset) const;
222 227
223 // Returns the break opportunity at or before |offset|. 228 // Returns the break opportunity at or before |offset|.
224 unsigned PreviousBreakOpportunity(unsigned offset, unsigned min = 0) const; 229 unsigned PreviousBreakOpportunity(unsigned offset, unsigned min = 0) const;
225 230
226 private: 231 private:
227 void ReleaseIterator() const { 232 void ReleaseIterator() const {
228 if (iterator_) 233 if (iterator_)
229 ReleaseLineBreakIterator(iterator_); 234 ReleaseLineBreakIterator(iterator_);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 }; 307 };
303 308
304 // Counts the number of grapheme clusters. A surrogate pair or a sequence 309 // Counts the number of grapheme clusters. A surrogate pair or a sequence
305 // of a non-combining character and following combining characters is 310 // of a non-combining character and following combining characters is
306 // counted as 1 grapheme cluster. 311 // counted as 1 grapheme cluster.
307 PLATFORM_EXPORT unsigned NumGraphemeClusters(const String&); 312 PLATFORM_EXPORT unsigned NumGraphemeClusters(const String&);
308 313
309 } // namespace blink 314 } // namespace blink
310 315
311 #endif 316 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698