Last modified: 2014-06-16 17:20:46 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 T68413, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66413 - Obsolete style attributes like bgcolor are ignored by mobile site
Obsolete style attributes like bgcolor are ignored by mobile site
Status: NEW
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-10 12:42 UTC by Derk-Jan Hartman
Modified: 2014-06-16 17:20 UTC (History)
12 users (show)

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


Attachments

Description Derk-Jan Hartman 2014-06-10 12:42:32 UTC
https://en.wikipedia.org/wiki/User:TheDJ/bgcolor

https://en.m.wikipedia.org/wiki/User:TheDJ/bgcolor

The TD cell should be green. But in the mobile site it is red. This is because bgcolor is deprecated and unlike style="background-color" does not override stylesheets.

I think that this is an argument to make the parser/sanitizer start automatically converting these wikicode attributes into proper inline style attributes.
Comment 1 Erwin Dokter 2014-06-12 10:29:04 UTC
The background is white for me. Minerva (the mobile skin) sets the background for *everything* to "none". CSS always overrides old style HTML attributes.

There was a discussion on wether to convert all HTML attributes to CSS, but I can't find it. It mainly concerned tables.

Since these are deprecated, the question should be wether to 1) allow and leave untouched, 2) convert to CSS, or 3) cease support and remove them from the whitelist.
Comment 2 Derk-Jan Hartman 2014-06-12 10:46:53 UTC
Yeah this is a sort of perennial discussion on this front. basically 'bgcolor' is valid in the wikitext sense, but obsolete as HTML output. So if we can make it 'better' HTML, we probably should. Alternatively we could start thinking about a way to deprecate it in wikitext, but that isn't that easy to do.
Comment 3 Bartosz Dziewoński 2014-06-12 14:11:11 UTC
Surely Minerva could do `[bgcolor] { background-color: attr(bgcolor); }` on top of its reset CSS?
Comment 4 Bartosz Dziewoński 2014-06-12 14:14:16 UTC
We've already had the code to "rewrite" deprecated HTML elements and attributes and it was reverted because it did more harm than good, see bug 40632.
Comment 5 Erwin Dokter 2014-06-12 20:13:29 UTC
(In reply to Bartosz Dziewoński from comment #3)
> Surely Minerva could do `[bgcolor] { background-color: attr(bgcolor); }` on
> top of its reset CSS?

There is a truckload of other old attributes that will need to be handled as well. If we want to keep supporting obsolete attributes, translation to CSS is the only option. Do we have some official specification of what attributes wiki markup is supposed to support?
Comment 6 Derk-Jan Hartman 2014-06-13 06:42:54 UTC
@Bartosz, well I think we at LEAST should fix the reset skin of the mobile website indeed, to take this problem into account.

But I also never agreed with the full revert of the cleanuppresentationalattributes patch. I still think that for the majority of the attributes it was a sane approach. For align perhaps less so, but that is just one of them. The bigger problem is that we really should start thinking about what we want to do, if obsolete html is starting to cause problems in a newer skin like mobile, we can be sure that there are going to be other places where this is going to be a problem.

Support it in wikicode -> make it work by translating it to modern inline css form.
Don't support it in wikicode -> think about a strategy to get the content fixed.
Comment 7 Technical 13 2014-06-13 16:08:36 UTC
We really shouldn't be supporting these deprecated and obsolete standards at all.  Attempts to save should return to the user that they attempted to use EE element or FF attribute and that is no longer valid and they should use MM element or NN attribute instead.
Doing this will prevent people from maintaining these bad coding habits and when browser do flat out stop supporting them there won't be a bunch of new pages with all kinds of funky funk going on. The only thing left will be mostly archives and rarely used templates or pages which are less likely to be an issue.
Once the inflow of these elements is stopped, then cleaning out the backlog of the old ones that should be updated will be possible.

There is an ongoing RfC about this on enwiki at [[Wikipedia:Village pump (proposals)#RfC: Should deprecated/invalid/unsupported HTML tags be discouraged?]] that would allow softening the transition that should be happening to eliminate these elements from MediaWiki wikis.  This discussion shouldn't prevent or hold back discussion on making the core warn/refuse these bad elements as this is something that should be addressed on every project.
Comment 8 Bartosz Dziewoński 2014-06-16 14:06:02 UTC
Hey everyone, I have no opinion on this. I just knew it was done poorly before and backfired, and wanted anyone who would try doing this again to know this as well. By all means go ahead, and don't CC me on patches. :P
Comment 9 Erwin Dokter 2014-06-16 17:20:46 UTC
The previous attempt was rushed. I'm willing to take a stab, but I like to inventory which tags and attributes are currently supported, and which ones we want to support.

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


Navigation
Links