Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25917

Re: eventDispath how that work

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: eventDispath how that work
Date Thu, 16 Oct 2014 02:48:56 +0200
Organization PointedEars Software (PES)
Lines 67
Message-ID <1784537.FLLm03yfTo@PointedEars.de> (permalink)
References <m1jblb$4a7$1@shakotay.alphanet.ch> <16yzpmtikrwk0$.1schjt968gcx$.dlg@40tude.net> <1791221.7QuZn8ShVB@PointedEars.de> <14ignx5l3afjk.j09ycbpj6e7h.dlg@40tude.net> <1695306.Qhb0f9IOXP@PointedEars.de> <m1mqn3$jtd$1@speranza.aioe.org>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1413420539 29674 eJwFwYEBgDAIA7CXxFGG5xQo/59gghMWfT0QjsVOstsNR8gSiOkYqf2odt+k2cfym0o9JH8+TxJ8 (16 Oct 2014 00:48:59 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Thu, 16 Oct 2014 00:48:59 +0000 (UTC)
User-Agent KNode/4.14.1
X-User-ID eJwFwYEBwCAIA7CXUNsi5yCD/09YwqOlcogCh6MoaKeEsD5hIl5faXuwtJK53NtRH6fPh7lpAcD69ttdPygeFO0=
Cancel-Lock sha1:wa0z6W/UnU3P6z4+8rIFb6B7SbY=
X-NNTP-Posting-Host eJwFwQkBwDAIA0BLQAmPnMEa/xJ6hxMamx4IB8Eu8qpVrfUIp5NneTEBrc95gymmAsz88Hwn4BFG
Xref csiph.com comp.lang.javascript:25917

Show key headers only | View raw


Joao Rodrigues wrote:

> On 15/10/2014 18:02, Thomas 'PointedEars' Lahn wrote:
>> Correction: The latter would be equivalent to
>> 
>> document.querySelectorAll(".foo")
>> 
>> Instead,
>> 
>> document.getElementsByClassName("foo")[0]
>> 
>> would be equivalent to the former, provided that the method returned
>> a reference to an object implementing the NodeList or HTMLCollection
>> interface (which would need to be tested before the “0” property read
>> access).
> 
> Pardon me, but these methods are not equivalent because:
> 
> a) The getElementsByClassName() method returns a live NodeList whereas
> querySelectorAll() returns a static NodeList;

ACK.
 
> b) The getElementsByClassName() method excludes any elements that are
> not descendants of the HTMLElement object on which the method was
> invoked.

Your logic is flawed.  getElementsByClassName() was not invoked on an object 
implementing the HTMLElement interface here; it was invoked on an object 
implementing the (HTML)Document interface.  That is a separate method, as 
even your own references say.

> […]
> var div = document.getElementById("bar");
> var p = div.querySelector("body p");

So this example does not apply here in two respects:

  1. another method
  2. another selector

> <http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#getelementsbyclassname>
> <http://www.w3.org/TR/selectors-api2/>

Again you have referred to a Working Draft and a Working Group Note, which 
both are non-normative, although a Proposed Recommendation and a 
Recommendation, respectively, are available.

<http://www.w3.org/TR/2014/PR-html5-20140916/infrastructure.html#common-dom-interfaces>

refers to

<http://www.w3.org/TR/dom/#document>

and thus

<http://www.w3.org/TR/dom/#dom-document-getelementsbyclassname>

and

<http://www.w3.org/TR/dom/#dom-parentnode-queryselectorall>

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-14 16:23 +0200
  Re: eventDispath how that work JJ <jj4public@vfemail.net> - 2014-10-15 03:24 +0700
    Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-15 10:49 +0200
    Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-15 15:24 +0200
      Re: eventDispath how that work JJ <jj4public@vfemail.net> - 2014-10-16 02:10 +0700
        Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-15 23:02 +0200
          Re: eventDispath how that work Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-15 18:59 -0300
            Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-16 02:48 +0200
          Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-16 18:11 +0200
      Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-15 22:06 +0200
        Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-15 23:39 +0200
          Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-16 14:26 +0200
            Re: eventDispath how that work Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-16 14:39 -0300
              Re: eventDispath how that work Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-16 19:44 -0300
                Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-17 09:00 +0200
                Re: eventDispath how that work Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-17 10:16 -0300
                Re: eventDispath how that work Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-17 21:40 +0200
                Re: eventDispath how that work Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-17 17:03 -0300
                Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-18 15:46 +0200
              Re: eventDispath how that work Une Bévue <unbewusst.sein@fai.invalid> - 2014-10-17 08:26 +0200

csiph-web