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

Issue 721103002: Fix lfiespan of ScopedStyleResolver (Closed)

Created:
6 years, 1 month ago by kochi
Modified:
6 years, 1 month ago
Reviewers:
esprehn, hayato, tasak
CC:
dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Project:
blink
Visibility:
Public.

Description

Fix lifespan of ScopedStyleResolver When a Shadow Tree is moved between different documents (e.g. document <-> iframe), ScopedStyleResolver can remain registered from its original document, which can result in duplicate registration and possibly cause double-free etc. This CL fixes it by clearing a shadow tree's ScopedStyleResolver when the ShadowRoot is removed. BUG=427249 TEST=pass the new layout test Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185598

Patch Set 1 #

Total comments: 2

Patch Set 2 : Revert previous, add a layout test. (should fail at this point) #

Patch Set 3 : merge tasak's 730513002 (contains ProcessorInstruction fix) #

Patch Set 4 : rebase #

Patch Set 5 : add comment in layout test. #

Total comments: 6

Patch Set 6 : Fix for hayato's review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -7 lines) Patch
A LayoutTests/fast/dom/StyleSheet/resources/stylesheet-move-iframe1.xml View 1 1 chunk +1 line, -0 lines 0 comments Download
A LayoutTests/fast/dom/StyleSheet/resources/stylesheet-move-iframe2.html View 1 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html View 1 2 3 4 5 1 chunk +53 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash-expected.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 2 1 chunk +12 lines, -7 lines 0 comments Download

Messages

Total messages: 29 (12 generated)
kochi
Hi Takashi, Could you review?
6 years, 1 month ago (2014-11-13 06:35:34 UTC) #2
tasak
lgtm
6 years, 1 month ago (2014-11-13 07:56:15 UTC) #3
esprehn
Should we just implement ShadowRoot::didMoveToNewDocument? https://codereview.chromium.org/721103002/diff/1/Source/core/dom/TreeScopeAdopter.cpp File Source/core/dom/TreeScopeAdopter.cpp (right): https://codereview.chromium.org/721103002/diff/1/Source/core/dom/TreeScopeAdopter.cpp#newcode144 Source/core/dom/TreeScopeAdopter.cpp:144: // StyledScopeResolver may be ...
6 years, 1 month ago (2014-11-13 19:24:06 UTC) #5
kochi
https://codereview.chromium.org/721103002/diff/1/Source/core/dom/TreeScopeAdopter.cpp File Source/core/dom/TreeScopeAdopter.cpp (right): https://codereview.chromium.org/721103002/diff/1/Source/core/dom/TreeScopeAdopter.cpp#newcode144 Source/core/dom/TreeScopeAdopter.cpp:144: // StyledScopeResolver may be null because it is lazily ...
6 years, 1 month ago (2014-11-14 05:38:39 UTC) #6
tasak
On 2014/11/13 19:24:06, esprehn wrote: > Should we just implement ShadowRoot::didMoveToNewDocument? I created a patch ...
6 years, 1 month ago (2014-11-14 12:37:39 UTC) #7
kochi
On 2014/11/14 12:37:39, tasak wrote: > On 2014/11/13 19:24:06, esprehn wrote: > > Should we ...
6 years, 1 month ago (2014-11-17 07:48:36 UTC) #9
kochi
Updated the description. Takashi, please take another look.
6 years, 1 month ago (2014-11-19 07:08:21 UTC) #14
tasak
lgtm
6 years, 1 month ago (2014-11-19 07:10:39 UTC) #15
kochi
Thanks Takashi, Elliott or Hayato, could you take OWNERS look? Thanks,
6 years, 1 month ago (2014-11-19 08:10:52 UTC) #16
hayato
Is there a reliable way to reproduce this issue? I guess not, however, it's unclear ...
6 years, 1 month ago (2014-11-19 08:37:24 UTC) #17
kochi
On 2014/11/19 08:37:24, hayato wrote: > Is there a reliable way to reproduce this issue? ...
6 years, 1 month ago (2014-11-19 09:06:05 UTC) #18
hayato
Thank you for adding the comment. LGTM https://codereview.chromium.org/721103002/diff/180001/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html File LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html (right): https://codereview.chromium.org/721103002/diff/180001/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html#newcode38 LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html:38: marquee = ...
6 years, 1 month ago (2014-11-19 10:52:15 UTC) #20
kochi
Thanks for the review! https://codereview.chromium.org/721103002/diff/180001/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html File LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html (right): https://codereview.chromium.org/721103002/diff/180001/LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html#newcode38 LayoutTests/fast/dom/StyleSheet/stylesheet-move-between-documents-crash.html:38: marquee = document.createElement('marquee'); On 2014/11/19 ...
6 years, 1 month ago (2014-11-19 11:41:53 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/721103002/220001
6 years, 1 month ago (2014-11-19 11:46:40 UTC) #24
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/34424)
6 years, 1 month ago (2014-11-19 12:54:57 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/721103002/220001
6 years, 1 month ago (2014-11-19 14:18:32 UTC) #28
commit-bot: I haz the power
6 years, 1 month ago (2014-11-19 14:47:29 UTC) #29
Message was sent while issue was closed.
Committed patchset #6 (id:220001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=185598

Powered by Google App Engine
This is Rietveld 408576698