This is an automated email from the ASF dual-hosted git repository. gerben pushed a commit to branch allow-node-as-scope in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git
commit b5d35c7c3f2fff825c6a787706dcb2e7f746e76e Author: Gerben <[email protected]> AuthorDate: Fri Jun 4 19:02:47 2021 +0200 Make default scope of describeCss the whole document Instead of just the body. Accordingly, allow any Node as scope, not only Elements. --- packages/dom/src/css.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dom/src/css.ts b/packages/dom/src/css.ts index 1a62141..746486a 100644 --- a/packages/dom/src/css.ts +++ b/packages/dom/src/css.ts @@ -77,9 +77,9 @@ export function createCssSelectorMatcher( export async function describeCss( element: HTMLElement, - scope?: HTMLElement, + scope: Node = element.ownerDocument, ): Promise<CssSelector> { - const selector = optimalSelect(element, { root: scope ?? element.ownerDocument.body }); + const selector = optimalSelect(element, { root: scope }); return { type: 'CssSelector', value: selector,
