[Webkit-unassigned] [Bug 73156] [Microdata] Implement HTMLPropertiesCollection collection.namedItem()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 30 03:33:40 PST 2012


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





--- Comment #12 from Arko Saha <nghq36 at motorola.com>  2012-01-30 03:33:40 PST ---
(In reply to comment #11)
My comments are inline.

> (From update of attachment 116969 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=116969&action=review
> 
> This patch confused me.  It looks like there's a bunch of extra code in here that we don't need anymore.  Am I confused?
> 
> > Source/WebCore/html/HTMLPropertiesCollection.cpp:202
> > +    // FIXME: HTML5 specifies that this should return PropertyNodeList.
> > +    return !namedItems.isEmpty() ? StaticNodeList::adopt(namedItems) : 0;
> 
> So, the nodelist this returns isn't live?  It's just static?

Yes. currently its static, similar as HTMLCollection::namedItem() implementation. HTML5 specifies that this should return PropertyNodeList which is yet to be implemented and will be covered in the upcoming patch.

> > Source/WebCore/html/HTMLPropertiesCollection.idl:44
> > +        NodeList namedItem(in DOMString name);
> 
> This isn't marked Custom anymore, but you still have the custom bindings code in your patch.  Can we remove that code?

namedItem() method is not custom here and I have removed the related code. The JS custom bindings code is needed for HasNameGetter support for HTMLPropertiesCollection.
example: element.properties['foo']

> > Source/WebCore/html/HTMLPropertiesCollection.h:54
> > +    bool canGetItemsForName(const String& name) const;
> 
> I'm confused.  Who calls this function?

This function is getting called from JS custom bindings. 

While retrieving collection[name] (element.properties['foo']) in JavaScript -> 
JSHTMLPropertiesCollection::getOwnPropertySlot() calls canGetItemsForName()[JSHTMLPropertiesCollectionCustom.cpp] to check if the items can be retrieved or not based on the name argument passed.

if (canGetItemsForName(exec, static_cast<HTMLPropertiesCollection*>(thisObject->impl()), propertyName)) {
    slot.setCustom(thisObject, thisObject->nameGetter);
    return true;
}

-- 
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