WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
77674
Move attribute storage from NamedNodeMap to ElementAttributeData
https://bugs.webkit.org/show_bug.cgi?id=77674
Summary
Move attribute storage from NamedNodeMap to ElementAttributeData
Caio Marcelo de Oliveira Filho
Reported
2012-02-02 13:02:04 PST
Move attribute storage from NamedNodeMap to ElementAttributeData
Attachments
Patch
(119.28 KB, patch)
2012-02-02 13:04 PST
,
Caio Marcelo de Oliveira Filho
no flags
Details
Formatted Diff
Diff
Patch
(120.46 KB, patch)
2012-02-03 06:34 PST
,
Caio Marcelo de Oliveira Filho
no flags
Details
Formatted Diff
Diff
Patch
(39.90 KB, patch)
2012-02-10 03:58 PST
,
Caio Marcelo de Oliveira Filho
kling
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Caio Marcelo de Oliveira Filho
Comment 1
2012-02-02 13:04:11 PST
Created
attachment 125170
[details]
Patch
WebKit Review Bot
Comment 2
2012-02-02 14:03:34 PST
Comment on
attachment 125170
[details]
Patch
Attachment 125170
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/11389972
Caio Marcelo de Oliveira Filho
Comment 3
2012-02-03 06:34:41 PST
Created
attachment 125316
[details]
Patch
Caio Marcelo de Oliveira Filho
Comment 4
2012-02-03 13:48:16 PST
Comment on
attachment 125316
[details]
Patch After talking with rniwa and kling on IRC, we concluded this patch is too big. So the plan is to first remove the noise from it by making many of the clients of NamedNodeMap to interact with Element itself. IOW, expose a way to get Attribute* from Element. Then this patch for moving attribute storage will be smaller.
Caio Marcelo de Oliveira Filho
Comment 5
2012-02-10 03:58:17 PST
Created
attachment 126495
[details]
Patch
Caio Marcelo de Oliveira Filho
Comment 6
2012-02-10 04:03:01 PST
rniwa, as discussed I made this patch smaller by taking care of the noise in another patch. Compared to the previous one, I let two more things for separate changes: implementation of DOM methods (because I think they can move to Element itself, even make the code less redundant in some cases) and the parsing code that interacts with NamedNodeMap. Note that the first of those separate changes will "resolve" kling's issues with ExceptionCode appearing in ElementAttributeData in the previous patch. Could you take a look when you have time?
Andreas Kling
Comment 7
2012-02-13 03:30:25 PST
Comment on
attachment 126495
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=126495&action=review
r=me As suggested by Darin, we should rename ElementAttributeData to ElementAttributes at some point.
> Source/WebCore/dom/Attr.h:43 > friend class NamedNodeMap; > + friend class ElementAttributeData;
Nit: Alphabetical order.
> Source/WebCore/dom/Element.h:242 > + ElementAttributeData* ensureAttributeData() const; > + ElementAttributeData* updatedAttributeData() const; > + ElementAttributeData* ensureUpdatedAttributeData() const;
As discussed on IRC, we have way too many of these. It should be relatively easy to remove the need for ensureUpdatedAttributeData(), though not in the scope of this patch.
> Source/WebCore/dom/ElementAttributeData.cpp:170 > +void ElementAttributeData::clearAttributes() > +{ > + clearClass(); > + detachAttributesFromElement(); > + m_attributes.clear(); > +}
This method doesn't clear idForStyleResolution! I know you are just moving code around, so it's fine for this patch, but we need to fix this.
> Source/WebCore/dom/ElementAttributeData.cpp:172 > +void ElementAttributeData::replaceAttribute(size_t index, PassRefPtr<Attribute> prpAttribute, WebCore::Element* element)
No need for the WebCore:: prefix.
> Source/WebCore/dom/ElementAttributeData.h:57 > + bool isEmpty() const { return !length(); }
return m_attributes.isEmpty(); seems more straightforward.
Andreas Kling
Comment 8
2012-02-13 03:38:17 PST
(In reply to
comment #7
)
> (From update of
attachment 126495
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=126495&action=review
> > As suggested by Darin, we should rename ElementAttributeData to ElementAttributes at some point.
Actually, let's hold off on that as it clashes with the NamedNodeMap* Node::attributes() we expose to the web.
Caio Marcelo de Oliveira Filho
Comment 9
2012-02-13 07:04:15 PST
Committed
r107570
: <
http://trac.webkit.org/changeset/107570
>
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