New issue
Advanced search Search tips

Issue 692038 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

TextIteratorBehavior::operator==() should return correct equality

Project Member Reported by yosin@chromium.org, Feb 14 2017

Issue description

We should use && instead of || in operator=() which is introduced by [1]


bool TextIteratorBehavior::operator==(const TextIteratorBehavior& other) const {
  return m_collapseTrailingSpace == other.m_collapseTrailingSpace ||
         m_doesNotBreakAtReplacedElement ==
             other.m_doesNotBreakAtReplacedElement ||
         m_emitsCharactersBetweenAllVisiblePositions ==
             other.m_emitsCharactersBetweenAllVisibl

...

[1] http://crrev.com/2657813002 (Introduce TextIteratorBehavior class

It is better to use

union {
  uint32_t allFlags;
  struct {
    unsigned doesNotBraekAtReplacement : 1;
    ...
  } bits;
} m_data;

For ease of adding new flags and make code simpler.

Note: As of Feb 14, 2017, TextIteratorBehavior::operator==() only used for DCHECK() in SimplifiedBackwardsTextIterator.


 
Status: Fixed (was: Available)

Sign in to add a comment