INNER CODE UNIT · JavaScript
findSection
w3c/webdriver · issue.js:56
let findSection = (el, localName) => {
let sectionEl = el.closest("section");
if (!sectionEl)
return null;
let heading = sectionEl.querySelector(":scope > " + localName);
if (!heading)
return findSection(sectionEl.parentNode, localName);
let relUrl = location.href + "#" + encodeURIComponent(heading.id);
return {
url: relUrl,
text: heading.textContent,
};
};
let parent = sel.anchorNode.parentElement;