Use CSS columns instead of tables in Special:SpecialPages (2)
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 8 Sep 2015 14:07:16 +0000 (14:07 +0000)
committerKrinkle <krinklemail@gmail.com>
Tue, 8 Sep 2015 14:44:25 +0000 (14:44 +0000)
Issue no longer occurs on current Chromium, so let's try again.

This re-applies commit dc40debaea2effd46a43c88d0fc925b3550c829b.
This reverts commit 25b10c47a4653359387222eea2f3cf850620a070.

Bug: T97026
Change-Id: I1b0c0a38f0842fb259a4e525f1578980acfa4cd6

includes/specials/SpecialSpecialpages.php
resources/src/mediawiki.special/mediawiki.special.css

index ed3ad5b..c3234e1 100644 (file)
@@ -96,22 +96,14 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                $includesCachedPages = false;
 
                foreach ( $groups as $group => $sortedPages ) {
-                       $total = count( $sortedPages );
-                       $middle = ceil( $total / 2 );
-                       $count = 0;
 
                        $out->wrapWikiMsg(
                                "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n",
                                "specialpages-group-$group"
                        );
                        $out->addHTML(
-                               Html::openElement(
-                                       'table',
-                                       array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' )
-                               ) . "\n" .
-                               Html::openElement( 'tr' ) . "\n" .
-                               Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" .
-                               Html::openElement( 'ul' ) . "\n"
+                               Html::openElement( 'div', array( 'class' => 'mw-specialpages-list' ) )
+                               . '<ul>'
                        );
                        foreach ( $sortedPages as $desc => $specialpage ) {
                                list( $title, $restricted, $cached ) = $specialpage;
@@ -132,21 +124,10 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                                array( 'class' => implode( ' ', $pageClasses ) ),
                                                $link
                                        ) . "\n" );
-
-                               # Split up the larger groups
-                               $count++;
-                               if ( $total > 3 && $count == $middle ) {
-                                       $out->addHTML(
-                                               Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
-                                               Html::element( 'td', array( 'style' => 'width:10%' ), '' ) .
-                                               Html::openElement( 'td', array( 'style' => 'width:30%' ) ) . Html::openElement( 'ul' ) . "\n"
-                                       );
-                               }
                        }
                        $out->addHTML(
-                               Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
-                               Html::element( 'td', array( 'style' => 'width:30%' ), '' ) .
-                               Html::closeElement( 'tr' ) . Html::closeElement( 'table' ) . "\n"
+                               Html::closeElement( 'ul' ) .
+                               Html::closeElement( 'div' )
                        );
                }
 
index d245726..a13ec3c 100644 (file)
@@ -84,13 +84,10 @@ td#mw-prefixindex-nav-form {
        font-weight: bold;
 }
 
-.mw-specialpages-table {
-       margin-top: -1em;
-       margin-bottom: 1em;
-}
-
-.mw-specialpages-table td {
-       vertical-align: top;
+.mw-specialpages-list {
+       -webkit-columns: 16em 2;
+       -moz-columns: 16em 2;
+       columns: 16em 2;
 }
 
 /* Special:Statistics */