Contains( container, target ) static method
Returns true if the first node contains the second, even if the second node is in a shadow tree.
The standard Node.contains() function does not account for Shadow DOM, and returns false if the supplied target node is sitting inside a shadow tree within the container.
Node– The container to search within.
Node– The node that may be inside the container.
boolean - True if the container contains the target node.
Focus( element ) static method
Determine which shadow or child element the indicated element would like to treat as the default element to focus on.
This proceeds by starting with the indicated element, seeing whether it defines another element as the one which should receive the focus, and repeating that process.
OverlayMixin uses this utility to determine where the focus should be put when an overlay is opened.
From Point( element, x, y ) static method
Polyfill for shadowRoot.elementsFromPoint, which (as of 6 June 2018) is not available in the webcomponents polyfill. See https://github.com/webcomponents/shadydom/issues/141.
Element– element whose shadow root may contain elements at the specified point
number– x-coordinate of the indicated point
number– y-coordinate of the indicated point
Of Item Containing Target( listElement, target ) static method
Search a list element for the item that contains the specified target.
When dealing with UI events (e.g., mouse clicks) that may occur in subelements inside a list item, you can use this routine to obtain the containing list item.
Node– A list element containing a set of items
Node– A target element that may or may not be an item in the list.
number - The index of the list child that is or contains the
indicated target node. Returns -1 if not found.
Event( node, event ) static method
Return true if the event came from within the node (or from the node itself); false otherwise.
Node– The node to consider in relation to the event
Event– The event which may have been raised within/by the node
boolean - True if the event was raised within or by the node