Last modified: 2010-09-29 00:26:33 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 T22495, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20495 - Support HTML5 data-* attributes
Support HTML5 data-* attributes
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.whatwg.org/specs/web-apps/...
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-03 20:26 UTC by Daniel Friesen
Modified: 2010-09-29 00:26 UTC (History)
3 users (show)

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


Attachments

Description Daniel Friesen 2009-09-03 20:26:44 UTC
HTML5 has a handy new feature. data-* attributes.
Lowercase attributes starting with data- are reserved by HTML5 for sites to store custom data in for use by their scripts (not for external use, and browsers are prohibited from giving them any special meaning).

HTML5 does define an elm.dataset used for getting data from those data- attributes, but that's not necessary to rely on as data- attributes can be extracted the same way as 

For a long period of time we've rejected html attributes from elements (except for a select few) to avoid people placing on* attributes, or other special attributes which may be interpreted by the browser in a way that could harm the reader.

As a result scripts like show/hide, and piles of others have resorted to abusing the class tag to pass config data to scripts.

HTML5 now defines data- as something which is safe to use. I think we should tweak the parser to allow data- attributes to be used inside markup, this way instead of abusing css classes scripts can make use of data- attributes to control their behavior.
Comment 1 The Evil IP address 2010-09-28 17:32:40 UTC
This was added some time ago already and is available if $wgHtml5 is true, so marking as FIXED.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2010-09-29 00:26:33 UTC
Specifically, this was added in r70980.

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


Navigation
Links