Polymer/ShadowDOM — pull request #332 by foolip (2013-12-10 23:36:28+00:00)
Title: Avoid stack overflow when Element.matches is supported by the browser

In http://crbug.com/326652 support for Element.matches(selectors) was
added to Blink, but it was reverted because it caused tests using
Polymer to start failing due to "Maximum call stack size
exceeded".

The problem is that the Element wrapper unconditionally implements
Element.prototype[matchesName] using this.matches(), which is the same
function if matchesName == "matches". Make the forwarding function
conditional to solve the problem.