Bug 28350 - REGRESSION (r47255): MediaWiki's (including Wikipedia) navigation pane appears below the main content
Summary: REGRESSION (r47255): MediaWiki's (including Wikipedia) navigation pane appear...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Evangelism (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Critical
Assignee: Nobody
URL:
Keywords: InRadar, Regression
: Peter (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-15 20:31 PDT by Ryosuke Niwa
Modified: 2019-03-11 19:38 PDT (History)
11 users (show)

See Also:


Attachments
Reduction (311 bytes, text/html)
2009-08-15 21:31 PDT, mitz
no flags Details
Extended test case (773 bytes, text/html)
2009-08-15 21:46 PDT, mitz
no flags Details
Proposed site-specific hack (3.03 KB, patch)
2009-08-16 02:02 PDT, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2009-08-15 20:31:58 PDT
Use the nightly build (27291) and go visit http://en.wikipedia.org/wiki/Main_Page
navigation, search, and all other contents on the left-pane shows up below the main content.
Comment 1 Simon Fraser (smfr) 2009-08-15 20:44:25 PDT
Maybe caused by http://trac.webkit.org/changeset/47255 ?
We don't have a regression window yet.
Comment 2 Simon Fraser (smfr) 2009-08-15 20:47:44 PDT
Yeah, reverting 47255 fixes it.
Comment 3 mitz 2009-08-15 20:59:13 PDT
Changing the page’s DOCTYPE to <!DOCTYPE html> causes the layout to break even without r47255.
Comment 4 mitz 2009-08-15 21:31:58 PDT
Created attachment 34916 [details]
Reduction
Comment 5 mitz 2009-08-15 21:46:34 PDT
Created attachment 34918 [details]
Extended test case

Firefox behavior is rather strange: in cases A and B, the overflow section (blue) clears the float (yellow), but in case C it does not. Note that the only difference between case B and case C is that the container has a top border.
Comment 6 mitz 2009-08-15 22:24:14 PDT
The layout difference between WebKit and Gecko is caused by <http://en.wikipedia.org/skins-1.5/monobook/KHTMLFixes.css>, which is loaded dynamically based on UA sniffing via JavaScript. The only rule in that style sheet is:

/* work around the horizontal scrollbars */
#column-content { margin-left: 0; }

which overrides the margin specific in main.css:

margin: 0 0 .6em -12.2em;

Using the Web Inspector to disable the 'margin-left: 0;' rule fixes the layout and does not cause a horizontal scroll bar to appear.
Comment 7 mitz 2009-08-15 22:28:40 PDT
<rdar://problem/7145895>
Comment 8 Ryosuke Niwa 2009-08-15 22:30:03 PDT
(In reply to comment #6)
> The layout difference between WebKit and Gecko is caused by
> <http://en.wikipedia.org/skins-1.5/monobook/KHTMLFixes.css>, which is loaded
> dynamically based on UA sniffing via JavaScript. The only rule in that style
> sheet is:
> 
> /* work around the horizontal scrollbars */
> #column-content { margin-left: 0; }
> 
> which overrides the margin specific in main.css:
> 
> margin: 0 0 .6em -12.2em;
> 
> Using the Web Inspector to disable the 'margin-left: 0;' rule fixes the layout
> and does not cause a horizontal scroll bar to appear.

Is that work around still required for the latest WebKit?  i.e. will horizontal
scrollbars appear without it?  If not, we can ask people in wikipedia to
disable that rule for the latest webkit.
Comment 9 mitz 2009-08-15 22:31:15 PDT
> > Using the Web Inspector to disable the 'margin-left: 0;' rule fixes the layout
> > and does not cause a horizontal scroll bar to appear.
> 
> Is that work around still required for the latest WebKit?  i.e. will horizontal
> scrollbars appear without it?

No. Like I said, disabling the rule does not cause a horizontal scroll bar to appear.

>  If not, we can ask people in wikipedia to
> disable that rule for the latest webkit.

I have moved the bug to the Evangelism component.
Comment 10 Ryosuke Niwa 2009-08-15 22:35:17 PDT
(In reply to comment #9)
> No. Like I said, disabling the rule does not cause a horizontal scroll bar to
> appear.

I see.  It seems like we should contact wikipedia then.
Comment 11 Ryosuke Niwa 2009-08-15 22:49:04 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > No. Like I said, disabling the rule does not cause a horizontal scroll bar to
> > appear.
> 
> I see.  It seems like we should contact wikipedia then.

Maybe we should bring it up at http://en.wikipedia.org/wiki/Wikipedia:Help_desk
Comment 12 Ryosuke Niwa 2009-08-16 00:53:53 PDT
Ugh... I just noticed that this bug reproduces on other MediaWiki as well.  We can't really force every site using MediaWiki to change their script.  e.g. http://www.mediawiki.org/wiki/MediaWiki

I guess we need to preserve the old behavior or add work around for MediaWiki.  But meanwhile, we should tell MediaWiki folks to modify the script so that it won't apply that style rule for the new versions of WebKit.
Comment 13 mitz 2009-08-16 02:02:12 PDT
Created attachment 34922 [details]
Proposed site-specific hack

The scope of this hack can be narrowed further by adding path components before /KHTMLFixes.css or widened by not requiring an exact string match. An alternative hack would be to bypass the UA detection, but I think would be more risky.
Comment 14 Dimitri Glazkov (Google) 2009-08-16 09:55:28 PDT
It's curious that Firefox does something completely different for the first Reduction: blue just overlaps yellow and stays side-by-side. What the heck is the "right" way here?
Comment 15 Dimitri Glazkov (Google) 2009-08-16 09:59:16 PDT
Extended test case appears to look the same pre-r47255 and post.
Comment 16 mitz 2009-08-16 10:00:15 PDT
(In reply to comment #15)
> Extended test case appears to look the same pre-r47255 and post.

Because it has <!DOCTYPE html>. Without it, it looks different in WebKit. Anyway, both test cases are pretty much irrelevant to this bug.
Comment 17 Dave Hyatt 2009-08-16 10:10:47 PDT
I'm confused... Wikipedia isn't in strict mode is it?  It looks like it's in "almost strict" mode, so isn't the strict mode issue relevant to this?
Comment 18 mitz 2009-08-16 10:14:19 PDT
(In reply to comment #17)
> I'm confused... Wikipedia isn't in strict mode is it?  It looks like it's in
> "almost strict" mode, so isn't the strict mode issue relevant to this?

<http://trac.webkit.org/changeset/47255> dropped unified float clearing behavior across modes since neither Firefox nor IE8 have the quirk WebKit used to have.
Comment 19 Ryosuke Niwa 2009-08-16 10:33:53 PDT
(In reply to comment #5)
> Created an attachment (id=34918) [details]
> Extended test case
> 
> Firefox behavior is rather strange: in cases A and B, the overflow section
> (blue) clears the float (yellow), but in case C it does not. Note that the only
> difference between case B and case C is that the container has a top border.

The rendering of this on WebKit and MSIE8 are identical.
Comment 20 Ryosuke Niwa 2009-08-16 10:36:07 PDT
(In reply to comment #5)
> Created an attachment (id=34918) [details]
> Extended test case
> 
> Firefox behavior is rather strange: in cases A and B, the overflow section
> (blue) clears the float (yellow), but in case C it does not. Note that the only
> difference between case B and case C is that the container has a top border.

On MSIE8, width of the outer box is ignored.  Yellow box appears on the right of screen, and blue box appears on the left with the same y.
Comment 21 Darin Adler 2009-08-16 10:45:42 PDT
Comment on attachment 34922 [details]
Proposed site-specific hack

r=me
Comment 22 Darin Adler 2009-08-16 10:50:14 PDT
I marked this as reviewed, because I think it's a great thing to do. We don't need a KHTML-specific style sheet that's working around a bug we no longer have.

Hyatt and other experts may wish to continue to debate other aspects of this, but it seems clear cut that we don't need this style rule.
Comment 23 Dave Hyatt 2009-08-16 12:04:21 PDT
I'm not a fan of this hack though.  What incentive does Wikipedia have to fix the issue if we work around it like this?  I am worried this hack will just stay in the code forever.
Comment 24 mitz 2009-08-16 12:11:34 PDT
(In reply to comment #23)
> I'm not a fan of this hack though.  What incentive does Wikipedia have to fix
> the issue if we work around it like this?  I am worried this hack will just
> stay in the code forever.

Yeah, that’s why I originally made this an evangelism bug. However, the problem here is that the buggy code is replicated in many websites that use the MediaWiki system, so this is more like the kind of workarounds we have for 3rd-party apps than a site-specific hack. Maybe the right thing to do is wait for Wikipedia to respond and if they do, re-evaluate the necessity of the hack.
Comment 25 Dave Hyatt 2009-08-16 12:12:11 PDT
I guess I'm just questioning what our site-specific-hack policy is.  Do we have to immediately put the site-specific hack into the code, or can we give evangelism some time to work first?
Comment 26 Dave Hyatt 2009-08-16 12:13:49 PDT
I guess I don't mind this landing as long as we have a bug open and continue to evangelize, but you have a bigger stick to bargain with when you can actually say "This is broken now. Please fix."  

If you approach Wikipedia with "Well this would be broken, but we worked around it, so you can work across old and new versions of WebKit without doing anything," then they have no incentive to change.
Comment 27 Dimitri Glazkov (Google) 2009-08-16 13:09:14 PDT
I can get WebKit evangelism folks at Google chip in with the effort as well.
Comment 28 Ryosuke Niwa 2009-08-16 13:24:46 PDT
(In reply to comment #26)
> I guess I don't mind this landing as long as we have a bug open and continue to
> evangelize, but you have a bigger stick to bargain with when you can actually
> say "This is broken now. Please fix."
> 
> If you approach Wikipedia with "Well this would be broken, but we worked around
> it, so you can work across old and new versions of WebKit without doing
> anything," then they have no incentive to change.

I agree.  It's probably better for us to contact MediaWiki / Wikipedia before we add this work around.
Comment 29 Peter Kasting 2009-08-16 15:14:21 PDT
(In reply to comment #25)
> I guess I'm just questioning what our site-specific-hack policy is.  Do we have
> to immediately put the site-specific hack into the code, or can we give
> evangelism some time to work first?

When this kind of issue came up for Google Chrome, I proposed that we have a policy of not doing site-specific hacks until we had contacted the site author(s) and obtained an agreement from them to fix their site.  At that point we could check in a temporary hack if fixing things was going to take time.  I'm not sure we made this our official policy but it got general agreement from those to whom I proposed it.  We used this pattern when dealing with a Hotmail problem (see http://googlechromereleases.blogspot.com/2009/01/stable-beta-update-yahoo-mail-and.html ).
Comment 30 Derk-Jan Hartman 2009-08-16 16:01:00 PDT
This KHTML specific line for mediawiki is already removed upstream, but it will take a LONG while before all the mediawiki installations are going to be updated. As noted, not even Wikipedia itself has this deployed yet at this time.

See: "* Remove five-year-old KHTMLFixes.css, which is unlikely to be relevant anymore  and was causing problems."

in http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/RELEASE-NOTES?revision=55124&view=markup
Comment 31 Derk-Jan Hartman 2009-08-16 16:04:57 PDT
specific revision:
http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=53141
Comment 32 Dimitri Glazkov (Google) 2009-08-16 16:14:23 PDT
(In reply to comment #30)
> This KHTML specific line for mediawiki is already removed upstream, but it will
> take a LONG while before all the mediawiki installations are going to be
> updated. As noted, not even Wikipedia itself has this deployed yet at this
> time.
> 
> See: "* Remove five-year-old KHTMLFixes.css, which is unlikely to be relevant
> anymore  and was causing problems."
> 
> in
> http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/RELEASE-NOTES?revision=55124&view=markup

This is precisely the gist of the issue. We're not dealing with one site, but a widely used software. This hack has also been duplicated verbatim on many derivative projects, such as GForge and SpringWiki, which makes evangelism effort a bit daunting.

The site-specific hack patch looks pretty good to me atm.
Comment 33 Aryeh Gregor 2009-08-16 16:24:42 PDT
This was due to ludicrously broken UA-sniffing on our part; sorry about that.  For those who didn't catch it, in May 2004 someone committed a workaround to MediaWiki for a KHTML bug.  Unfortunately, rather than using version-based sniffing, he just assumed all KHTML versions would have the bug forever -- KHTML was rather minor back then and it probably didn't seem important.  So we ended up serving the fix to WebKit well over five years later.

It came to light when I was trying out a switch to HTML 5, and the strict doctype caused incorrect display in WebKit.  When I figured out the problem I removed the check in r53141, which Derk-Jan linked to.  The fix will be in MediaWiki 1.16 and should go live on Wikipedia within a few weeks, but you're going to have to handle it for other MediaWiki installs for years, sadly.
Comment 34 Aryeh Gregor 2009-08-17 08:33:36 PDT
I got hold of the appropriate people just now, and Wikipedia is no longer serving the broken CSS:

http://en.wikipedia.org/skins-1.5/monobook/KHTMLFixes.css

The fix should also be in MediaWiki 1.16.  That should theoretically be released in a month, but might take longer.

Needless to say, though, there are a *lot* of MediaWiki installs out there that don't keep up with updates.  If you guys aren't willing to keep a site-specific hack in WebKit for a while, we could *maybe* backport the fix to old versions -- normally we only backport security fixes -- but we can't make people upgrade.  The breakage is pretty ugly, with all content shoved down a large amount.

For future reference, the best place to reach us is wikitech-l: <https://lists.wikimedia.org/mailman/listinfo/wikitech-l>.  Anything posted there will be read by most Wikimedia sysadmins and MediaWiki developers.  For real-time response, you can also go to #mediawiki (for MediaWiki) or #wikimedia-tech (for Wikimedia site administration) on freenode, but of course you'll reach fewer people that way.

Sorry about the problems we've caused.  Please let us know about any future difficulties.  I've posted on wikitech-l to remind people to be careful about browser sniffing in the future:

http://lists.wikimedia.org/pipermail/wikitech-l/2009-August/044767.html
Comment 35 Peter Kasting 2009-08-17 09:48:23 PDT
(In reply to comment #34)
> Needless to say, though, there are a *lot* of MediaWiki installs out there that
> don't keep up with updates.

My question would be whether these sites are high-profile enough that we should check in a site-specific hack for them, and whether not checking in would make it more likely that the site authors would update sooner.

To put it differently, if we do land this hack, what are the criteria we'll use to decide when to revert it, and how will we remember to check on them?
Comment 36 Dimitri Glazkov (Google) 2009-08-17 10:21:19 PDT
We chatted some more on #webkit and I believe the general consensus is that we don't to land this patch. Wikipedia is now serving the hack-free theme, which should serve as the right motivator for others to catch up.
Comment 37 Aryeh Gregor 2009-08-17 10:22:53 PDT
The largest single user of MediaWiki other than Wikimedia is wikia.com, most likely.  Some other large wikis are listed here:

http://s23.org/wikistats/largest_html.php

The problem is more lots of little sites than a few big ones, I'd think.  MediaWiki is probably the most popular wiki software out there even if you don't count Wikipedia.  For instance, my mother is an art historian and has sometimes used a wiki meant to track university job openings in 19th century art history, which runs MediaWiki.  She was using Chrome for a while and would undoubtedly summon me and ask for an explanation if it randomly broke.  There are zillions of little sites like that.

I don't what your/WebKit's attitude is on maintaining compatibility vs. cleaning out cruft, so I can't say what you should do.  Not having a fix in place for, say, the next couple of years would certainly break a lot of sites, that's all I can say.  We don't have a very good upgrade rate; there are still a remarkable number of sites running three-year-old copies of MediaWiki.
Comment 38 Ryosuke Niwa 2009-08-17 13:11:07 PDT
(In reply to comment #36)
> We chatted some more on #webkit and I believe the general consensus is that we
> don't to land this patch. Wikipedia is now serving the hack-free theme, which
> should serve as the right motivator for others to catch up.

We should publicize that version 1.16 or later is required.  Or otherwise people think it's WebKit/Safari/Chrome's fault and we obviously don't want that.
Comment 39 mitz 2009-08-17 13:21:32 PDT
Fixed in <http://trac.webkit.org/projects/webkit/changeset/47383>.
Comment 40 Alexey Proskuryakov 2009-08-19 18:04:39 PDT
*** Bug 28372 has been marked as a duplicate of this bug. ***
Comment 41 mitz 2009-09-13 15:23:47 PDT
The workaround doesn’t apply to yet older versions of MediaWiki (see <http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/monobook/KHTMLFixes.css?view=log&pathrev=53140>) because:
1) The stylesheet has only one instead of two trailing newlines and
2) The stylesheet is loaded from a <link> element rather than an @import rule
Comment 42 Darin Adler 2009-09-14 07:46:45 PDT
Are there some sites that still have that older version of MediaWiki running? Clearly it will be straightforward to broaden the workaround to cover the other cases if there is a significant benefit to doing so and at least one site to test with.
Comment 43 Aryeh Gregor 2009-09-14 09:03:24 PDT
Yes, it should be basically any MediaWiki site other than Wikipedia, due to the <link> issue.  The change from @import to <link> only occurred in <http://www.mediawiki.org/wiki/Special:Code/MediaWiki/52886>, which is after the last stable release (1.15).  So look at almost any non-Wikimedia, non-Wikia wiki that uses the default MonoBook skin, e.g., http://wikileaks.org/.  Wikileaks makes some effort to hide their version, but it looks like it's based off 1.10, so they should exhibit both problems (extra newline for <= 1.11, and <link> for <= 1.15).  I can confirm the problem is visible there.

For that matter, you could also check almost any wiki from this list that's not a Wikimedia or Wikia project:

http://s23.org/wikistats/largest_html.php?th=999&lines=999
Comment 44 mitz 2009-09-18 00:55:21 PDT
(In reply to comment #42)
> Are there some sites that still have that older version of MediaWiki running?
> Clearly it will be straightforward to broaden the workaround to cover the other
> cases if there is a significant benefit to doing so and at least one site to
> test with.

<http://wikileaks.org/> is one such site.
Comment 45 mitz 2009-09-27 19:05:44 PDT
Filed bug 29792.
Comment 46 Ryosuke Niwa 2012-05-03 03:09:06 PDT
Unfortunately, 47 out of 200 top WikiMedia users are still using the version 1.5 or older according to http://s23.org/wikistats/largest_html.php.

It appears that we'll need to wait for another couple of years before we can remove this work around.
Comment 47 Geoffrey Garen 2019-02-08 12:41:58 PST
Maybe try again now?
Comment 48 Ryosuke Niwa 2019-03-11 19:32:51 PDT
(In reply to Geoffrey Garen from comment #47)
> Maybe try again now?

It looks like Chromium has removed this code in 2013:
https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0

Only one year after I had commented above.
Comment 49 Ryosuke Niwa 2019-03-11 19:38:01 PDT
Tracking the removal in https://bugs.webkit.org/show_bug.cgi?id=195597.