utils/dom/getlayoutparentelement
module
Functions
getLayoutParentElement( node ) → Element | nullmodule:utils/dom/getlayoutparentelement~getLayoutParentElementReturns the parent element in the flattened tree, the one the browser lays out and paints.
The layout-aware counterpart of
getParentElement, and the element-only form ofgetLayoutParentNode– see that one for why the flattened tree and the node tree disagree for slotted content, and for when to prefer which.Use it to walk outwards over the elements that lay a node out: its scrollable ancestors, its clipping ancestors. Works for open and closed roots alike, and falls back to the node tree for slotted content inside a closed root, whose slot the DOM standard does not expose.
Parameters
node: NodeThe node to get the layout parent element of.
Returns
Element | null