From: jdlrobson Date: Tue, 18 Sep 2018 21:11:08 +0000 (-0700) Subject: Use pseudo elements to style changelist-separators on Contributions X-Git-Tag: 1.34.0-rc.0~3924^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=fd993dd4bc05caf4a440f6734a10404aae292157 Use pseudo elements to style changelist-separators on Contributions Currently, these separators are unnecessarily hardcoded in HTML. This is problematic, as it limits the extent to which skins such as Minerva and Timeless can skin these pages. If the pseudo selector is not available (e.g. legacy browsers) this degrades nicely to whitespace and the page is still useable. Right now, these changes are scoped to pages uses the ContribsPager (used by Special:Contributions) but we can adopt them in other pages once we have this approach set in stone (CSS) Bug: T205581 Change-Id: Ia2c485e6058ebf4282ed2f7eb7b046b2deb03f57 --- diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 81a1f5a506..5b50f0a681 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -502,22 +502,22 @@ class ContribsPager extends RangeChronologicalPager { // For some reason rev_parent_id isn't populated for this row. // Its rumoured this is true on wikipedia for some revisions (T36922). // Next best thing is to have the total number of bytes. - $chardiff = ' . . '; + $chardiff = ' '; $chardiff .= Linker::formatRevisionSize( $row->rev_len ); - $chardiff .= ' . . '; + $chardiff .= ' '; } else { $parentLen = 0; if ( isset( $this->mParentLens[$row->rev_parent_id] ) ) { $parentLen = $this->mParentLens[$row->rev_parent_id]; } - $chardiff = ' . . '; + $chardiff = ' '; $chardiff .= ChangesList::showCharacterDifference( $parentLen, $row->rev_len, $this->getContext() ); - $chardiff .= ' . . '; + $chardiff .= ' '; } $lang = $this->getLanguage(); @@ -543,7 +543,8 @@ class ContribsPager extends RangeChronologicalPager { $userlink = ''; if ( ( $this->contribs == 'newbie' && !$rev->isDeleted( Revision::DELETED_USER ) ) || $this->isQueryableRange( $this->target ) ) { - $userlink = ' . . ' . $lang->getDirMark() + $userlink = ' ' + . $lang->getDirMark() . Linker::userLink( $rev->getUser(), $rev->getUserText() ); $userlink .= ' ' . $this->msg( 'parentheses' )->rawParams( Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) )->escaped() . ' '; diff --git a/resources/src/mediawiki.special.changeslist.css b/resources/src/mediawiki.special.changeslist.css index 1b37ec34b3..a884b833e8 100644 --- a/resources/src/mediawiki.special.changeslist.css +++ b/resources/src/mediawiki.special.changeslist.css @@ -60,3 +60,9 @@ .mw-rcfilters-ui-highlights { display: none; } + +/* Content dividers */ +/* @todo FIXME: Hard coded ". .". Is there a message for this? Should there be? */ +.mw-changeslist-separator:empty:before { + content: '. .'; +}