1 line
38 KiB
Plaintext
1 line
38 KiB
Plaintext
|
{"version":3,"file":"accessible-name-and-description.js","names":["asFlatString","s","trim","replace","isHidden","node","getComputedStyleImplementation","isElement","hasAttribute","getAttribute","style","getPropertyValue","isControl","hasAnyConcreteRoles","hasAbstractRole","role","TypeError","querySelectorAllSubtree","element","selectors","elements","ArrayFrom","querySelectorAll","queryIdRefs","forEach","root","push","apply","querySelectedOptions","listbox","isHTMLSelectElement","selectedOptions","isMarkedPresentational","isNativeHostLanguageTextAlternativeElement","isHTMLTableCaptionElement","allowsNameFromContent","isDescendantOfNativeHostLanguageTextAlternativeElement","getValueOfTextbox","isHTMLInputElement","isHTMLTextAreaElement","value","textContent","getTextualContent","declaration","content","test","slice","isLabelableElement","localName","getLocalName","findLabelableElement","labelableElement","childNodes","childNode","descendantLabelableElement","getControlOfLabel","label","control","undefined","htmlFor","ownerDocument","getElementById","getLabels","labelsProperty","labels","document","filter","getSlotContents","slot","assignedNodes","length","computeTextAlternative","options","consultedNodes","SetLike","window","safeWindow","compute","computedStyleSupportsPseudoElements","getComputedStyle","bind","hidden","computeMiscTextAlternative","context","accumulatedText","pseudoBefore","beforeContent","isHTMLSlotElement","concat","child","result","isEmbeddedInLabel","isReferenced","recursion","display","separator","pseudoAfter","afterContent","useAttribute","attributeName","attribute","getAttributeNode","has","add","computeTooltipAttributeValue","computeElementTextAlternative","isHTMLFieldSetElement","children","i","isHTMLLegendElement","isHTMLTableElement","isSVGSVGElement","isSVGTitleElement","nameFromAlt","isHTMLOptGroupElement","nameFromLabel","type","nameFromValue","map","join","nameFromTitle","nameFromSubTree","current","labelAttributeNode","labelElements","skipToStep2E","ariaLabel","elementTextAlternative","selectedOption","accumulatedText2F","nodeType","TEXT_NODE","tooltipAttributeValue"],"sources":["../sources/accessible-name-and-description.ts"],"sourcesContent":["/**\n * implements https://w3c.github.io/accname/\n */\nimport ArrayFrom from \"./polyfills/array.from\";\nimport SetLike from \"./polyfills/SetLike\";\nimport {\n\thasAnyConcreteRoles,\n\tisElement,\n\tisHTMLTableCaptionElement,\n\tisHTMLInputElement,\n\tisHTMLSelectElement,\n\tisHTMLTextAreaElement,\n\tsafeWindow,\n\tisHTMLFieldSetElement,\n\tisHTMLLegendElement,\n\tisHTMLOptGroupElement,\n\tisHTMLTableElement,\n\tisHTMLSlotElement,\n\tisSVGSVGElement,\n\tisSVGTitleElement,\n\tqueryIdRefs,\n\tgetLocalName,\n} from \"./util\";\n\n/**\n * A string of characters where all carriage returns, newlines, tabs, and form-feeds are replaced with a single space, and multiple spaces are reduced to a single space. The string contains only character data; it does not contain any markup.\n */\ntype FlatString = string & {\n\t__flat: true;\n};\n\n/**\n * interface for an options-bag where `window.getComputedStyle` can be mocked\n */\nexport interface ComputeTextAlternativeOptions {\n\tcompute?: \"description\" | \"name\";\n\t/**\n\t * Set to true if window.computedStyle supports the second argument.\n\t * This should be false in JSDOM. Otherwise JSDOM will log console errors.\n\t */\n\tcomputedStyleSupportsPseudoElements?: boolean;\n\t/**\n\t * mock window.getComputedStyle. Needs `content`, `display` and `visibility`\n\t */\n\tgetComputedStyle?: typeof window.getComputedStyle;\n\t/**\n\t * Set to `true` if you want to include hidden elements in the accessible name and description computation.\n\t * Skips 2A in https://w3c.github.io/accname/#computation-steps.\n\t * @default false\n\t */\n\thidden?: boolean;\n}\n\n/**\n *\n * @param {string} string -\n * @returns {FlatString} -\n */\nfunction asFlatString(s: string): FlatString {\n\treturn s.trim().replace(/\\s\\s+/g, \" \") as FlatString;\n}\n\n/**\n *\n * @param node -\n * @param options - These are not optiona
|