[Webkit-unassigned] [Bug 80269] [Microdata] Implement PropertyNodeList interface.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 30 05:40:38 PDT 2012


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





--- Comment #10 from Arko Saha <nghq36 at motorola.com>  2012-03-30 05:40:38 PST ---
(In reply to comment #9)
> > Source/WebCore/bindings/js/JSMicroDataItemValueCustom.cpp:49
> > +    return jsString(exec, itemValue->getString());
> 
> Why does this return a string?  We have a MicroDataItemValue.idl in this file.  I would have expected it to return a MicroDataItemValue...

According to the spec http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#propertynodelist : getValues() method object must return a newly constructed array whose values are the values obtained from the itemValue DOM property. itemValue of a property depends on the element. Please check http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#dom-itemvalue.

For an example:

<div itemscope>
<a itemprop="foo" href="webkit.org"></a>
<p itemprop="foo" itemscope><span itemprop="quz"></p>
</div>

itemValue will return node itself if it has an itemscope attribute specified.
If the element is an <a> element then it will return src content attribute string.

<div> defines the microdata item with two properties <a> and <p>
Here itemValue of the first property is string "webkit.org" and second property is node <p> as it has itemscope attribute.
getValues() will return an array which contains a string and a node i.e, 'webkit.org' and '<p>'.

> > Source/WebCore/dom/PropertyNodeList.cpp:48
> > +        m_propertyValue.append(element->itemValue());
> 
> Is this going to keep appending to m_propertyValue every time this function is called?  That doesn't seem right.

Ok, we will cache m_propertyValue. so that it does not append to m_propertyValue every time.

> > Source/WebCore/dom/PropertyNodeList.cpp:66
> > +Node* PropertyNodeList::itemWithName(const AtomicString& id) const
> 
> itemWithName not itemWithID ?

Ok will modify.

> > Source/WebCore/dom/PropertyNodeList.h:52
> > +    PropertyValueArray getValues();
> 
> Is this going to thrash the RefCounts of the MicroDataItemValue?

I could not get this. Can you please explain a bit.

> > Source/WebCore/dom/PropertyNodeList.h:61
> > +    PropertyNodeList(Vector<RefPtr<Node> >& nodes)
> 
> Please add the explicit keyword.

Ok.

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