Commit graph

8 commits

Author SHA1 Message Date
Platonides
7d626b347b Use canonical case 2011-10-27 15:54:49 +00:00
Antoine Musso
9a2dc2d05a Tests for r96188 features
That revision let us pass an array of values to 'class', 'rel'
and 'accesskey'. The revision requested some tests :)
2011-10-24 17:45:45 +00:00
Krinkle
73db9698a3 Html.php: The "future"[1] is here. Add features for space-separated value attributes of html elements.
* Has been suggested since August 2009 in r54767 (doc-comment from rawElement/element function)
* Implements normalization for these attributes (removal of duplicates and redundant space)
* Adds support for arrays (instead of just string) for these attributes. 
* String are still supported, and are converted to arrays to get the same normalization.
* Wrote unit tests (which pass locally: $ php phpunit.php includes/HtmlTest.php)
* Not trigger for the media-attribute. Reason: Although some people think it's space-separated, it's actually comma-separated. Treating them as space separated might even destroy the value. [2] [3]. Neither the html4 or html5 spec documents media-attribute as space-separated, and as of HTML5/CSS3 the media attribute may contain "media queries".


[1] "In the future, other HTML-specific features might be added, like allowing arrays for the values of attributes like class= and media=" in r54767 by Simetrical.
[2] http://www.w3.org/TR/1999/REC-html401-19991224/types.html#h-6.13
[3] http://dev.w3.org/csswg/css3-mediaqueries/#background

Implementation note: I choose to have a single list of attributes that trigger this feature. Some of these attributes only support multiple values and/or are documented as space-separated as of html5 (such as accesskey), but since those attributes in general have existed in html4 as well (just different w3c spec), they are not stripped if wgHtml5 is not true. So if this feature would (eg. for accesskey) would only be done if wgHtml5=true, then people could get output like <a accesskey=Array /> depending on a configuration variable, which will get messy and make developers' life hard.
2011-09-03 03:55:23 +00:00
Krinkle
16caaa881a Whitespacing in HtmlTest.php 2011-09-03 01:42:43 +00:00
Alexandre Emsenhuber
1455fe4e21 $wgLanguageCode applies to $wgContLang, not $wgLang. This was breaking the test suite by dying with a "nooo!" in when reaching LanguageConverterTest. 2011-08-05 15:10:08 +00:00
Platonides
a326e60e48 Follow-up r92588. Make it work regardless of $wgHtml5 2011-07-19 22:10:05 +00:00
Platonides
a2251d34f9 Follow up r91419. A boolean attribute can be both the empty string and its name [http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#boolean-attributes]
We use the later since that's what xhtml1 required [http://www.w3.org/TR/xhtml1/#h-4.5].
2011-07-19 21:38:28 +00:00
Antoine Musso
2801589462 tests for Html::testExpandAttributes()
FIXME: seems a code duplication of Xml::expandAttributes()

follow up r81571 (skip attributes with null value)
2011-07-04 19:51:35 +00:00