[Bug 16488] Consider adding parent() / ancestor() method

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16488

Anne <annevk@annevk.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arv@chromium.org,
                   |                            |ojan@chromium.org

--- Comment #2 from Anne <annevk@annevk.nl> ---
Okay, so basically this is the method that is desired:

Element.prototype.ancestor = function(selector) {
  var node = this
  while((node = node.parent) && node.nodeType == Node.ELEMENT_NODE)
    if(node.matches(selector))
      return node
  return null
}

Correct?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 29 November 2012 11:47:39 UTC