r74966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74965‎ | r74966 | r74967 >
Date:20:35, 18 October 2010
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
First shot at porting Monobook to Vector. The only non-straightforward part is moving from a separate rtl.css file to a main.css file we can safely Janus. This is half-done right now. Notable things:
* No longer including rtl.css, instead relying on Janused main.css
* Renamed external.png to external-ltr.png so Janus will pick up on external-rtl.png (already exists)
* Added @embed to all images, add @noflip where needed (may not have covered all cases)
* Pulled some things from rtl.css into main.css such that they're no-ops in LTR but are needed in RTL. Example: body { direction:ltr;
* Killed some RTL-specific rules in main.css that were superseded in main.css
* Changed padding: 0 foo; to padding-right: foo; so it gets Janused right
* Commented out loading of IE*Fixes.css. Still need to incorporate these into main.css somehow
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/monobook/external-ltr.png (added) (history)
  • /trunk/phase3/skins/monobook/external.png (deleted) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/external.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/phase3/skins/monobook/external-ltr.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/skins/monobook/external-ltr.png
___________________________________________________________________
Added: svn:mime-type
11 + image/png
Index: trunk/phase3/skins/monobook/main.css
@@ -41,10 +41,13 @@
4242
4343 body {
4444 font: x-small sans-serif;
 45+ /* @embed */
4546 background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;
4647 color: black;
4748 margin: 0;
4849 padding: 0;
 50+ direction: ltr; /* Needed for RTL flipping */
 51+ unicode-bidi: embed;
4952 }
5053
5154 /* scale back up to a sane default */
@@ -143,6 +146,7 @@
144147 list-style-type: square;
145148 margin: .3em 0 0 1.5em;
146149 padding: 0;
 150+ /* @embed */
147151 list-style-image: url(bullet.gif);
148152 }
149153 ol {
@@ -376,6 +380,7 @@
377381 }
378382
379383 /* images */
 384+/* @noflip */
380385 div.floatright, table.floatright {
381386 clear: right;
382387 float: right;
@@ -388,6 +393,7 @@
389394 */
390395 }
391396 div.floatright p { font-style: italic; }
 397+/* @noflip */
392398 div.floatleft, table.floatleft {
393399 float: left;
394400 clear: left;
@@ -436,11 +442,13 @@
437443 border: none !important;
438444 background: none !important;
439445 }
 446+/* @noflip */
440447 div.tright {
441448 clear: right;
442449 float: right;
443450 border-width: .5em 0 .8em 1.4em;
444451 }
 452+/* @noflip */
445453 div.tleft {
446454 float: left;
447455 clear: left;
@@ -492,36 +500,38 @@
493501 */
494502 #bodyContent a.external,
495503 #bodyContent a.external[href ^="gopher://"] {
496 - background: url(external.png) center right no-repeat;
497 - padding: 0 13px;
 504+ /* @embed */
 505+ background: url(external-ltr.png) center right no-repeat;
 506+ padding-right: 13px;
498507 }
499 -.rtl #bodyContent a.external,
500 -.rtl #bodyContent a.external[href ^="gopher://"] {
501 - background-image: url(external-rtl.png);
502 -}
503508 #bodyContent a.external[href ^="https://"],
504509 .link-https {
 510+ /* @embed */
505511 background: url(lock_icon.gif) center right no-repeat;
506 - padding: 0 16px;
 512+ padding-right: 16px;
507513 }
508514 #bodyContent a.external[href ^="mailto:"],
509515 .link-mailto {
 516+ /* @embed */
510517 background: url(mail_icon.gif) center right no-repeat;
511 - padding: 0 18px;
 518+ padding-right: 18px;
512519 }
513520 #bodyContent a.external[href ^="news://"] {
 521+ /* @embed */
514522 background: url(news_icon.png) center right no-repeat;
515 - padding: 0 18px;
 523+ padding-right: 18px;
516524 }
517525 #bodyContent a.external[href ^="ftp://"],
518526 .link-ftp {
 527+ /* @embed */
519528 background: url(file_icon.gif) center right no-repeat;
520 - padding: 0 18px;
 529+ padding-right: 18px;
521530 }
522531 #bodyContent a.external[href ^="irc://"],
523532 .link-irc {
 533+ /* @embed */
524534 background: url(discussionitem_icon.gif) center right no-repeat;
525 - padding: 0 18px;
 535+ padding-right: 18px;
526536 }
527537 #bodyContent a.external[href $=".ogg"], #bodyContent a.external[href $=".OGG"],
528538 #bodyContent a.external[href $=".mid"], #bodyContent a.external[href $=".MID"],
@@ -530,41 +540,28 @@
531541 #bodyContent a.external[href $=".wav"], #bodyContent a.external[href $=".WAV"],
532542 #bodyContent a.external[href $=".wma"], #bodyContent a.external[href $=".WMA"],
533543 .link-audio {
 544+ /* @embed */
534545 background: url("audio.png") center right no-repeat;
535 - padding: 0 13px;
 546+ padding-right: 13px;
536547 }
537548 #bodyContent a.external[href $=".ogm"], #bodyContent a.external[href $=".OGM"],
538549 #bodyContent a.external[href $=".avi"], #bodyContent a.external[href $=".AVI"],
539550 #bodyContent a.external[href $=".mpeg"], #bodyContent a.external[href $=".MPEG"],
540551 #bodyContent a.external[href $=".mpg"], #bodyContent a.external[href $=".MPG"],
541552 .link-video {
 553+ /* @embed */
542554 background: url("video.png") center right no-repeat;
543 - padding: 0 13px;
 555+ padding-right: 13px;
544556 }
545557 #bodyContent a.external[href $=".pdf"], #bodyContent a.external[href $=".PDF"],
546558 #bodyContent a.external[href *=".pdf#"], #bodyContent a.external[href *=".PDF#"],
547559 #bodyContent a.external[href *=".pdf?"], #bodyContent a.external[href *=".PDF?"],
548560 .link-document {
 561+ /* @embed */
549562 background: url("document.png") center right no-repeat;
550 - padding: 0 12px;
 563+ padding-right: 12px;
551564 }
552565
553 -/* for rtl wikis */
554 -.rtl #bodyContent a.external {
555 - background-position: left;
556 - padding-right: 0;
557 -}
558 -.rtl a.feedlink {
559 - background-position: right;
560 - padding-right: 16px;
561 - padding-left: 0;
562 -}
563 -
564 -/* correction for ltr wikis */
565 -.ltr #bodyContent a.external {
566 - padding-left: 0;
567 -}
568 -
569566 /* disable interwiki styling */
570567 #bodyContent a.extiw,
571568 #bodyContent a.extiw:active {
@@ -588,6 +585,15 @@
589586 width: 11.6em;
590587 overflow: hidden;
591588 }
 589+html > body .portlet {
 590+ float: left;
 591+ clear: left;
 592+}
 593+/* recover IEMac (might be fine with the float, but usually it's close to IE */
 594+*>body .portlet {
 595+ float: none;
 596+ clear: none;
 597+}
592598 .portlet h4 {
593599 font-size: 95%;
594600 font-weight: normal;
@@ -633,6 +639,7 @@
634640 .portlet ul {
635641 line-height: 1.5em;
636642 list-style-type: square;
 643+ /* @embed */
637644 list-style-image: url(bullet.gif);
638645 font-size: 95%;
639646 }
@@ -769,6 +776,7 @@
770777 li#pt-userpage,
771778 li#pt-anonuserpage,
772779 li#pt-login {
 780+ /* @embed */
773781 background: url(user.gif) top left no-repeat;
774782 padding-left: 20px;
775783 text-transform: none;
@@ -1023,10 +1031,6 @@
10241032 background-color: #f9f9f9;
10251033 float: left;
10261034 }
1027 -.rtl div#userloginForm form,
1028 -.rtl div#userlogin form#userlogin2 {
1029 - float: right;
1030 -}
10311035
10321036 div#userloginForm table,
10331037 div#userlogin form#userlogin2 table {
Index: trunk/phase3/skins/MonoBook.php
@@ -28,20 +28,17 @@
2929
3030 parent::setupSkinUserCss( $out );
3131
32 - // Append to the default screen common & print styles...
33 - $out->addStyle( 'monobook/main.css', 'screen' );
34 - if( $wgHandheldStyle ) {
35 - // Currently in testing... try 'chick/main.css'
36 - $out->addStyle( $wgHandheldStyle, 'handheld' );
37 - }
 32+ $out->addModuleStyles( 'monobook' );
 33+
 34+ // TODO: Migrate all of these
 35+ //$out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
 36+ //$out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' );
 37+ //$out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
 38+ //$out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
3839
39 - $out->addStyle( 'monobook/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
40 - $out->addStyle( 'monobook/IE55Fixes.css', 'screen', 'IE 5.5000' );
41 - $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' );
42 - $out->addStyle( 'monobook/IE70Fixes.css', 'screen', 'IE 7' );
 40+ // TODO: migrate
 41+ //$out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' );
4342
44 - $out->addStyle( 'monobook/rtl.css', 'screen', '', 'rtl' );
45 -
4643 }
4744 }
4845
Index: trunk/phase3/resources/Resources.php
@@ -14,6 +14,14 @@
1515 'vector' => new ResourceLoaderFileModule(
1616 array( 'styles' => array( 'skins/vector/screen.css' => array( 'media' => 'screen' ) ) )
1717 ),
 18+ 'monobook' => new ResourceLoaderFileModule(
 19+ array( 'styles' => array(
 20+ 'skins/monobook/main.css' => array( 'media' => 'screen' ),
 21+ // Honor $wgHandheldStyle. This is kind of evil
 22+ $GLOBALS['wgHandheldStyle'] => array( 'media' => 'handheld' )
 23+ )
 24+ )
 25+ ),
1826
1927 /* jQuery */
2028

Follow-up revisions

RevisionCommit summaryAuthorDate
r75006Temp fix for r74966 to stop causing errors everywherenikerabbit08:27, 19 October 2010
r75367Unused since r74966 $wgHandheldStyle is handled by the resourceloader.platonides17:12, 25 October 2010
r75548Followup r74966, r75006: load $wgHandheldStyle again in SkinMonoBook. Can't d...catrope15:21, 27 October 2010
r781751.17: Back out Monobook-to-ResourceLoader port, has issues on IE6. This rever...catrope11:53, 10 December 2010
r79129MFT r78011 r78014 r78015 r78016 r78099 r78117 r78161 r78170 r78172 r78199 r78......platonides19:58, 28 December 2010
r91672r74966: Deleting unused rtl.cssdiebuche19:47, 7 July 2011
r97623Reinstate IE*Fixes.css . This fixes most of the breakage from r74966, but the...catrope13:21, 20 September 2011
r101540Bug 31933: fix 1.18 regression in Monobook sidebar: huge spacing between port...brion22:08, 1 November 2011

Comments

#Comment by Catrope (talk | contribs)   20:37, 18 October 2010

Clearly I meant to say "Port Monobook to ResourceLoader"

#Comment by 😂 (talk | contribs)   21:26, 18 October 2010

From Translatewiki:

PHP Warning:  filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for /www/w/Array in /www/w/includes/ResourceLoaderModule.php on line 565
#Comment by Raymond (talk | contribs)   06:37, 19 October 2010

From Translatewiki too:

PHP Warning: file_get_contents(/www/w/Array) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /www/w/includes/ResourceLoaderModule.php on line 734

#Comment by Nikerabbit (talk | contribs)   08:28, 19 October 2010

+'skins/monobook/main.css' => array( 'media' => 'screen' ),

+// Honor $wgHandheldStyle. This is kind of evil
+$GLOBALS['wgHandheldStyle'] => array( 'media' => 'handheld' )

The last line makes no sense at all and seems to be the cause for problems mentioned above.

#Comment by Catrope (talk | contribs)   15:35, 19 October 2010

It makes sense: $wgHandheldStyle is supposed to be a path to a file.

However, it's also allowed to be false, in which case the index is 0 and the RL sees a numerically-indexed array, therefore thinking the value (which is an array) is the file name :(

#Comment by MaxSem (talk | contribs)   04:37, 22 October 2010

Another report: [[1]].

#Comment by Catrope (talk | contribs)   14:40, 23 October 2010

No concrete report there other than "I changed something in LocalSettings.php and now it works", that's of zero use to me. The only issue mentioned here has been fixed, so resetting to new.

#Comment by Platonides (talk | contribs)   16:49, 25 October 2010

r75006 wasn't a proper fix. $wgHandheldStyle url is no longer loaded.

(Although it still produces the undocumented feature of loading Mediawiki:Handheld.css)

#Comment by Catrope (talk | contribs)   15:22, 27 October 2010

Fixed in r75548.

#Comment by Simetrical (talk | contribs)   19:32, 28 November 2010

This totally messes up IE6 for me. The content area takes up the full width of the screen and the sidebar is pushed to the bottom.

#Comment by Happy-melon (talk | contribs)   21:33, 14 December 2010

Presumably this is because the IE-specific scripts are no longer loaded?

#Comment by Catrope (talk | contribs)   21:36, 14 December 2010

IEFixes*.css, yes. I was hoping Trevor would port those fixes into the main CSS file but that never happened.

#Comment by TheDJ (talk | contribs)   21:42, 24 January 2011

This is new:

html > body .portlet {
	float: left;
	clear: left;
}
/* recover IEMac (might be fine with the float, but usually it's close to IE */
*>body .portlet {
	float: none;
	clear: none;
}

it seems to come from rtl.css, but it isn't .rtl noflip atm. I'm also not entirely sure what this rtl specific element was supposed to fix in rtl.

#Comment by Krinkle (talk | contribs)   01:02, 3 June 2011

Just for the record, IEMac (or rather "IE5 for Mac") is no longer supported, so this may not be needed anymore if it's causing problems.

#Comment by Brion VIBBER (talk | contribs)   18:35, 1 November 2011

All it appears to do is add a lot of spacing in IE 7 and IE 8/9 in IE 7 compatibility mode: bug 31993

If there's no other reason for it, I say we kill it.

#Comment by Brion VIBBER (talk | contribs)   22:09, 1 November 2011

Checked with Roan about it on IRC; he doesn't remember much specific details about it but can confirm it was ported in from Monobook's old rtl.css. The floats no longer seem necessary either for LTR or RTL, and removing them (and the IE/Mac fixlet after it) seems fine on everything I've tested so far.

Removed these bits in r101540.

#Comment by MarkAHershberger (talk | contribs)   17:00, 13 September 2011

moving to new so krinkle can review to make sure everything has been addressed.

#Comment by Trevor Parscal (WMF) (talk | contribs)   18:32, 19 September 2011

This still has lots of issues, it should just be backed out until we can dedicate some resources to properly reproducing the monobook style in more modern code.

Screen Shot 2011-09-19 at 11.28.45 AM.png

#Comment by Catrope (talk | contribs)   15:34, 20 September 2011

Should be much better with r97623 and r97634. I've only tested in IE8 compat mode, though, so IE5/6 might still be broken, but reinstating the fixes CSS files means that most issues should be resolved at the expense of an additional request.

#Comment by Krinkle (talk | contribs)   18:00, 20 September 2011

IE5 should not be an issue imho as it's no longer supported. The content should visible and readable (which it is).

IE6 and IE7 still need attention though.

#Comment by Catrope (talk | contribs)   18:01, 20 September 2011

IE7 (or at least IE8 in IE7 compat mode) looks fine now, or at least not more broken than in 1.17. IE6 seems fine in Reedy's tests other than that the navigation tabs (article/discussion/edit/...) are missing somehow.

#Comment by Catrope (talk | contribs)   22:04, 20 September 2011

Trevor fixed more issues in r97661. Trevor, can this rev be marked resolved now?

#Comment by Reedy (talk | contribs)   23:16, 19 September 2011

Attempted to back this out of 1.18, but CSS merge conflicts. Would you mind doing it Roan?

#Comment by Trevor Parscal (WMF) (talk | contribs)   22:20, 20 September 2011

Yes

Status & tagging log