File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -294,6 +294,9 @@ class TextLayer {
294294 if ( item . id ) {
295295 this . #container. setAttribute ( "id" , `${ item . id } ` ) ;
296296 }
297+ if ( item . tag === "Artifact" ) {
298+ this . #container. ariaHidden = true ;
299+ }
297300 parent . append ( this . #container) ;
298301 } else if ( item . type === "endMarkedContent" ) {
299302 this . #container = this . #container. parentNode ;
Original file line number Diff line number Diff line change @@ -430,4 +430,34 @@ describe("accessibility", () => {
430430 ) ;
431431 } ) ;
432432 } ) ;
433+
434+ describe ( "Artifacts must be aria-hidden" , ( ) => {
435+ let pages ;
436+
437+ beforeEach ( async ( ) => {
438+ pages = await loadAndWait ( "bug1937438_mml_from_latex.pdf" , ".textLayer" ) ;
439+ } ) ;
440+
441+ afterEach ( async ( ) => {
442+ await closePages ( pages ) ;
443+ } ) ;
444+
445+ it ( "must check that some artifacts are aria-hidden" , async ( ) => {
446+ await Promise . all (
447+ pages . map ( async ( [ browserName , page ] ) => {
448+ const parentSquareRootHidden = await page . evaluate ( ( ) => {
449+ for ( const span of document . querySelectorAll ( ".textLayer span" ) ) {
450+ if ( span . textContent === "√" ) {
451+ return span . parentElement . getAttribute ( "aria-hidden" ) ;
452+ }
453+ }
454+ return false ;
455+ } ) ;
456+ expect ( parentSquareRootHidden )
457+ . withContext ( `In ${ browserName } ` )
458+ . toEqual ( "true" ) ;
459+ } )
460+ ) ;
461+ } ) ;
462+ } ) ;
433463} ) ;
You can’t perform that action at this time.
0 commit comments