Explorar o código

fix: Fix Sizzle incorrect context in iframe, passed as context of iframe

赵思 %!s(int64=2) %!d(string=hai) anos
pai
achega
727b136583
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/utils/FindElement.js

+ 2 - 1
src/utils/FindElement.js

@@ -25,7 +25,8 @@ class FindElement {
       : data.selector;
       : data.selector;
 
 
     if (specialSelectorsRegex.test(selector)) {
     if (specialSelectorsRegex.test(selector)) {
-      const elements = Sizzle.matches(selector);
+      // Fix Sizzle incorrect context in iframe, passed as context of iframe
+      const elements = Sizzle(selector, documentCtx);
       if (!elements) return null;
       if (!elements) return null;
 
 
       return data.multiple ? elements : elements[0];
       return data.multiple ? elements : elements[0];