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

Side by Side Diff: Source/core/editing/TextIterator.h

Issue 342483002: The length of a TextIterator containing replaced element is at least 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix dummy whitespace issue. Created 6 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) 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 class TextIterator { 77 class TextIterator {
78 STACK_ALLOCATED(); 78 STACK_ALLOCATED();
79 public: 79 public:
80 explicit TextIterator(const Range*, TextIteratorBehaviorFlags = TextIterator DefaultBehavior); 80 explicit TextIterator(const Range*, TextIteratorBehaviorFlags = TextIterator DefaultBehavior);
81 // [start, end] indicates the document range that the iteration should take place within (both ends inclusive). 81 // [start, end] indicates the document range that the iteration should take place within (both ends inclusive).
82 TextIterator(const Position& start, const Position& end, TextIteratorBehavio rFlags = TextIteratorDefaultBehavior); 82 TextIterator(const Position& start, const Position& end, TextIteratorBehavio rFlags = TextIteratorDefaultBehavior);
83 ~TextIterator(); 83 ~TextIterator();
84 84
85 bool atEnd() const { return !m_positionNode || m_shouldStop; } 85 bool atEnd() const { return !m_positionNode || m_shouldStop; }
86 void advance(); 86 void advance();
87 bool isInsideReplacedElement() const;
87 88
88 int length() const { return m_textLength; } 89 int length() const { return m_textLength; }
89 UChar characterAt(unsigned index) const; 90 UChar characterAt(unsigned index) const;
90 String substring(unsigned position, unsigned length) const; 91 String substring(unsigned position, unsigned length) const;
91 void appendTextToStringBuilder(StringBuilder&, unsigned position = 0, unsign ed maxLength = UINT_MAX) const; 92 void appendTextToStringBuilder(StringBuilder&, unsigned position = 0, unsign ed maxLength = UINT_MAX) const;
92 93
93 template<typename BufferType> 94 template<typename BufferType>
94 void appendTextTo(BufferType& output, unsigned position = 0) 95 void appendTextTo(BufferType& output, unsigned position = 0)
95 { 96 {
96 ASSERT_WITH_SECURITY_IMPLICATION(position <= static_cast<unsigned>(lengt h())); 97 ASSERT_WITH_SECURITY_IMPLICATION(position <= static_cast<unsigned>(lengt h()));
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 Vector<UChar> m_buffer; 368 Vector<UChar> m_buffer;
368 // Did we have to look ahead in the textIterator to confirm the current chun k? 369 // Did we have to look ahead in the textIterator to confirm the current chun k?
369 bool m_didLookAhead; 370 bool m_didLookAhead;
370 RefPtrWillBeMember<Range> m_range; 371 RefPtrWillBeMember<Range> m_range;
371 TextIterator m_textIterator; 372 TextIterator m_textIterator;
372 }; 373 };
373 374
374 } 375 }
375 376
376 #endif 377 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698