W3C home > Mailing lists > Public > public-html-ig-zh@w3.org > June 2012

(wrong string) 簡介(轉: Why not NodeList#forEach :\?)

From: John Hax <johnhax@gmail.com>
Date: Thu, 21 Jun 2012 19:53:19 +0800
Message-ID: <CAEeYXHU7NyrwFoQoA54e-uqrF83JGPwN6fS2-XWktoz0p1CMmQ@mail.gmail.com>
To: "Kang-Hao (Kenny) Lu" <kennyluck@w3.org>
Cc: (wrong string) 興趣小組 <public-html-ig-zh@w3.org>, DX Jin <dox.jin@gmail.com>, 牛晓光 <niuxg0@hotmail.com>, 劭非程 <csf178@gmail.com>
̫ˡDOM4ΪɶֻNodeListArrayClassΪɶHTMLCollectionͲǣAPIgetElementsByTagName/ClassNameElement.childrenȣDOMStringListDOMTokenListȵȡ

2012/6/20 Kang-Hao (Kenny) Lu <kennyluck@w3.org>

> winter  es-discuss ӑՓ NodeList ] forEach @[1]õ
> Ĵ𰸣
>
> (12/06/20 0:21), Erik Arvidsson wrote:
> > On Tue, Jun 19, 2012 at 6:42 AM, ۿ <csf178@gmail.com> wrote:
> >> I guess we can try to push Web IDL to do this.
> >
> > WebIDL provides [ArrayClass] and DOM4 make NodeLists ArrayClass. This
> > means that NodeLists have Array.prototype on its prototype chain.
>
> ܶˌ ES5 ^ Web IDL ^Q@CҰ Web IDL
> Ŀ_ˣ혱㺆һ¡
>
> == νB ==
>
> ȣ HTML Ҏᵽ Web IDL ĕr[2]@fģ
>
>  # ֧Ԯ_ʹߴ횣գ Web IDL ҎķʽҎe
>  # ĸIDL ƬΡ[WEBIDL]
>
> ҲfIDL Ƭ JS API һNZԣڸط HTML
> CSSOMWebGL ȸҎe Web IDL @NZԵҎ "push Web
> IDL to do this" @Ԓcֵģ NodeList ĸNОҎ
> DOM4]kìFе Web IDL Z@NrĕrҪM Web IDL 
>
> == [ArrayClass] ==
>
> Web IDL ᵽ JS UA 회
> * ԭDocumentWindowNodeList ȵȣ
> * ԭDocument.prototypeWindow.prototypeNodeList.prototype
> ȵȣ
> * ...
>
>  [ArrayClass] Ľ[3]£
>
>  #  A ĽԭăȲ [[Prototype]] Եֵ횡Ҏ
>  # tó
>  #
>  # 1.  A  [NamedPropertiesObject] 棬t A ăȲ
>  #    [[Prototype]] Եֵ 4.4.4 Сx A Q
>  #    
>  # 2. t A ]^һ棬 [ArrayClass] 棬
>  #    t A ăȲ [[Prototype]] Եֵ Array ԭt
>  #    Object ԭ
>  # 3. tA ăȲ [[Prototype]] Եֵ鱻^нĽԭ
>  #    
>
> ]һx ES5 g@eֱB ES5 Array ԭ
> Object ԭጵķgஔe
> ]@Ԓ䌍c߉݋}ѽ A ͽ A Ľԭһ
> dȤ˿Ի؈һe`Web IDL heycam ϕÿe`˼M
> ؕIбedȤԒԎæһ¡
> ][ArrayClass] Zķgo winter ˡ
>
> ҎϣֻҪ interface NodeList ǰһ
> [ArrayClass]NodeList.prototype  [[Prototype]] ͕
> Array.prototypeȻ NodeList ͕ forEach ȵȡ
>
> Ŀǰ DOM4 ѽ interface NodeList ǰ [ArrayClass] ˣţβ
> ͵ķg߀]ͬgӭdȤюæһ¡
>
> ==  ==
>
> ÿһ interface XXX һЩԣWeb IDL  JS Ҫкܶ඼
> ԡ[4]@Сeе@㷨У㷨̾ǣԫ@ȡ
> Ԟ
>
> Ќ getter  Web IDL  getter E  ҎеČԡ@ȡE
>     ES5              Web IDL           HTML ȵȣ
>
> У[4]@Enj ES ֵDQ IDL ֵҎ㷨
>  IDL ֵϣ*Փ*ÿ涼òͬZԌȻHϴ
> ˶ֻ JS dȤѡ
>
> @ȡEб^ľ IDL ԣ݌Է5ݣ
>
>  # һЩIDLԱӳضԡζţȡ
>  # ʱIDLԱ뷵ԵǰֵøʱIDLø
>  # ֵ޸Եֵ
>
> [1] https://mail.mozilla.org/pipermail/es-discuss/2012-June/023581.html
> [2] http://www.w3.org/html/ig/zh/wiki/HTML5/infrastructure#interactive
> [3] http://www.w3.org/html/ig/zh/wiki/WebIDL#interface-prototype-object
> [4] http://www.w3.org/html/ig/zh/wiki/WebIDL#es-attributes
> [5] http://www.w3.org/html/ig/zh/wiki/HTML5/common-dom-interfaces#reflect
>
>
> 
>
> Kenny
>
>
Received on Thursday, 21 June 2012 11:53:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:43:50 UTC