From: Aryeh Gregor Date: Fri, 18 Sep 2009 14:19:34 +0000 (+0000) Subject: Don't drop default attrib values in non-HTML5 X-Git-Tag: 1.31.0-rc.0~39646 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=4a02cca0a3a9b5c4073a984e86f3f29f2b8a74d9;p=lhc%2Fweb%2Fwiklou.git Don't drop default attrib values in non-HTML5 Some attributes that have defaults in HTML5 don't have defaults in XHTML1, particularly type="" on scripts and styles (bug 20713). There's not much point in trying to maintain two separate sets of defaults, so I've just kept the HTML5 ones and haven't tried to strip any defaults in XHTML1 mode. --- diff --git a/includes/Html.php b/includes/Html.php index a841d83f54..8aa1de6034 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -195,6 +195,13 @@ class Html { * @return array An array of attributes functionally identical to $attribs */ private static function dropDefaults( $element, $attribs ) { + # Don't bother doing anything if we aren't outputting HTML5; it's too + # much of a pain to maintain two sets of defaults. + global $wgHtml5; + if ( !$wgHtml5 ) { + return $attribs; + } + static $attribDefaults = array( 'area' => array( 'shape' => 'rect' ), 'button' => array(