Follow up r91419. A boolean attribute can be both the empty string and its name ...
authorPlatonides <platonides@users.mediawiki.org>
Tue, 19 Jul 2011 21:38:28 +0000 (21:38 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 19 Jul 2011 21:38:28 +0000 (21:38 +0000)
We use the later since that's what xhtml1 required [http://www.w3.org/TR/xhtml1/#h-4.5].

tests/phpunit/includes/HtmlTest.php

index 96bb180..c0b4857 100644 (file)
@@ -47,14 +47,13 @@ class HtmlTest extends MediaWikiTestCase {
                        'Boolean attributes do not generates output when value is null'
                );
 
-               ### FIXME: maybe they should just output 'selected'
                $this->AssertEquals(
-                       ' selected=""',
+                       ' selected="selected"',
                        Html::expandAttributes( array( 'selected'=>true ) ),
                        'Boolean attributes skip value output'
                );
                $this->AssertEquals(
-                       ' selected=""',
+                       ' selected="selected"',
                        Html::expandAttributes( array( 'selected' ) ),
                        'Boolean attributes (ex: selected) do not need a value'
                );