<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17195</bug_id>
          
          <creation_ts>2012-05-25 19:33:00 +0000</creation_ts>
          <short_desc>Definition of .properties does not match implementation reality</short_desc>
          <delta_ts>2013-02-08 01:36:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#microdata-dom-api</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>dzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68150</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-05-25 19:33:00 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
Multipage: http://www.whatwg.org/C#microdata-dom-api
Complete: http://www.whatwg.org/c#microdata-dom-api

Comment:
Definition of .properties does not match implementation reality

Posted from: 71.184.125.56 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/15.0 Firefox/15.0a1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68151</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-05-25 19:35:18 +0000</bug_when>
    <thetext>Specifically, this part:

  The properties IDL attribute on HTML elements must return an
  HTMLPropertiesCollection rooted at the Document node

combined with the fact that all the properties are in the element&apos;s home subtree would mean that elements that are not in the document should always have an empty .properties.

That doesn&apos;t seem to be terribly useful, and as far as I can tell Opera doesn&apos;t implement that.  Neither does the upcoming Gecko implementation.

See upcoming testcase: it would alert 0, then 2, if the spec was actually followed here.  In Opera it alerts 1, then 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70855</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:38:02 +0000</bug_when>
    <thetext>This bug was cloned to create bug 18194 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74249</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-21 20:09:49 +0000</bug_when>
    <thetext>It&apos;s intentional that .properties on elements not in a Document would be empty... not my fault y&apos;all can&apos;t follow the spec. :-P</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74256</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-21 20:16:58 +0000</bug_when>
    <thetext>bz: Do you still have the aforementioned testcase, by any chance?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78812</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-26 05:04:36 +0000</bug_when>
    <thetext>I don&apos;t have the testcase anymore, sorry.  It was just doing basic testing of what happens in a disconnected subtree.

I think the reason people didn&apos;t follow the spec as you wrote is threefold:

1) &quot;It doesn&apos;t seem to be terribly useful&quot;.  
2) The action-at-a-distance due to the implications of &quot;rooted at&quot; involving
   digging up a separate (unlinked, too) spec bit, combined with the fact that
   actually sharing implementations between HTMLPropertiesCollection and other
   HTMLCollections didn&apos;t happen at least in Gecko for various reasons, so the
   rooting didn&apos;t give behavior for free.
3) Whoever wrote the tests implementors used to verify their implementations
   didn&apos;t follow the spec either.

with #3 being likely most important in practice.

We could probably change Gecko to do what the spec says if you really think that&apos;s a better approach.  Why is it better?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78864</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-11-26 20:48:29 +0000</bug_when>
    <thetext>I&apos;m not sure it&apos;s really better — I don&apos;t really know what it means to be checking for the properties of a node that&apos;s not in a Document. But I can root it at the home subtree&apos;s root element, or something? I&apos;ll have to test to see what implementations actually do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78876</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-26 22:24:27 +0000</bug_when>
    <thetext>It&apos;s worth seeing if Opera is willing to change.  I&apos;d really much rather root at the document in Gecko, for what it&apos;s worth.  Speccing the other is a pain, since the home subtreee&apos;s root obviously changes over time.

Of course the owner document also changes over time (see adoptNode), so things are a bit annoying no matter what.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78892</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-11-27 05:32:42 +0000</bug_when>
    <thetext>I don&apos;t have a strong opinion, but Opera&apos;s behavior seems more useful than the spec&apos;s.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82725</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-02-08 01:01:24 +0000</bug_when>
    <thetext>http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2086

Gecko and Opera do a remarkable job of implementing what the spec doesn&apos;t say, so I guess I&apos;ll change the spec to match them... :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82726</commentid>
    <comment_count>10</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-02-08 01:03:33 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7705.
Check-in comment: Match reality. It&apos;s a bit more useful anyway, arguably.
http://html5.org/tools/web-apps-tracker?from=7704&amp;to=7705</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82728</commentid>
    <comment_count>11</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-02-08 01:36:04 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7706.
Check-in comment: Clarify that the collection&apos;s root might change during the collection&apos;s lifetime.
http://html5.org/tools/web-apps-tracker?from=7705&amp;to=7706</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>