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

Issue 174293005: Fix crash in which elementData() might be null. (Closed)

Created:
6 years, 10 months ago by chrishtr
Modified:
6 years, 10 months ago
Reviewers:
pdr., esprehn, adamk, ojan
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Visibility:
Public.

Description

Fix crash in which elementData() might be null. The issue is that an SVG animation may animate the class attribute. SVG tracks attributes, including class, internally. But it still needs to track style recalc dependencies on class, so it hooks into the class change machinery in Element. In order to do so, however, elementData() mus be non-null, which requires calling invalidateSVGElement() while mutating class in the SVG code. BUG=345178 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167817

Patch Set 1 #

Total comments: 1

Patch Set 2 : Addressed comments. #

Patch Set 3 : Addressed comments. #

Total comments: 5

Patch Set 4 : Addressed comment. #

Total comments: 2

Patch Set 5 : Fix test expectation. #

Total comments: 6

Patch Set 6 : Fixed. #

Patch Set 7 : Fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -5 lines) Patch
A LayoutTests/svg/dom/set-class-attribute.html View 1 2 3 4 5 1 chunk +15 lines, -0 lines 0 comments Download
A + LayoutTests/svg/dom/set-class-attribute-expected.txt View 1 2 3 4 5 1 chunk +1 line, -3 lines 0 comments Download
M LayoutTests/svg/filters/feColorMatrix-invalid-animation-expected.txt View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/svg/SVGAnimateElement.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
chrishtr
6 years, 10 months ago (2014-02-21 01:17:15 UTC) #1
ojan
This needs a test. Also, I think Adam is a better reviewer for this than ...
6 years, 10 months ago (2014-02-21 03:11:28 UTC) #2
adamk
https://codereview.chromium.org/174293005/diff/1/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/174293005/diff/1/Source/core/dom/Element.cpp#newcode1090 Source/core/dom/Element.cpp:1090: if (elementData()) { This is crazy. No element should ...
6 years, 10 months ago (2014-02-21 03:33:50 UTC) #3
pdr.
> https://codereview.chromium.org/174293005/diff/1/Source/core/dom/Element.cpp > File Source/core/dom/Element.cpp (right): > > https://codereview.chromium.org/174293005/diff/1/Source/core/dom/Element.cpp#newcode1090 > Source/core/dom/Element.cpp:1090: if (elementData()) { > ...
6 years, 10 months ago (2014-02-21 06:01:48 UTC) #4
chrishtr
I changed it to use ensureUniqueElementData(). If you follow all of the paths to set ...
6 years, 10 months ago (2014-02-21 18:19:56 UTC) #5
pdr.
On 2014/02/21 18:19:56, Chris Harrelson wrote: > I changed it to use ensureUniqueElementData(). > > ...
6 years, 10 months ago (2014-02-22 02:05:41 UTC) #6
pdr.
The CQ bit was checked by pdr@chromium.org
6 years, 10 months ago (2014-02-22 02:06:00 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/80001
6 years, 10 months ago (2014-02-22 02:06:12 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-22 03:57:30 UTC) #9
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=19564
6 years, 10 months ago (2014-02-22 03:57:31 UTC) #10
esprehn
not lgtm, you should not be blindly calling ensureUniqueElementData(), that defeats the ShareableElementData optimization. Why ...
6 years, 10 months ago (2014-02-24 05:04:59 UTC) #11
pdr.
On 2014/02/24 05:04:59, esprehn wrote: > not lgtm, you should not be blindly calling ensureUniqueElementData(), ...
6 years, 10 months ago (2014-02-24 05:14:35 UTC) #12
esprehn
On 2014/02/24 05:14:35, pdr wrote: > On 2014/02/24 05:04:59, esprehn wrote: > > not lgtm, ...
6 years, 10 months ago (2014-02-24 05:31:33 UTC) #13
adamk
I don't have a full answer to esprehn's question, but I can answer "how" we ...
6 years, 10 months ago (2014-02-24 18:41:24 UTC) #14
chrishtr
I changed the code to invalidate SVG attributes when starting SVG animations. invalidateSVGAttributes() will cause ...
6 years, 10 months ago (2014-02-24 21:15:23 UTC) #15
adamk
https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp File Source/core/svg/SVGAnimateElement.cpp (right): https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp#newcode205 Source/core/svg/SVGAnimateElement.cpp:205: targetElement->invalidateSVGAttributes(); Why did you put this here instead of ...
6 years, 10 months ago (2014-02-24 21:33:00 UTC) #16
chrishtr
https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp File Source/core/svg/SVGAnimateElement.cpp (right): https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp#newcode205 Source/core/svg/SVGAnimateElement.cpp:205: targetElement->invalidateSVGAttributes(); On 2014/02/24 21:33:01, adamk wrote: > Why did ...
6 years, 10 months ago (2014-02-24 21:46:19 UTC) #17
adamk
Yes, I'm basically asking you to go back toward what the original change did, though ...
6 years, 10 months ago (2014-02-24 22:21:47 UTC) #18
chrishtr
Done. https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp File Source/core/svg/SVGAnimateElement.cpp (right): https://codereview.chromium.org/174293005/diff/320001/Source/core/svg/SVGAnimateElement.cpp#newcode205 Source/core/svg/SVGAnimateElement.cpp:205: targetElement->invalidateSVGAttributes(); On 2014/02/24 21:46:19, Chris Harrelson wrote: > ...
6 years, 10 months ago (2014-02-24 22:30:46 UTC) #19
adamk
lgtm, but please update the CL description before landing
6 years, 10 months ago (2014-02-24 22:32:20 UTC) #20
adamk
https://codereview.chromium.org/174293005/diff/340001/LayoutTests/svg/dom/set-class-attribute.html File LayoutTests/svg/dom/set-class-attribute.html (right): https://codereview.chromium.org/174293005/diff/340001/LayoutTests/svg/dom/set-class-attribute.html#newcode4 LayoutTests/svg/dom/set-class-attribute.html:4: Test for crbug.com/345178: This test passes if it does ...
6 years, 10 months ago (2014-02-24 22:33:19 UTC) #21
chrishtr
https://codereview.chromium.org/174293005/diff/340001/LayoutTests/svg/dom/set-class-attribute.html File LayoutTests/svg/dom/set-class-attribute.html (right): https://codereview.chromium.org/174293005/diff/340001/LayoutTests/svg/dom/set-class-attribute.html#newcode4 LayoutTests/svg/dom/set-class-attribute.html:4: Test for crbug.com/345178: This test passes if it does ...
6 years, 10 months ago (2014-02-24 22:41:20 UTC) #22
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 10 months ago (2014-02-24 22:41:24 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/360001
6 years, 10 months ago (2014-02-24 22:41:36 UTC) #24
adamk
The CQ bit was unchecked by adamk@chromium.org
6 years, 10 months ago (2014-02-24 22:57:11 UTC) #25
adamk
The CQ bit was checked by adamk@chromium.org
6 years, 10 months ago (2014-02-24 22:57:18 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/360001
6 years, 10 months ago (2014-02-24 22:57:30 UTC) #27
adamk
The CQ bit was unchecked by adamk@chromium.org
6 years, 10 months ago (2014-02-24 22:57:48 UTC) #28
adamk
https://codereview.chromium.org/174293005/diff/360001/LayoutTests/svg/dom/set-class-attribute.html File LayoutTests/svg/dom/set-class-attribute.html (right): https://codereview.chromium.org/174293005/diff/360001/LayoutTests/svg/dom/set-class-attribute.html#newcode4 LayoutTests/svg/dom/set-class-attribute.html:4: <script src="../../resources/js-test.js"></script> Including this means you don't need... https://codereview.chromium.org/174293005/diff/360001/LayoutTests/svg/dom/set-class-attribute.html#newcode7 ...
6 years, 10 months ago (2014-02-24 22:58:47 UTC) #29
chrishtr
https://codereview.chromium.org/174293005/diff/360001/LayoutTests/svg/dom/set-class-attribute.html File LayoutTests/svg/dom/set-class-attribute.html (right): https://codereview.chromium.org/174293005/diff/360001/LayoutTests/svg/dom/set-class-attribute.html#newcode4 LayoutTests/svg/dom/set-class-attribute.html:4: <script src="../../resources/js-test.js"></script> On 2014/02/24 22:58:48, adamk wrote: > Including ...
6 years, 10 months ago (2014-02-24 23:05:22 UTC) #30
adamk
still lgtm (hopefully esprehn is ok with this; it definitely seems like there's some refactoring ...
6 years, 10 months ago (2014-02-24 23:08:08 UTC) #31
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 10 months ago (2014-02-24 23:12:53 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/380001
6 years, 10 months ago (2014-02-24 23:12:59 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/380001
6 years, 10 months ago (2014-02-25 01:08:48 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 02:39:18 UTC) #35
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=19778
6 years, 10 months ago (2014-02-25 02:39:18 UTC) #36
chrishtr
The CQ bit was checked by chrishtr@chromium.org
6 years, 10 months ago (2014-02-25 18:12:24 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chrishtr@chromium.org/174293005/400001
6 years, 10 months ago (2014-02-25 18:12:46 UTC) #38
commit-bot: I haz the power
6 years, 10 months ago (2014-02-25 19:38:41 UTC) #39
Message was sent while issue was closed.
Change committed as 167817

Powered by Google App Engine
This is Rietveld 408576698