WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
121822
Move more style change code from RenderObject to RenderElement
https://bugs.webkit.org/show_bug.cgi?id=121822
Summary
Move more style change code from RenderObject to RenderElement
Antti Koivisto
Reported
2013-09-23 21:32:08 PDT
Very little of it is needed for RenderText.
Attachments
patch
(26.78 KB, patch)
2013-09-23 21:48 PDT
,
Antti Koivisto
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2013-09-23 21:48:07 PDT
Created
attachment 212424
[details]
patch
Darin Adler
Comment 2
2013-09-23 22:47:55 PDT
Comment on
attachment 212424
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=212424&action=review
> Source/WebCore/ChangeLog:11 > + RenderTexts are no longer registered as image clients. They don't need
This sentence ends right in the middle of
> Source/WebCore/rendering/RenderElement.h:36 > + virtual void setStyle(PassRefPtr<RenderStyle>);
I think you should mark this OVERRIDE, even though it’s "= 0" in the base class. Still useful to get an error if the function signatures don’t match. Like when we change from PassRefPtr to just RefPtr some day, if we do it wrong.
> Source/WebCore/rendering/RenderElement.h:82 > + virtual void styleWillChange(StyleDifference, const RenderStyle*); > + virtual void styleDidChange(StyleDifference, const RenderStyle*);
If not OVERRIDE then does this still need to be virtual? Do derived classes override this?
> Source/WebCore/rendering/RenderElement.h:106 > + void updateFillImages(const FillLayer*, const FillLayer*); > + void updateImage(StyleImage*, StyleImage*); > +#if ENABLE(CSS_SHAPES) > + void updateShapeImage(const ShapeValue*, const ShapeValue*); > +#endif > + StyleDifference adjustStyleDifference(StyleDifference, unsigned contextSensitiveProperties) const;
I’d like this better with a blank line after the #endif.
> Source/WebCore/rendering/RenderText.cpp:203 > +void RenderText::setStyle(PassRefPtr<RenderStyle> style)
Since RenderText objects inherit their style from their parents, isn’t there something even more efficient we can do?
> Source/WebCore/rendering/RenderText.cpp:210 > + if (oldStyle.get())
Should not need a .get() here.
> Source/WebCore/rendering/RenderText.h:154 > + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
Why is this still virtual, if it’s not an override? Are there classes derived from RenderText that override this?
Antti Koivisto
Comment 3
2013-09-24 04:44:48 PDT
> This sentence ends right in the middle of
That's because I
> I think you should mark this OVERRIDE, even though it’s "= 0" in the base class. Still useful to get an error if the function signatures don’t match. Like when we change from PassRefPtr to just RefPtr some day, if we do it wrong.
Yeah.
> > > Source/WebCore/rendering/RenderElement.h:82 > > + virtual void styleWillChange(StyleDifference, const RenderStyle*); > > + virtual void styleDidChange(StyleDifference, const RenderStyle*); > > If not OVERRIDE then does this still need to be virtual? Do derived classes override this?
Yes, they have overrides.
> Since RenderText objects inherit their style from their parents, isn’t there something even more efficient we can do?
The plan is to move m_style pointer to RenderElement and have RenderText just use the parent style. That will require a few more patches.
> > Source/WebCore/rendering/RenderText.h:154 > > + virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); > > Why is this still virtual, if it’s not an override? Are there classes derived from RenderText that override this?
Surprisingly there are RenderText subclasses and there is an override for this.
Antti Koivisto
Comment 4
2013-09-24 05:21:28 PDT
https://trac.webkit.org/r156325
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug