[Webkit-unassigned] [Bug 73074] StyleGeneratedImage should ref CSSImageGeneratorValue

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 25 05:14:07 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=73074





--- Comment #5 from Antti Koivisto <koivisto at iki.fi>  2011-11-25 05:14:07 PST ---
(In reply to comment #3)

> I don't like this kind of mechanic change, instead you could use a "decorator" which figures out the right type.
> template<typename T>
> struct Decorator {
>      typedef typename T Setter;
>      typedef typename T Getter;
> };
> 
> template<>
> struct Decorator<StyleImage> {
>     typedef typename PassRefPtr<StyleImage> Setter;
>     typedef typename StyleImage* Getter;
> };
> 
> What do you think?

Good idea. Did this.

> 
> > Source/WebCore/css/CSSStyleSelector.cpp:5775
> > +                        RefPtr<StyleImage> loadedImage = loadPendingImage(static_cast<StylePendingImage*>(backgroundLayer->image()));
> > +                        backgroundLayer->setImage(loadedImage.release());
> 
> I'd combine this to avoid a unncessary ref'ing.

I don't think there is unnecessary reffing as release() is used consistently. However you are right that the lines can be combined. Did some of this.

> If we handle null images in ImageContentData::setImage(), this could turn into a simple
> static_cast<ImageContentData*>(contentData)->setImage(loadPendingImage(…

I don't think that's a good idea. Setters that silently ignore some values (null in this case) are confusing. It might be a behavior change too.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list