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

Issue 418133003: Call insertedInto or removedFrom before childrenChanged (Closed)

Created:
6 years, 5 months ago by esprehn
Modified:
6 years, 5 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Project:
blink
Visibility:
Public.

Description

Call insertedInto or removedFrom before childrenChanged We must notify nodes that they were removed before calling childrenChanged because childrenChanged could run script. If don't then the script can remove the parent and then Element::removedFrom doesn't think the parent is inTreeScope or inDocument so it'll fail to clean up the TreeScope hash maps like the id map. I tried this once before for a different reason in: https://src.chromium.org/viewvc/blink?revision=175732&view=revision but that got rolled out because it caused crashes http://crbug.com/382160 By looking at the code it appears that the reason for this is that m_element in the WebPluginContainerImpl is a raw ptr, and so nothing is keeping the element alive inside the UpdateSuspendScope. In this patch I didn't remove the NodeVector, a future patch will attempt to do that. Unfortunately even when I did remove the NodeVector I couldn't reproduce the crashes mentioned in the bug, but by code inspection and the crash stacks it appears to be the situation I described. BUG=387389 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178976

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use js-test harness and fix merge conflict #

Patch Set 3 : Fix option elements. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -27 lines) Patch
A LayoutTests/fast/dom/script-remove-child-id-map.html View 1 1 chunk +30 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/script-remove-child-id-map-expected.txt View 1 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/dom/ContainerNode.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 9 chunks +31 lines, -22 lines 0 comments Download
M Source/core/html/HTMLOptionElement.cpp View 1 2 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 19 (0 generated)
esprehn
6 years, 5 months ago (2014-07-24 21:17:40 UTC) #1
adamk
https://codereview.chromium.org/418133003/diff/1/LayoutTests/fast/dom/script-remove-child-id-map.html File LayoutTests/fast/dom/script-remove-child-id-map.html (right): https://codereview.chromium.org/418133003/diff/1/LayoutTests/fast/dom/script-remove-child-id-map.html#newcode5 LayoutTests/fast/dom/script-remove-child-id-map.html:5: function gc() Please include ../../resources/gc.js instead of rolling your ...
6 years, 5 months ago (2014-07-24 21:35:59 UTC) #2
esprehn
https://codereview.chromium.org/418133003/diff/1/LayoutTests/fast/dom/script-remove-child-id-map.html File LayoutTests/fast/dom/script-remove-child-id-map.html (right): https://codereview.chromium.org/418133003/diff/1/LayoutTests/fast/dom/script-remove-child-id-map.html#newcode5 LayoutTests/fast/dom/script-remove-child-id-map.html:5: function gc() done. https://codereview.chromium.org/418133003/diff/1/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/418133003/diff/1/Source/core/dom/ContainerNode.cpp#newcode756 Source/core/dom/ContainerNode.cpp:756: ...
6 years, 5 months ago (2014-07-24 22:50:19 UTC) #3
esprehn
On 2014/07/24 at 22:50:19, esprehn wrote: > .. > > https://codereview.chromium.org/418133003/diff/1/Source/core/dom/ContainerNode.cpp#newcode786 > Source/core/dom/ContainerNode.cpp:786: // ShadowRoots ...
6 years, 5 months ago (2014-07-24 22:51:13 UTC) #4
adamk
lgtm Thanks for the explanation of the ShadowRoot code, I didn't realize it was getting ...
6 years, 5 months ago (2014-07-24 23:45:14 UTC) #5
esprehn
On 2014/07/24 at 23:45:14, adamk wrote: > lgtm > > Thanks for the explanation of ...
6 years, 5 months ago (2014-07-24 23:49:54 UTC) #6
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 5 months ago (2014-07-25 00:56:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/418133003/20001
6 years, 5 months ago (2014-07-25 00:56:39 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 5 months ago (2014-07-25 02:27:12 UTC) #9
esprehn
The CQ bit was unchecked by esprehn@chromium.org
6 years, 5 months ago (2014-07-25 03:32:12 UTC) #10
esprehn
On 2014/07/25 at 03:32:12, esprehn wrote: > The CQ bit was unchecked by esprehn@chromium.org Sigh, ...
6 years, 5 months ago (2014-07-25 03:32:57 UTC) #11
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 5 months ago (2014-07-25 22:07:50 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/418133003/40001
6 years, 5 months ago (2014-07-25 22:08:42 UTC) #13
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 5 months ago (2014-07-25 22:55:20 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-25 23:03:37 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/17747)
6 years, 5 months ago (2014-07-25 23:03:38 UTC) #16
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 5 months ago (2014-07-26 00:35:39 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/418133003/40001
6 years, 5 months ago (2014-07-26 00:36:57 UTC) #18
commit-bot: I haz the power
6 years, 5 months ago (2014-07-26 05:11:47 UTC) #19
Message was sent while issue was closed.
Change committed as 178976

Powered by Google App Engine
This is Rietveld 408576698