Last modified: 2011-04-14 15:12:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11738 - invalid HTML: invalid width attribute value
invalid HTML: invalid width attribute value
Status: NEW
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://meta.wikimedia.org/wiki/Help:T...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-22 03:31 UTC by Peter Moulder
Modified: 2011-04-14 15:12 UTC (History)
1 user (show)

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


Attachments

Description Peter Moulder 2007-10-22 03:31:32 UTC
http://en.wikipedia.org/wiki/Mozilla_Firefox has invalid HTML ‘<th width="37px">’: th/td's width attribute (http://www.w3.org/TR/html4/struct/tables.html#adef-width-TH and hence http://www.w3.org/TR/html4/types.html#type-length) should be either a plain integer ("37") or a percentage, not a number with units like the CSS width property.

The corresponding wiki markup seems to be simply ‘{{sisterlinks}}’.

I don't know how {{sisterlinks}} is implemented, but I'd guess that the problem is the same as for tables generally when a width param is given.

Looking at the Help pages for tables, I see that even one of the examples in http://en.wikipedia.org/wiki/Help:Table#Setting_your_column_widths (and its master copy http://meta.wikimedia.org/wiki/Help:Table) has the same problem: specifying width="100pt" among the parameters produces HTML with ‘<td width="100pt">’.

The fix is that a wiki param of ‘width="50px"’ should get converted to ‘width="50"’, while ‘width="100pt"’ should either get converted to a corresponding declaration in the style attribute (‘style="width: 100pt;"’) or be forbidden (getting the user to choose whether to use px or use a style element) or possibly get converted to px at a rate of 96px/in for screen and 128px/in for print (these numbers based on http://www.w3.org/TR/CSS21/syndata.html#length-units).

Whereas currently, the width param seems to be passed through verbatim with no checking, so one can have width="random garbage" in the HTML.

Wiki's shouldn't be able to pass arbitrary text into HTML, for the reasons given at http://en.wikipedia.org/wiki/Wikipedia:Technical_FAQ#Why_not_use_HTML.3F : it may allow triggering bugs in HTML user agents that expect valid HTML.
Comment 1 Peter Moulder 2007-10-22 04:11:14 UTC
If (as http://meta.wikimedia.org/wiki/Help:Table#Width.2C_height suggests) it's considered valuable for the width specification to be honoured even on user agents that ignore/mishandle inline CSS styling, then one could use the fact that the style attribute takes precedence over presentation attributes (for compliant browsers), and give both a width attribute and a style attribute with a width property even if this involves converting pt to px.


A related issue is that the bgcolor attribute is being passed through to HTML with invalid values.  E.g. one page (Saffron) has bgcolor=lightgreen, whereas the bgcolor attribute is restricted to 6-digit hexadecimal values and the 16 basic colors (http://www.w3.org/TR/html4/types.html#type-color).

(In fact even CSS2.1's background-color property accepts only 17 color names (adding orange: http://www.w3.org/TR/CSS21/syndata.html#length-units), unlike SVG1.1 which accepts the full X11 set of color names (http://www.w3.org/TR/SVG11/types.html#ColorKeywords).)

Ideal behaviour would be to continue to accept bgcolor=lightgreen and other X11/SVG color names as wiki markup, but to change it to bgcolor="#90ee90" in the generated HTML.

Whether or not this extension is implemented, unrecognized color names should not be passed through to HTML: the human editor should be made aware of the issue so that they can change to a recognized color form rather than have the invalid color recognized by some browsers and not by others, and also so as to reduce the opportunity to exploit bugs in user agents by giving invalid attribute values.
Comment 2 p858snake 2009-06-15 01:47:53 UTC
Changing Product: Wikimedia → Mediawiki
Changing Component: WikiBugs → user Interface
Reason: The wikibugs component is designed for the I.R.C. bot.

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


Navigation
Links