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

Issue 25571006: Fix out-of-date offset in selection range code. (Closed)

Created:
7 years, 2 months ago by Stephen Chennney
Modified:
7 years, 2 months ago
Reviewers:
tkent, ojan, yosin_UTC9, inferno
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Fix out-of-date offset in selection range code. Code in Range::insertNode assumes that the start offset of the selection range within its container does not change across a call to insertBefore on the container, which is not true. This patch recomputes the start offset when it is used after the insertBefore call. R=ojan@chromium.org, infernosec, ojan BUG=299993 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158859 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158989

Patch Set 1 #

Total comments: 1

Patch Set 2 : Updated test #

Patch Set 3 : Test with description. #

Total comments: 10

Patch Set 4 : Fixed the test. Ready to commit. #

Total comments: 1

Patch Set 5 : Better test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -20 lines) Patch
M LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html View 1 2 3 4 1 chunk +14 lines, -16 lines 0 comments Download
M LayoutTests/editing/selection/range-surroundContents-with-preceding-node-expected.txt View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
inferno
7 years, 2 months ago (2013-10-02 15:26:05 UTC) #1
Stephen Chennney
On 2013/10/02 15:26:05, inferno wrote: Did you mean to say something? :-)
7 years, 2 months ago (2013-10-02 17:56:13 UTC) #2
ojan
The C++ side looks good. https://codereview.chromium.org/25571006/diff/1/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html File LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html (right): https://codereview.chromium.org/25571006/diff/1/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html#newcode11 LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html:11: setTimeout(function(){ Is this setTimeout ...
7 years, 2 months ago (2013-10-02 17:56:34 UTC) #3
Stephen Chennney
On 2013/10/02 17:56:34, ojan wrote: > The C++ side looks good. > > https://codereview.chromium.org/25571006/diff/1/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html > ...
7 years, 2 months ago (2013-10-02 19:54:27 UTC) #4
yosin_UTC9
https://codereview.chromium.org/25571006/diff/12001/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html File LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html (right): https://codereview.chromium.org/25571006/diff/12001/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html#newcode6 LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html:6: var oSelection=window.getSelection(); nit: indentation of JavaScript should be four ...
7 years, 2 months ago (2013-10-03 01:41:19 UTC) #5
ojan
lgtm https://codereview.chromium.org/25571006/diff/12001/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html File LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html (right): https://codereview.chromium.org/25571006/diff/12001/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html#newcode10 LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html:10: var oParentElement = aoElements[5]; It would be easier ...
7 years, 2 months ago (2013-10-03 02:15:14 UTC) #6
Stephen Chennney
Thanks for the detailed review. The test is definitely much much clearer now. And no, ...
7 years, 2 months ago (2013-10-03 20:38:27 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/schenney@chromium.org/25571006/20001
7 years, 2 months ago (2013-10-03 20:39:21 UTC) #8
yosin_UTC9
shouldBe() family functions use eval() for parameters, so we need to declare variables on toplevel. ...
7 years, 2 months ago (2013-10-04 01:26:36 UTC) #9
commit-bot: I haz the power
Change committed as 158859
7 years, 2 months ago (2013-10-04 01:31:48 UTC) #10
Stephen Chennney
I've improved the test, and now learned lots about js tests.
7 years, 2 months ago (2013-10-04 21:45:49 UTC) #11
ojan
lgtm
7 years, 2 months ago (2013-10-04 21:47:58 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/schenney@chromium.org/25571006/36001
7 years, 2 months ago (2013-10-05 13:51:44 UTC) #13
Stephen Chennney
7 years, 2 months ago (2013-10-05 13:54:15 UTC) #14
Message was sent while issue was closed.
Committed patchset #5 manually as r158989 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698