WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
91249
[Microdata] A microdata item should add the first element that matches the id specified in the itemref attribute.
https://bugs.webkit.org/show_bug.cgi?id=91249
Summary
[Microdata] A microdata item should add the first element that matches the id...
Arko Saha
Reported
2012-07-13 08:25:20 PDT
This has come up with
https://bugs.webkit.org/show_bug.cgi?id=80269#c33
According to the spec
http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#associating-names-with-items
(5.2.5.4), microdata item should add the first element that matches the id specified in the itemref attribute. Currently we add we add all elements that match the id. We should fix that (with a test). In addition, that means we can just use TreeScope::getElementById instead of traversing the entire tree scope.
Attachments
Add attachment
proposed patch, testcase, etc.
Arko Saha
Comment 1
2012-07-17 07:05:59 PDT
Lets take an small example: <div id="id1"> <p itemprop="foo" id="a"></p> </div> <section itemscope itemref="id2 id1"> <p itemprop="foo" id="b"></p> </section> <div id="id2"> <p itemprop="foo" id="c"></p> </div> Here <section> has itemscope attribute, its a microdata item. item.properties.namedItem(foo) must return a PropertyNodeList object containing three <p> elements with id- a, b, c respectively. it should be in the tree order. With itemref attribute we can add additional properties. These itemref id may appear in random order. But we have to make sure that properties added with itemref must be in treeorder while adding in itemRefElement list. If we find the itemref elements using TreeScope::getElementById, then we need to sort them in tree order. We have already discussed the same in
https://bugs.webkit.org/show_bug.cgi?id=80490
As per the discussion sorting is not recommended as its an expensive operation. So we have decided to traverse the DOM and collect the elements with the itemref ids in the document order. I think its better to traverse the entire document and collect itemref elements in the document order instead of sorting as sorting is very inefficient. Also please note that currently we add the first element only that matches the id specified in the itemref attribute. We do not add all the elements that matches the ref id. We have a test to ensure the same : fast/dom/MicroData/itemref-refers-first-element-with-given-id.html
Ryosuke Niwa
Comment 2
2012-07-17 10:56:08 PDT
So this bug is invalid?
Arko Saha
Comment 3
2012-07-23 05:21:05 PDT
(In reply to
comment #2
)
> So this bug is invalid?
Yes, this is an invalid bug.
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