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

Issue 199383004: Postpone mutation event dispatch in Selection.deleteFromDocument (Closed)

Created:
6 years, 9 months ago by yoichio
Modified:
6 years, 6 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Postpone mutation event dispatch in Selection.deleteFromDocument. A crash bug which an attached test case causes is following: 1. Selection.deleteFromDocument calls Range.deleteContents which removes a node through Node.removeChild. 2. Node.removeChild calls a DOMNodeRemoved event which removes the node. 3. Then Node.removeChild asserts a DOM exception NOT_FOUND_ERR. 4. Range.deleteContents picks the exception and it causes crash because Selection.deleteFromDocument calls Range.deleteContents with ASSERT_NO_EXCEPTION. This cl changes Selection.deleteFromDocument to delay the mutation event dispatching when it calls Range.deleteContents. Especially, DOMNodeRemoved will be not kicked. BUG=339186 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174944

Patch Set 1 #

Total comments: 3

Patch Set 2 : Scoping Range event #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -6 lines) Patch
A + LayoutTests/editing/selection/deleteFromDocument-scoped-dispatch-event-crash.html View 1 chunk +3 lines, -3 lines 0 comments Download
A + LayoutTests/editing/selection/deleteFromDocument-scoped-dispatch-event-crash-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/editing/selection/resources/deleteFromDocument-scoped-dispatch-event-crash-iframe.html View 1 chunk +28 lines, -0 lines 0 comments Download
M Source/core/dom/Range.cpp View 1 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
yoichio
6 years, 9 months ago (2014-03-19 06:53:38 UTC) #1
Yuta Kitamura
+Yoshi for second opinion https://codereview.chromium.org/199383004/diff/1/Source/core/page/DOMSelection.cpp File Source/core/page/DOMSelection.cpp (right): https://codereview.chromium.org/199383004/diff/1/Source/core/page/DOMSelection.cpp#newcode461 Source/core/page/DOMSelection.cpp:461: EventQueueScope eventQueueScope; I think this ...
6 years, 9 months ago (2014-03-19 06:57:51 UTC) #2
yosin_UTC9
https://codereview.chromium.org/199383004/diff/1/LayoutTests/editing/selection/resources/deleteFromDocument-scoped-dispatch-event-crash-iframe.html File LayoutTests/editing/selection/resources/deleteFromDocument-scoped-dispatch-event-crash-iframe.html (right): https://codereview.chromium.org/199383004/diff/1/LayoutTests/editing/selection/resources/deleteFromDocument-scoped-dispatch-event-crash-iframe.html#newcode5 LayoutTests/editing/selection/resources/deleteFromDocument-scoped-dispatch-event-crash-iframe.html:5: document.addEventListener("DOMNodeRemoved", function () { nit: Please use single quote ...
6 years, 9 months ago (2014-03-19 07:33:35 UTC) #3
yoichio
> > I think this should be done within Range::deleteContents(). Done.
6 years, 9 months ago (2014-03-20 05:35:24 UTC) #4
Yuta Kitamura
lgtm
6 years, 9 months ago (2014-03-20 06:03:32 UTC) #5
yoichio
The CQ bit was checked by yoichio@chromium.org
6 years, 9 months ago (2014-03-20 06:42:12 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoichio@chromium.org/199383004/20001
6 years, 9 months ago (2014-03-20 06:42:21 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 07:14:21 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-20 07:14:22 UTC) #9
yoichio
The CQ bit was checked by yoichio@chromium.org
6 years, 9 months ago (2014-03-20 23:35:56 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoichio@chromium.org/199383004/20001
6 years, 9 months ago (2014-03-20 23:36:04 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-21 00:08:24 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-21 00:08:25 UTC) #13
yoichio
The CQ bit was checked by yoichio@chromium.org
6 years, 6 months ago (2014-05-28 07:24:57 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoichio@chromium.org/199383004/20001
6 years, 6 months ago (2014-05-28 07:25:15 UTC) #15
commit-bot: I haz the power
6 years, 6 months ago (2014-05-28 08:10:59 UTC) #16
Message was sent while issue was closed.
Change committed as 174944

Powered by Google App Engine
This is Rietveld 408576698