From 6529547f930f5a89fe64324e7520aee5877bacfc Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Thu, 27 Sep 2012 22:53:06 -0400 Subject: [PATCH] (bug 40384) Move width/height from button to img The fix for bug 34768 (r112710, regarding the lack of width and height attributes for the Vector skin's search button) failed to include the corresponding changes to SkinTemplate.php. Because BaseTemplate::makeSearchButton() only special cased the src and alt attributes, the width and height incorrectly went on the button element, causing HTML validation errors (and also having no effect). This patch moves the width and height attributes to the img element in a similar fashion to src and alt. Change-Id: I3561fc79364ce43521823bad691c9b61f87ba375 --- includes/SkinTemplate.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index dfd7dca306..5c8ffa68d5 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1783,11 +1783,15 @@ abstract class BaseTemplate extends QuickTemplate { ); unset( $buttonAttrs['src'] ); unset( $buttonAttrs['alt'] ); + unset( $buttonAttrs['width'] ); + unset( $buttonAttrs['height'] ); $imgAttrs = array( 'src' => $attrs['src'], 'alt' => isset( $attrs['alt'] ) ? $attrs['alt'] : $this->translator->translate( 'searchbutton' ), + 'width' => isset( $attrs['width'] ) ? $attrs['width'] : null, + 'height' => isset( $attrs['height'] ) ? $attrs['height'] : null, ); return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) ); default: -- 2.20.1