Commit 6c2afab7 authored by xiaochengh's avatar xiaochengh Committed by Commit Bot

Move TextIteratorTextState's member initiailization to class declaration

This patch moves TextIteratorTextState's member initialization to the class
declaration, since they are all trivially initialized.

BUG=721957
TEST=n/a; no behavioral change

Review-Url: https://codereview.chromium.org/2922553002
Cr-Commit-Position: refs/heads/master@{#476511}
parent 6d3d62d3
...@@ -34,15 +34,7 @@ namespace blink { ...@@ -34,15 +34,7 @@ namespace blink {
TextIteratorTextState::TextIteratorTextState( TextIteratorTextState::TextIteratorTextState(
const TextIteratorBehavior& behavior) const TextIteratorBehavior& behavior)
: text_length_(0), : behavior_(behavior) {}
single_character_buffer_(0),
position_node_(nullptr),
position_start_offset_(0),
position_end_offset_(0),
has_emitted_(false),
last_character_(0),
behavior_(behavior),
text_start_offset_(0) {}
UChar TextIteratorTextState::CharacterAt(unsigned index) const { UChar TextIteratorTextState::CharacterAt(unsigned index) const {
SECURITY_DCHECK(index < static_cast<unsigned>(length())); SECURITY_DCHECK(index < static_cast<unsigned>(length()));
......
...@@ -82,31 +82,31 @@ class CORE_EXPORT TextIteratorTextState { ...@@ -82,31 +82,31 @@ class CORE_EXPORT TextIteratorTextState {
unsigned length_to_append) const; unsigned length_to_append) const;
private: private:
int text_length_; int text_length_ = 0;
String text_; String text_;
// Used for whitespace characters that aren't in the DOM, so we can point at // Used for whitespace characters that aren't in the DOM, so we can point at
// them. // them.
// If non-zero, overrides m_text. // If non-zero, overrides m_text.
UChar single_character_buffer_; UChar single_character_buffer_ = 0;
// The current text and its position, in the form to be returned from the // The current text and its position, in the form to be returned from the
// iterator. // iterator.
Member<Node> position_node_; Member<Node> position_node_;
mutable Member<Node> position_offset_base_node_; mutable Member<Node> position_offset_base_node_;
mutable int position_start_offset_; mutable int position_start_offset_ = 0;
mutable int position_end_offset_; mutable int position_end_offset_ = 0;
// Used when deciding whether to emit a "positioning" (e.g. newline) before // Used when deciding whether to emit a "positioning" (e.g. newline) before
// any other content // any other content
bool has_emitted_; bool has_emitted_ = false;
UChar last_character_; UChar last_character_ = 0;
const TextIteratorBehavior behavior_; const TextIteratorBehavior behavior_;
// Stores the length of :first-letter when we are at the remaining text. // Stores the length of :first-letter when we are at the remaining text.
// Equals to 0 in all other cases. // Equals to 0 in all other cases.
int text_start_offset_; int text_start_offset_ = 0;
DISALLOW_COPY_AND_ASSIGN(TextIteratorTextState); DISALLOW_COPY_AND_ASSIGN(TextIteratorTextState);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment