r55393 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55392‎ | r55393 | r55394 >
Date:21:06, 20 August 2009
Author:mrzman
Status:ok
Tags:
Comment:
Update ChangesList output for enhanced changes to use CSS instead of obsolete attrbutes and elements (cellpadding, <tt>, etc.)
The test page I was using successfully validated as HTML 5 :)
Tested for signs of obvious regressions in FF 3.5, IE8, Opera 9.64 and Safari 4.0.
Supposedly, the border-spacing property isn't supported by IE, but I didn't see any obvious issues when testing,
so either the information I got was wrong/outdated, or its not actually necessary here. Needs testing in IE6/7 to verify.
If I did everything right, there shouldn't be any visible changes, save maybe a couple trivial spacing quirks.
Modified paths:
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/shared.css
@@ -747,3 +747,15 @@
748748 padding: 2px 4px;
749749 }
750750
 751+table.mw-enhanced-rc {
 752+ background: none;
 753+ padding:0;
 754+ border:0;
 755+ border-spacing:0;
 756+}
 757+td.mw-enhanced-rc {
 758+ white-space:nowrap;
 759+ vertical-align:top;
 760+ font-family:monospace
 761+}
 762+
Index: trunk/phase3/includes/ChangesList.php
@@ -776,7 +776,7 @@
777777
778778 wfProfileIn( __METHOD__ );
779779
780 - $r = '<table cellpadding="0" cellspacing="0" border="0" style="background: none"><tr>';
 780+ $r = '<table class="mw-enhanced-rc"><tr>';
781781
782782 # Collate list of users
783783 $userlinks = array();
@@ -846,13 +846,13 @@
847847
848848 $tl = "<span id='mw-rc-openarrow-$jsid' class='mw-changeslist-expanded' style='visibility:hidden'><a href='#' $toggleLink title='$expandTitle'>" . $this->sideArrow() . "</a></span>";
849849 $tl .= "<span id='mw-rc-closearrow-$jsid' class='mw-changeslist-hidden' style='display:none'><a href='#' $toggleLink title='$closeTitle'>" . $this->downArrow() . "</a></span>";
850 - $r .= '<td valign="top" style="white-space: nowrap"><tt>'.$tl.'&nbsp;';
 850+ $r .= '<td class="mw-enhanced-rc">'.$tl.'&nbsp;';
851851
852852 # Main line
853853 $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, '&nbsp;', $bot );
854854
855855 # Timestamp
856 - $r .= '&nbsp;'.$block[0]->timestamp.'&nbsp;</tt></td><td>';
 856+ $r .= '&nbsp;'.$block[0]->timestamp.'&nbsp;</td><td>';
857857
858858 # Article link
859859 if( $namehidden ) {
@@ -944,7 +944,7 @@
945945
946946 # Sub-entries
947947 $r .= '<div id="mw-rc-subentries-'.$jsid.'" class="mw-changeslist-hidden">';
948 - $r .= '<table cellpadding="0" cellspacing="0" border="0" style="background: none">';
 948+ $r .= '<table class="mw-enhanced-rc">';
949949 foreach( $block as $rcObj ) {
950950 # Extract fields from DB into the function scope (rc_xxxx variables)
951951 // FIXME: Would be good to replace this extract() call with something
@@ -954,10 +954,10 @@
955955 extract( $rcObj->mAttribs );
956956
957957 #$r .= '<tr><td valign="top">'.$this->spacerArrow();
958 - $r .= '<tr><td valign="top">';
959 - $r .= '<tt>'.$this->spacerIndent() . $this->spacerIndent();
 958+ $r .= '<tr><td style="vertical-align:top;font-family:monospace">';
 959+ $r .= $this->spacerIndent() . $this->spacerIndent();
960960 $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot );
961 - $r .= '&nbsp;</tt></td><td valign="top">';
 961+ $r .= '&nbsp;</td><td style="vertical-align:top"><span style="font-family:monospace">';
962962
963963 $params = $queryParams;
964964
@@ -967,27 +967,26 @@
968968
969969 # Log timestamp
970970 if( $rc_type == RC_LOG ) {
971 - $link = '<tt>'.$rcObj->timestamp.'</tt> ';
 971+ $link = $rcObj->timestamp;
972972 # Revision link
973973 } else if( !ChangesList::userCan($rcObj,Revision::DELETED_TEXT) ) {
974 - $link = '<span class="history-deleted"><tt>'.$rcObj->timestamp.'</tt></span> ';
 974+ $link = '<span class="history-deleted">'.$rcObj->timestamp.'</span> ';
975975 } else {
976976 if ( $rcObj->unpatrolled && $rc_type == RC_NEW) {
977977 $params['rcid'] = $rcObj->mAttribs['rc_id'];
978978 }
979979
980 - $link = '<tt>' .
981 - $this->skin->link(
 980+ $link = $this->skin->link(
982981 $rcObj->getTitle(),
983982 $rcObj->timestamp,
984983 array(),
985984 $params,
986985 array( 'known', 'noclasses' )
987 - ) . '</tt>';
 986+ );
988987 if( $this->isDeleted($rcObj,Revision::DELETED_TEXT) )
989988 $link = '<span class="history-deleted">'.$link.'</span> ';
990989 }
991 - $r .= $link;
 990+ $r .= $link . '</span>';
992991
993992 if ( !$rc_type == RC_LOG || $rc_type == RC_NEW ) {
994993 $r .= ' (';
@@ -1092,15 +1091,15 @@
10931092 extract( $rcObj->mAttribs );
10941093 $query['curid'] = $rc_cur_id;
10951094
1096 - $r = '<table cellspacing="0" cellpadding="0" border="0" style="background: none"><tr>';
1097 - $r .= '<td valign="top" style="white-space: nowrap"><tt>' . $this->spacerArrow() . '&nbsp;';
 1095+ $r = '<table class="mw-enhanced-rc"><tr>';
 1096+ $r .= '<td class="mw-enhanced-rc">' . $this->spacerArrow() . '&nbsp;';
10981097 # Flag and Timestamp
10991098 if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
11001099 $r .= '&nbsp;&nbsp;&nbsp;&nbsp;'; // 4 flags -> 4 spaces
11011100 } else {
11021101 $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot );
11031102 }
1104 - $r .= '&nbsp;'.$rcObj->timestamp.'&nbsp;</tt></td><td>';
 1103+ $r .= '&nbsp;'.$rcObj->timestamp.'&nbsp;</td><td>';
11051104 # Article or log link
11061105 if( $rc_log_type ) {
11071106 $logtitle = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL );
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1580,7 +1580,7 @@
15811581 * to ensure that client-side caches do not keep obsolete copies of global
15821582 * styles.
15831583 */
1584 -$wgStyleVersion = '238';
 1584+$wgStyleVersion = '239';
15851585
15861586
15871587 # Server-side caching:

Follow-up revisions

RevisionCommit summaryAuthorDate
r56573Fix for r55393, put the padding:0 on the td's rather than the tablesmrzman23:04, 17 September 2009
r81177Removing more, no longer needed, overrides for the white table background (w...krinkle23:30, 28 January 2011

Status & tagging log