Chromium Code Reviews
DescriptionboundaryTextInserted/Removed() should not call markValid() for irrelavent changes
This patch fixes a bug related to the maintenance of RangeBoundaryPoint. Example:
Let body's content be "<div>foo<span>bar</span></foo>", and a range be created as
from (<span>, 0) to (<div>, 2). Then there are two updates:
1. Insert a new sibling before the text node "foo"
2. Insert/Remove characters in the text node "foo"
In the current implementation, step 2 incorrectly marks the boundary points of
the range as up-to-date without actually updating the stored offsets in it, making
the change in step 1 ignored. Then if we call |range->endPosition()|, we still get
(<div>, 2) instead of (<div>, 3), finding the range in an inconsistent state.
This patch ensures that boundaryTextInserted/Removed() only calls markValid()
when the current RangeBoundaryPoints's container is the CharacterData node
where text is inserted/removed, and irrelevant RangeBoundaryPoints should not
be changed.
BUG=639184
Review-Url: https://codereview.chromium.org/2254423002
Cr-Commit-Position: refs/heads/master@{#413104}
(cherry picked from commit 8cdfdf011fb08fd2dda2d02c2b89bb7f08a53272)
Committed: https://chromium.googlesource.com/chromium/src/+/566ac45e693fb76a0dd6ff84f489e5287bf2c055
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||