mediawiki.ui: Do not depend on divs being present inside .mw-ui-vform
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 28 Mar 2014 20:43:22 +0000 (21:43 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 29 Mar 2014 14:42:00 +0000 (14:42 +0000)
This breaks forms that try to use semantic elements like <section>,
e.g. the user creation form here in core.

Bug: 63233
Change-Id: Icb4a6d1d74490808b2fd1777d7dbe812e66bd206

resources/mediawiki.ui/components/default/forms.less
resources/mediawiki.ui/components/vector/forms.less

index 5c6aa6a..6157fa2 100644 (file)
        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
 // 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;
index ebb175b..2bbd8f0 100644 (file)
@@ -2,7 +2,7 @@
 @import "../../mixins/type";
 
 .mw-ui-vform,
-.mw-ui-vform > div input,
+.mw-ui-vform input,
 .mw-ui-input {
        .vector-type();
 }