[webkit-reviews] review denied: [Bug 80269] [Microdata] Implement PropertyNodeList interface. : [Attachment 149279] Updated patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 26 00:04:16 PDT 2012


Ryosuke Niwa <rniwa at webkit.org> has denied Arko Saha <arko at motorola.com>'s
request for review:
Bug 80269: [Microdata] Implement PropertyNodeList interface.
https://bugs.webkit.org/show_bug.cgi?id=80269

Attachment 149279: Updated patch
https://bugs.webkit.org/attachment.cgi?id=149279&action=review

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=149279&action=review


> Source/WebCore/dom/DynamicNodeList.h:72
> -    void invalidateCache() { m_caches.reset(); }
> +    virtual void invalidateCache() { m_caches.reset(); }

We definitely shouldn't make this a virtual function. This function is hot when
inserting/removing nodes. r- because of this.

> Source/WebCore/dom/Node.cpp:2765
> +Vector<Element*> Node::getItemRefElements()
> +{
> +    ASSERT(isElementNode());

Can we add this to Element or HTMLElement instead?
Also, it's awfully inefficient to return a Vector. Consider making it an out
argument (i.e. Vector<Element*>&).

> Source/WebCore/dom/PropertyNodeList.cpp:117
> +    m_caches.rootedAtDocument =
toElement(ownerNode())->fastHasAttribute(itemrefAttr);

We should do this in DynamicNodeList::rootNode() instead. We should probably
refactor itemForwardsFromCurrent and itemBackwardsFromCurrent so that they
don't take rootNode() as an argument instead of calling it themselves.

> Source/WebCore/dom/PropertyNodeList.cpp:118
> +    m_isItemRefElementsCacheValid = false;

You should add this to DynamicNodeList::Caches directly.


More information about the webkit-reviews mailing list