From: Bartosz DziewoƄski Date: Fri, 28 Mar 2014 20:43:22 +0000 (+0100) Subject: mediawiki.ui: Do not depend on divs being present inside .mw-ui-vform X-Git-Tag: 1.31.0-rc.0~16393^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=616144da2bf665125680a3dedb12ea5098260a6a;p=lhc%2Fweb%2Fwiklou.git mediawiki.ui: Do not depend on divs being present inside .mw-ui-vform This breaks forms that try to use semantic elements like
, e.g. the user creation form here in core. Bug: 63233 Change-Id: Icb4a6d1d74490808b2fd1777d7dbe812e66bd206 --- diff --git a/resources/mediawiki.ui/components/default/forms.less b/resources/mediawiki.ui/components/default/forms.less index 5c6aa6ac2b..6157fa229a 100644 --- a/resources/mediawiki.ui/components/default/forms.less +++ b/resources/mediawiki.ui/components/default/forms.less @@ -40,46 +40,47 @@ width: @defaultFormWidth; // Immediate divs in a vform are block and spaced-out. + // XXX: We shouldn't depend on the tag name here... & > div { display: block; margin: 0 0 15px 0; padding: 0; width: 100%; + } - // MW currently doesn't use the type attribute everywhere on inputs. - input, - .mw-ui-button { - display: block; - .box-sizing(border-box); - margin: 0; - width: 100%; - } - - // We exclude these because they'll generally use mw-ui-button. - // Otherwise, we'll unintentionally override that. - input:not([type=button]):not([type=submit]):not([type=file]), { - .agora-field-styling(); // mixins/forms.less - } - - label { - display: block; - .box-sizing(border-box); - .agora-label-styling(); - width: auto; - margin: 0 0 0.2em; - padding: 0; - } - - // Override input styling just for checkboxes and radio inputs. - input[type="checkbox"], - input[type="radio"] { - display: inline; - .box-sizing(content-box); - width: auto; - } + // MW currently doesn't use the type attribute everywhere on inputs. + input, + .mw-ui-button { + display: block; + .box-sizing(border-box); + margin: 0; + width: 100%; + } + // We exclude these because they'll generally use mw-ui-button. + // Otherwise, we'll unintentionally override that. + input:not([type=button]):not([type=submit]):not([type=file]), { + .agora-field-styling(); // mixins/forms.less } + label { + display: block; + .box-sizing(border-box); + .agora-label-styling(); + width: auto; + margin: 0 0 0.2em; + padding: 0; + } + + // Override input styling just for checkboxes and radio inputs. + input[type="checkbox"], + input[type="radio"] { + display: inline; + .box-sizing(content-box); + width: auto; + } + + // Styles for information boxes // // Regular HTMLForm uses .error class, some special pages like @@ -132,6 +133,7 @@ // You generally don't need to use this class on divs within an Agora // form container such as mw-ui-vform // XXX DRY: This repeats earlier styling, use an @include agora-div-styling ? +// XXX: What is this even for? .mw-ui-vform-div { display: block; margin: 0 0 15px; diff --git a/resources/mediawiki.ui/components/vector/forms.less b/resources/mediawiki.ui/components/vector/forms.less index ebb175b944..2bbd8f0dbe 100644 --- a/resources/mediawiki.ui/components/vector/forms.less +++ b/resources/mediawiki.ui/components/vector/forms.less @@ -2,7 +2,7 @@ @import "../../mixins/type"; .mw-ui-vform, -.mw-ui-vform > div input, +.mw-ui-vform input, .mw-ui-input { .vector-type(); }