Commit 94bcba74 authored by JC Brand's avatar JC Brand

Handle non-elements, like text nodes

parent 9c812157
...@@ -69716,7 +69716,8 @@ u.matchesSelector = function (el, selector) { ...@@ -69716,7 +69716,8 @@ u.matchesSelector = function (el, selector) {
* (DOMElement) el - The DOM element * (DOMElement) el - The DOM element
* (String) selector - The selector * (String) selector - The selector
*/ */
return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); const match = el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector;
return match ? match.call(el, selector) : false;
}; };
u.queryChildren = function (el, selector) { u.queryChildren = function (el, selector) {
...@@ -179,14 +179,15 @@ u.matchesSelector = function (el, selector) { ...@@ -179,14 +179,15 @@ u.matchesSelector = function (el, selector) {
* (DOMElement) el - The DOM element * (DOMElement) el - The DOM element
* (String) selector - The selector * (String) selector - The selector
*/ */
return ( const match = (
el.matches || el.matches ||
el.matchesSelector || el.matchesSelector ||
el.msMatchesSelector || el.msMatchesSelector ||
el.mozMatchesSelector || el.mozMatchesSelector ||
el.webkitMatchesSelector || el.webkitMatchesSelector ||
el.oMatchesSelector el.oMatchesSelector
).call(el, selector); );
return match ? match.call(el, selector) : false;
}; };
u.queryChildren = function (el, selector) { u.queryChildren = function (el, selector) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment