Last modified: 2013-05-04 12:04:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41912, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39912 - Invalid value for HTML5 dir attribute ("auto")
Invalid value for HTML5 dir attribute ("auto")
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Watchlist (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Special:...
:
Depends on:
Blocks: html5
  Show dependency treegraph
 
Reported: 2012-09-02 17:31 UTC by Erwin Dokter
Modified: 2013-05-04 12:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Screenshot depicting error caused by dir="auto" (4.90 KB, image/png)
2012-09-02 18:14 UTC, Erwin Dokter
Details

Description Erwin Dokter 2012-09-02 17:31:02 UTC
I have noticed for a while that there are spacing errors in the watchlist comments, often with the comment text moving to the right over the right parenthesis. I have traced this back to the following HTML source: <span dir="auto">...some comment...</span>. Having searched the docs for the dir attribute, I can only conclude that "auto" in *not* a valid value for this attribute. Removing it, or changing it to "ltr" does fix the issue.
Comment 1 Erwin Dokter 2012-09-02 17:35:36 UTC
This also applies to history pages.
Comment 2 Brion Vibber 2012-09-02 17:43:42 UTC
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#the-dir-attribute

"The auto keyword, which maps to the auto state

Indicates that the contents of the element are explicitly embedded text, but that the direction is to be determined programmatically using the contents of the element (as described below).

Note: The heuristic used by this state is very crude (it just looks at the first character with a strong directionality, in a manner analogous to the Paragraph Level determination in the bidirectional algorithm). Authors are urged to only use this value as a last resort when the direction of the text is truly unknown and no better server-side heuristic can be applied. [BIDI]"



Offhand I don't see any problems in Firefox 17 nightly or in Chrome 21 on my watchlist. Can you provide a screenshot?
Comment 3 Erwin Dokter 2012-09-02 18:14:48 UTC
Created attachment 11055 [details]
Screenshot depicting error caused by dir="auto"

"auto" is only valid in HTML5, not XHTML. And why use it when even the doc states only to use it as a last resort due to the incertainties it entails?

Screenshot attached. Basically, dir="auto" makes Chrome treat any preceding spacing in span.comment as if word-wrap: nowrap; is applied.
Comment 4 Brad Jorsch 2012-09-02 20:01:03 UTC
(In reply to comment #3)
> And why use it when even the doc
> states only to use it as a last resort due to the incertainties it entails?

Well, in this case we don't know whether the user-entered edit summary is LTR or RTL, do we? That seems to fit "when the direction of the text is
truly unknown and no better server-side heuristic can be applied", unless we want MediaWiki to be hard-coding the same check the browser is supposed to do to output the dir="...".

> Screenshot attached. Basically, dir="auto" makes Chrome treat any preceding
> spacing in span.comment as if word-wrap: nowrap; is applied.

In other words, Chrome has a bug.

BTW, for anyone following along, the link for the comment in the screenshot appears to be https://en.wikipedia.org/w/index.php?title=Talk:Main_Page&offset=20120902180000&limit=1&action=history, if further testing is needed. A potentially more useful link is https://en.wikipedia.org/w/index.php?title=Special:Contributions/Gilderien&offset=20120605185300&target=Gilderien&limit=1 (from an earlier discussion at [[Wikipedia:Village pump (technical)/Archive 100#Anomalous Edit Summary]]), which has more spaces for Chrome to screw up on.
Comment 5 Erwin Dokter 2012-09-02 20:35:51 UTC
(In reply to comment #4)
> Well, in this case we don't know whether the user-entered edit summary is LTR
> or RTL, do we? That seems to fit "when the direction of the text is
> truly unknown and no better server-side heuristic can be applied", unless we
> want MediaWiki to be hard-coding the same check the browser is supposed to do
> to output the dir="...".

So why don't we?

> In other words, Chrome has a bug.

A I said earlier, "auto" is only valid in HTML5, and we don't serve HTML5. In other words, it's a MediaWiki bug :)

Is there any way to test how Chrome reacts as if it were HTML5?
Comment 6 Brion Vibber 2012-09-02 20:46:00 UTC
I can't reproduce a clear rendering bug with the first link <https://en.wikipedia.org/w/index.php?title=Talk:Main_Page&offset=20120902180000&limit=1&action=history> in Chrome 21 under Mac OS X 10.8.1 or Windows 8.

I can though see a weird spacing on <https://en.wikipedia.org/w/index.php?title=Special:Contributions/Gilderien&offset=20120605185300&target=Gilderien&limit=1> in Chrome 21 under both Mac OS X 10.8.1 and Windows 8: huge space gets snuck down to a single space if I change dir="auto" to dir="ltr" or dir="rtl".

Note there's another bug related to Chrome's handling of dir="auto" (bug 38109), which has corresponding upstream bugs filed for Chromium and WebKit.
Comment 7 Brion Vibber 2012-09-02 20:48:22 UTC
(In reply to comment #5)
> Is there any way to test how Chrome reacts as if it were HTML5?

* Save to disk.
* Replace the XHTML doctype with just <!DOCTYPE html>
* Load that html file.

Exact same behavior for me.
Comment 8 Brad Jorsch 2012-09-02 21:05:51 UTC
(In reply to comment #5)
> A I said earlier, "auto" is only valid in HTML5, and we don't serve HTML5. In
> other words, it's a MediaWiki bug :)

If that's your position, you might want to check http://www.w3.org/TR/xhtml1/normative.html#uaconf item 6. Still a Chrome bug.

> Is there any way to test how Chrome reacts as if it were HTML5?

Sure, just make an edit with multiple consecutive spaces in the summary and an autocomment on a test wiki where you can toggle $wgHtml5 on and off as needed. I don't have Chrome to test with, but in Chromium 21 here it happens regardless of the $wgHtml5 setting.
Comment 9 Robin Pepermans (SPQRobin) 2012-09-05 23:31:45 UTC
Note that enabling of $wgHtml5 on WMF wikis is currently scheduled for 17 September (bug 27478).
Comment 10 Erwin Dokter 2013-05-04 12:04:02 UTC
Issue is not relevant anymore.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links