Remove explicit tabindex from diff links
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Tue, 24 May 2016 18:16:07 +0000 (20:16 +0200)
committerDerk-Jan Hartman <hartman.wiki@gmail.com>
Tue, 24 May 2016 22:46:54 +0000 (00:46 +0200)
These were added to Special:RecentChanges in 2004, but it doesn't
match what we do in any of the other lists. For accessibility
purposes, in flow indexing is preferred these days, or alternatively
a JS controlled roving tabindex, but this was neither.

Bug: T116127
Change-Id: Id455fafe4bdea40fb5988bdec14eed672844c8e3

includes/changes/ChangesList.php
includes/changes/RCCacheEntryFactory.php
tests/phpunit/includes/changes/OldChangesListTest.php

index cf97afb..b938ff0 100644 (file)
@@ -366,7 +366,7 @@ class ChangesList extends ContextSource {
                        $diffLink = Linker::linkKnown(
                                $rc->getTitle(),
                                $this->message['diff'],
-                               [ 'tabindex' => $rc->counter ],
+                               [],
                                $query
                        );
                }
index 4c003d3..549bc37 100644 (file)
@@ -174,7 +174,7 @@ class RCCacheEntryFactory {
                        $curLink = $curMessage;
                } else {
                        $curUrl = htmlspecialchars( $cacheEntry->getTitle()->getLinkURL( $queryParams ) );
-                       $curLink = "<a href=\"$curUrl\" tabindex=\"$counter\">$curMessage</a>";
+                       $curLink = "<a href=\"$curUrl\">$curMessage</a>";
                }
 
                return $curLink;
@@ -217,10 +217,10 @@ class RCCacheEntryFactory {
                                return $diffMessage;
                        }
                        $diffUrl = htmlspecialchars( $pageTitle->getLinkURL( $queryParams ) );
-                       $diffLink = "<a href=\"$diffUrl\" tabindex=\"$counter\">$diffMessage</a>";
+                       $diffLink = "<a href=\"$diffUrl\">$diffMessage</a>";
                } else {
                        $diffUrl = htmlspecialchars( $cacheEntry->getTitle()->getLinkURL( $queryParams ) );
-                       $diffLink = "<a href=\"$diffUrl\" tabindex=\"$counter\">$diffMessage</a>";
+                       $diffLink = "<a href=\"$diffUrl\">$diffMessage</a>";
                }
 
                return $diffLink;
index 5746a61..bc70a13 100644 (file)
@@ -93,7 +93,6 @@ class OldChangesListTest extends MediaWikiLangTestCase {
                        'assert diff link'
                );
 
-               $this->assertRegExp( '/tabindex="0"/', $line, 'assert tab index' );
                $this->assertRegExp(
                        '/title=Cat&amp;curid=20131103212153&amp;action=history"/',
                        $line,