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

Issue 1342503002: When style changes, set the LayoutObject as a client for all StyleImage loads. (Closed)

Created:
5 years, 3 months ago by Nate Chapin
Modified:
5 years, 3 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-layout_chromium.org, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

When style changes, set the LayoutObject as a client for all StyleImage loads. BUG=

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -1 line) Patch
M Source/core/layout/LayoutListItem.cpp View 1 2 chunks +12 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutObject.cpp View 1 2 chunks +16 lines, -0 lines 0 comments Download
M Source/core/style/ComputedStyle.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (3 generated)
Nate Chapin
I got looking at this for https://codereview.chromium.org/1304063016/, which allows for a cleaner and more general ...
5 years, 3 months ago (2015-09-11 21:35:51 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1342503002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1342503002/1
5 years, 3 months ago (2015-09-12 02:10:56 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/52123) linux_chromium_gn_rel on ...
5 years, 3 months ago (2015-09-12 05:11:33 UTC) #6
Nate Chapin
On 2015/09/11 21:35:51, Nate Chapin wrote: > I got looking at this for https://codereview.chromium.org/1304063016/, which ...
5 years, 3 months ago (2015-09-15 20:59:16 UTC) #7
esprehn
All this const_cast looks bad, I think you want to make contentData() not const? I'm ...
5 years, 3 months ago (2015-09-17 08:20:48 UTC) #8
Nate Chapin
5 years, 3 months ago (2015-09-22 20:24:07 UTC) #9
https://codereview.chromium.org/1342503002/diff/1/Source/core/layout/LayoutOb...
File Source/core/layout/LayoutObject.cpp (right):

https://codereview.chromium.org/1342503002/diff/1/Source/core/layout/LayoutOb...
Source/core/layout/LayoutObject.cpp:1853: updateImage(oldStyle ?
oldStyle->listStyleImage() : nullptr, m_style->listStyleImage());
On 2015/09/17 08:20:48, esprehn wrote:
> On 2015/09/11 at 21:35:50, Nate Chapin wrote:
> > It appears that this and only this needs to be after styleDidChange() If
> updateImage() triggers a memory cache hit for listStyleImage(), we will crash,
> because LayoutListMarker::imageChanged() assumes
> LayoutListMarker::styleDidChange() has been called first.
> 
> That needs a comment, also can we not move them all after or all before? Or
fix
> LayoutListMarker...
> 

Moved this logic to LayoutListItem, since listStyleImage() is only used in
LayoutListItem and LayoutListMarker, and LayoutListMarker already registers
itself.

https://codereview.chromium.org/1342503002/diff/1/Source/core/layout/LayoutOb...
Source/core/layout/LayoutObject.cpp:2495:
const_cast<StyleImage*>(toImageContentData(m_style->contentData())->image())->removeClient(this);
On 2015/09/17 08:20:48, esprehn wrote:
> This const_cast seems sketchy, why is it okay to cast away the const-ness and
> mutate from here?  Actually why is the image const at all here?

I was scared to change it. :)

Made ComputedStyle::contentData() non-const, since that seems benign.

Powered by Google App Engine
This is Rietveld 408576698