WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 73121
Factor element pointer out of CSSMutableStyleDeclaration.
https://bugs.webkit.org/show_bug.cgi?id=73121
Summary
Factor element pointer out of CSSMutableStyleDeclaration.
Andreas Kling
Reported
2011-11-25 03:53:33 PST
The element (StyledElement, to be precise) pointer in CSSMutableStyleDeclaration is really only needed by inline and mapped style declarations. We should factor this out somehow, to reduce the size and complexity of vanilla declarations.
Attachments
Proposed patch
(25.66 KB, patch)
2011-11-25 04:42 PST
,
Andreas Kling
koivisto
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2011-11-25 04:42:18 PST
Created
attachment 116599
[details]
Proposed patch First stab at this: move the element pointer to a CSSElementStyleDeclaration subclass (thin, lives next to CSSMutableStyleDeclaration) and let CSSMappedAttributeDeclaration inherit from it along with the new CSSInlineStyleDeclaration class.
Antti Koivisto
Comment 2
2011-11-25 05:11:36 PST
Comment on
attachment 116599
[details]
Proposed patch View in context:
https://bugs.webkit.org/attachment.cgi?id=116599&action=review
r=me, nice!
> Source/WebCore/css/CSSMutableStyleDeclaration.cpp:615 > + if (isElementStyleDeclaration() && static_cast<CSSElementStyleDeclaration*>(this)->element()) { > + StyledElement* element = static_cast<CSSElementStyleDeclaration*>(this)->element();
This could could live in CSSElementStyleDeclaration
> Source/WebCore/css/CSSMutableStyleDeclaration.h:179 > > +class CSSElementStyleDeclaration : public CSSMutableStyleDeclaration { > +public:
This should probably have a file of its own at some point.
> Source/WebCore/css/CSSStyleDeclaration.h:124 > + // CSSElementStyleDeclaration bits: > + bool m_isElementStyleDeclaration : 1; > + bool m_isInlineStyleDeclaration : 1;
Type enum would be another alternative. It might read slightly better in some places (like where the inline bit is passed down in constructor).
Andreas Kling
Comment 3
2011-11-25 06:57:55 PST
Committed
r101172
: <
http://trac.webkit.org/changeset/101172
>
Vsevolod Vlasov
Comment 4
2011-11-28 06:23:13 PST
This caused
https://bugs.webkit.org/show_bug.cgi?id=73213
Csaba Osztrogonác
Comment 5
2011-11-29 07:23:58 PST
(In reply to
comment #4
)
> This caused
https://bugs.webkit.org/show_bug.cgi?id=73213
and
https://bugs.webkit.org/show_bug.cgi?id=73227
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