Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the blinks and marquee axe-core rules to power the text_blinking_scrolling rule #637

Merged
2 changes: 2 additions & 0 deletions includes/classes/class-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public function set_post_scan_results( $request ) {
if ( array_key_exists( 'ruleset', $rule ) && 'js' === $rule['ruleset'] ) {
$js_rule_ids[] = $rule['slug'];

// Some rules can be a grouping of other checks with different ids. This tracks those combined check IDs for later mapping.
if ( array_key_exists( 'combines', $rule ) && ! empty( $rule['combines'] ) ) {
foreach ( $rule['combines'] as $combine_rule_id ) {
$combined_rule_ids[ $combine_rule_id ] = $rule['slug'];
Expand Down Expand Up @@ -231,6 +232,7 @@ public function set_post_scan_results( $request ) {
foreach ( $violations as $violation ) {
$rule_id = $violation['ruleId'];

// If this rule is a combined rule then map it to the actual reporting rule ID.
$actual_rule_id = array_key_exists( $rule_id, $combined_rule_ids ) ? $combined_rule_ids[ $rule_id ] : $rule_id;

if ( in_array( $actual_rule_id, $js_rule_ids, true ) ) {
Expand Down
2 changes: 2 additions & 0 deletions includes/rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@
'<code>&lt;marquee&gt;</code>',
'<code>text-decoration: blink</code>'
),
'ruleset' => 'js',
'combines' => [ 'blink', 'marquee' ],
],
[
'title' => esc_html__( 'Insufficient Color Contrast', 'accessibility-checker' ),
Expand Down
100 changes: 0 additions & 100 deletions includes/rules/text_blinking_scrolling.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/pageScanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const scan = async (
values: [
'color_contrast_failure',
'underlined_text',
'blink',
'marquee',
'meta-viewport',
textJustified.id,
],
Expand Down
Loading