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

Issue 2265853002: boundaryTextInserted/Removed() should not call markValid() for irrelavent changes (Closed)

Created:
4 years, 4 months ago by Xiaocheng
Modified:
4 years, 4 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2785
Target Ref:
refs/pending/branch-heads/2785
Project:
chromium
Visibility:
Public.

Description

boundaryTextInserted/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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M third_party/WebKit/Source/core/dom/Range.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
Xiaocheng
4 years, 4 months ago (2016-08-22 03:10:14 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
566ac45e693fb76a0dd6ff84f489e5287bf2c055.

Powered by Google App Engine
This is Rietveld 408576698