W3C home > Mailing lists > Public > public-html@w3.org > October 2009

RE: ISSUE-41/ACTION-97 decentralized-extensibility

From: Adrian Bateman <adrianba@microsoft.com>
Date: Sun, 18 Oct 2009 15:30:06 +0000
To: Jonas Sicking <jonas@sicking.cc>, Tony Ross <tross@microsoft.com>
CC: "public-html@w3.org" <public-html@w3.org>
Message-ID: <104E6B5B6535E849970CDFBB1C5216EB061F0D1C@TK5EX14MBXC140.redmond.corp.microsoft.com>
On Saturday, October 17, 2009 11:34 PM, Jonas Sicking wrote:
> On Sat, Oct 17, 2009 at 4:54 PM, Tony Ross <tross@microsoft.com> wrote:
> > Another use case would be the ability to easily and
> > efficiently select the list of all elements in the document that the
> > library should act upon.
> 
[snip]
> 
> Not sure I understand the list-of-elements example.

The scenario is that a library wants to process all elements in its namespace. From Tony's document:

---
Querying for elements specific to a particular extension becomes cleaner.

     var myCustomElements =
          document.getElementsByTagNameNS("com.mycompany", "*");

Without mapping to namespaces, some form of filtering must be performed by script.

     var elms = document.getElementsByTagName("*");
     for(var i = 0; i < elms.length; i++)
     {
           if(elms[i].tagName.indexOf("my:") == 0)
           {
                // Do some work
           }
     }
---
Received on Sunday, 18 October 2009 15:32:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:50 GMT