q( '//video' ) as $v ) { if ( ! $c->q( ".//track[translate(@kind,'CAPTIONSUBTL','captionsubtl')='captions' or translate(@kind,'CAPTIONSUBTL','captionsubtl')='subtitles']", $v ) ) { // A purely decorative muted background loop has no speech to caption. if ( $v->hasAttribute( 'muted' ) && ! $v->hasAttribute( 'controls' ) && $v->hasAttribute( 'autoplay' ) ) { continue; } $c->add( 'video-no-captions', $v ); } } foreach ( $c->q( '//video[@autoplay] | //audio[@autoplay]' ) as $m ) { $audible = ! $m->hasAttribute( 'muted' ) || 'audio' === strtolower( $m->tagName ); if ( $audible || $m->hasAttribute( 'loop' ) ) { $c->add( 'media-autoplay', $m ); } } foreach ( $c->q( '//marquee | //blink' ) as $m ) { $c->add( 'marquee-blink', $m ); } } }