Commit graph

17 commits

Author SHA1 Message Date
Sam Reed
8e78fbe32b Cleanup a few unused globals 2012-02-16 02:35:48 +00:00
Antoine Musso
51dacc9fbf split ns selector tests for filter / disable options
ping r111376
2012-02-14 09:59:59 +00:00
Krinkle
78c157faf9 [Html] Follow-up r109990: Add support for excluding and disabling options 2012-02-13 15:08:26 +00:00
Krinkle
8a5c2c6026 [Html] Follow-up r109990: Add category to example namespaces
- Category is a special case since it is not moveable  by default, useful to keep in the test
2012-02-13 14:53:40 +00:00
Aaron Schulz
1bebf0c7ea Fixed windows-related test failures (that string format doesn't work with \r\n line endings as the \r chars are left in the PHP string). 2012-02-02 18:42:02 +00:00
Antoine Musso
9755d2e5aa test Html::namespaceSelector() id & name attributes generation
Method was introduced by r109990.
2012-01-30 10:39:51 +00:00
Chad Horohoe
e8da212569 Fixup r109698, add setter for $namespaceNames and use proper accessors in the tests.
Since we're here: nothing uses $namespaceNames, $mNamespaceIds or $namespaceAliases
outside of this class (core or extensions) so lets make it protected.
2012-01-27 13:00:26 +00:00
Krinkle
3065ece7a2 Fix broken unit test
* r109993 broke the test by overwriting namespaces it tried to preserve
* tearDown should always have the opposite order of the overrides in setUp
* Adding wgLanguageCode while at it, no reason not to, just in case.

-- Follows-up r109993
2012-01-25 03:45:01 +00:00
Krinkle
3c9d05055b [Html] Unit test + bugfix Html::namespaceSelector
* Previously it was passing $selectAttribs['name'] to Xml::label, which uses its value for the <label for=""> attribute. This works as long as $selectAttribs['id'] and $selectAttribs['name'] match, but when they don't it fails. <label for=""> always corresponds with <{input,text area,select} id=""> in browsers, never with "name".
* Make name/id match eachother by default to avoid backwards compatibility breakages (they used to match in the Xml class method as well)
* Add HtmlTest.php entries similar to the ones in XmlTest
* Fix E_NOTICE about $params['selected'], default to ''

-- Follows-up r109974, r109698, r109990
-- Bug originally introduced in r41425
-- XmlTest.php still runs successfully
-- HtmlTest.php runs successfully
2012-01-25 03:25:54 +00:00
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