From 4a02cca0a3a9b5c4073a984e86f3f29f2b8a74d9 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 18 Sep 2009 14:19:34 +0000 Subject: [PATCH] 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. --- includes/Html.php | 7 +++++++ 1 file changed, 7 insertions(+) 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( -- 2.20.1