function IsIMEOpenStateSupported() { // We support to control IME open state on Windows and Mac actually. However, // we cannot test it on Mac if the current keyboard layout is not CJK. And also // we cannot test it on Win32 if the system didn't be installed IME. So, // currently we should not run the open state testing. returnfalse;
}
/** * @param {Node} aNode
*/ function nodeIsInShadowDOM(aNode) { for (let node = aNode; node; node = node.parentNode) { if (node instanceof ShadowRoot) { returntrue;
} if (node == node.parentNode) { break;
}
} returnfalse;
}
/** * @returns {Element} Retrieve focused element. If focused element is a element * in UA widget, this returns its host element. E.g., when * a button in the controls of <audio> or <video> has focus, * this returns the <video> or <audio>.
*/ function getFocusedElementOrUAWidgetHost() { const focusedElement = SpecialPowers.focusManager.focusedElement; if (SpecialPowers.wrap(focusedElement)?.containingShadowRoot?.isUAWidget()) { return focusedElement.containingShadowRoot.host;
} return focusedElement;
}
get focusBlurNotifications() { returnthis.#mFocusBlurNotifications.concat();
}
get numberOfFocusNotifications() { returnthis.#mFocusBlurNotifications.filter(t => t == "notify-focus")
.length;
}
get numberOfBlurNotifications() { returnthis.#mFocusBlurNotifications.filter(t => t == "notify-blur").length;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.