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

Issue 332173003: Update owner document of Range objects if start/end boundary points in different document (Closed)

Created:
6 years, 6 months ago by yosin_UTC9
Modified:
6 years, 6 months ago
Reviewers:
yoichio, Yuta Kitamura
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, sof, eae+blinkwatch, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Update owner document of Range objects if start/end boundary points in different document This patch updates owner document of Range objects when orphan Node object moved to another document in new member function |Range::updateOwnerDocumentIfNeeded|. Note: when we move non-null parent Node object to another document, it is done by removeChild and appendChild and Range objects to reset to start of document. The root cause of issue 350362 is boundary points of Range objects isn't adjusted when owner document of Range and boundary points are different. Because |Range::nodeChildrenChanged|, which adjusts boundary points for |Node.appendChild|, is called for Range objects in another document which isn't owner of Range. This patch also updates "move-detached-child-in-range.html" to have right value. BUG=350362 TEST=LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html TEST=LayoutTests/fast/dom/move-detached-child-in-range.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176410

Patch Set 1 : 2014-06-17T06:07:48 #

Total comments: 8

Patch Set 2 : 2014-06-18T05:53:53 #

Total comments: 4

Patch Set 3 : 2014-06-18T06:46:10 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -1 line) Patch
A LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html View 1 chunk +31 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M LayoutTests/fast/dom/move-detached-child-in-range-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Range.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Range.cpp View 2 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
yosin_UTC9
Could you review this patch? Thanks in advance. Note: "linux_blink_dbg" bot failure doesn't relate to ...
6 years, 6 months ago (2014-06-18 01:23:17 UTC) #1
Yuta Kitamura
https://codereview.chromium.org/332173003/diff/80001/Source/core/dom/Range.cpp File Source/core/dom/Range.cpp (right): https://codereview.chromium.org/332173003/diff/80001/Source/core/dom/Range.cpp#newcode1557 Source/core/dom/Range.cpp:1557: m_ownerDocument->attachRange(this); I'm not sure migrating to another document is ...
6 years, 6 months ago (2014-06-18 03:22:37 UTC) #2
yosin_UTC9
On 2014/06/18 03:22:37, Yuta Kitamura wrote: > https://codereview.chromium.org/332173003/diff/80001/Source/core/dom/Range.cpp > File Source/core/dom/Range.cpp (right): > > https://codereview.chromium.org/332173003/diff/80001/Source/core/dom/Range.cpp#newcode1557 ...
6 years, 6 months ago (2014-06-18 05:50:42 UTC) #3
Yuta Kitamura
On 2014/06/18 05:50:42, yosi wrote: > Regarding section 9.3 DOM Ranges in http://dom.spec.whatwg.org/, it says: ...
6 years, 6 months ago (2014-06-18 06:09:48 UTC) #4
Yuta Kitamura
I started to think this change is okay. Please make your change description clear that ...
6 years, 6 months ago (2014-06-18 07:48:27 UTC) #5
yosin_UTC9
On 2014/06/18 06:09:48, Yuta Kitamura wrote: > On 2014/06/18 05:50:42, yosi wrote: > > Regarding ...
6 years, 6 months ago (2014-06-18 08:24:24 UTC) #6
yosin_UTC9
PTAL https://codereview.chromium.org/332173003/diff/80001/LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html File LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html (right): https://codereview.chromium.org/332173003/diff/80001/LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html#newcode16 LayoutTests/fast/dom/Range/range-extract-contents-after-move-to-another-document-crash.html:16: target.removeChild(child3); On 2014/06/18 07:48:27, Yuta Kitamura wrote: > ...
6 years, 6 months ago (2014-06-18 08:55:41 UTC) #7
Yuta Kitamura
LGTM with nits. There is one accidental edit of comments in the new patch set. ...
6 years, 6 months ago (2014-06-18 09:30:29 UTC) #8
yosin_UTC9
Thanks for reviewing with deep thinking. Committing... https://codereview.chromium.org/332173003/diff/120001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/332173003/diff/120001/Source/core/dom/Document.cpp#newcode3776 Source/core/dom/Document.cpp:3776: if (!m_ranges.isEmpty()) ...
6 years, 6 months ago (2014-06-18 09:52:33 UTC) #9
yosin_UTC9
The CQ bit was checked by yosin@chromium.org
6 years, 6 months ago (2014-06-18 09:52:38 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yosin@chromium.org/332173003/130009
6 years, 6 months ago (2014-06-18 09:53:44 UTC) #11
commit-bot: I haz the power
6 years, 6 months ago (2014-06-18 12:20:31 UTC) #12
Message was sent while issue was closed.
Change committed as 176410

Powered by Google App Engine
This is Rietveld 408576698