[Webkit-unassigned] [Bug 131443] querySelectorAll should return a JS array

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 9 11:03:54 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=131443





--- Comment #4 from Ryosuke Niwa <rniwa at webkit.org>  2014-04-09 11:04:11 PST ---
Also note that queryAll in DOM4 returns Elements, which is a subclass of Array so making querySelectorAll return Array or Elements when it's introduced will align the return types of two functions:

Excerpts from http://dom.spec.whatwg.org/#collections:-elements

interface ParentNode {
  readonly attribute HTMLCollection children;
  readonly attribute Element? firstElementChild;
  readonly attribute Element? lastElementChild;
  readonly attribute unsigned long childElementCount;

  void prepend((Node or DOMString)... nodes);
  void append((Node or DOMString)... nodes);

  Element? query(DOMString relativeSelectors);
  [NewObject] Elements queryAll(DOMString relativeSelectors);
  Element? querySelector(DOMString selectors);
  [NewObject] NodeList querySelectorAll(DOMString selectors);
};
Document implements ParentNode;
DocumentFragment implements ParentNode;
Element implements ParentNode;

class Elements extends Array {
  Element? query(DOMString relativeSelectors);
  Elements queryAll(DOMString relativeSelectors);
};

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list