VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342864 )

Change subject: Update OOjs UI to v0.20.0
......................................................................

Update OOjs UI to v0.20.0

Release notes:
 
https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.20.0

Change-Id: I10ef5d85fcfae3a0b22b07a8a5ed3ae3e2d51288
---
M composer.json
M composer.lock
M composer/installed.json
M oojs/oojs-ui/History.md
M oojs/oojs-ui/demos/pages/dialogs.js
M oojs/oojs-ui/demos/pages/widgets.js
M oojs/oojs-ui/demos/pages/widgets.php
M oojs/oojs-ui/package.json
M oojs/oojs-ui/php/layouts/ActionFieldLayout.php
M oojs/oojs-ui/php/layouts/FieldLayout.php
M oojs/oojs-ui/php/widgets/ButtonGroupWidget.php
M oojs/oojs-ui/php/widgets/ButtonInputWidget.php
M oojs/oojs-ui/php/widgets/ButtonWidget.php
M oojs/oojs-ui/php/widgets/CheckboxInputWidget.php
M oojs/oojs-ui/php/widgets/DropdownInputWidget.php
M oojs/oojs-ui/php/widgets/RadioInputWidget.php
M oojs/oojs-ui/php/widgets/TextInputWidget.php
17 files changed, 228 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor 
refs/changes/64/342864/1

diff --git a/composer.json b/composer.json
index 3fbea39..f7e0ee1 100644
--- a/composer.json
+++ b/composer.json
@@ -44,7 +44,7 @@
                "mediawiki/at-ease": "1.1.0",
                "monolog/monolog": "1.18.2",
                "nmred/kafka-php": "0.1.5",
-               "oojs/oojs-ui": "0.19.5",
+               "oojs/oojs-ui": "0.20.0",
                "oyejorge/less.php": "1.7.0.13",
                "pear/console_getopt": "1.4.1",
                "pear/mail": "1.3.0",
diff --git a/composer.lock b/composer.lock
index e64f9f1..8a1aa1c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";,
         "This file is @generated automatically"
     ],
-    "content-hash": "71b9faa5e2acff4dd9e8537effef845f",
+    "content-hash": "f1e1fe2d927a065045ecd31d1e929f5a",
     "packages": [
         {
             "name": "composer/semver",
@@ -465,16 +465,16 @@
         },
         {
             "name": "oojs/oojs-ui",
-            "version": "v0.19.5",
+            "version": "v0.20.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/wikimedia/oojs-ui.git";,
-                "reference": "cec211014af88f59d4c50674dbeda1cfdad1734b"
+                "reference": "4f9b97498a9f67f8cca372d0b84f35988e37d445"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/oojs-ui/zipball/cec211014af88f59d4c50674dbeda1cfdad1734b";,
-                "reference": "cec211014af88f59d4c50674dbeda1cfdad1734b",
+                "url": 
"https://api.github.com/repos/wikimedia/oojs-ui/zipball/4f9b97498a9f67f8cca372d0b84f35988e37d445";,
+                "reference": "4f9b97498a9f67f8cca372d0b84f35988e37d445",
                 "shasum": ""
             },
             "require": {
@@ -540,7 +540,7 @@
             ],
             "description": "Provides library of common widgets, layouts, and 
windows.",
             "homepage": "https://www.mediawiki.org/wiki/OOjs_UI";,
-            "time": "2017-03-07T22:12:26+00:00"
+            "time": "2017-03-15T16:45:48+00:00"
         },
         {
             "name": "oyejorge/less.php",
diff --git a/composer/installed.json b/composer/installed.json
index 38b5ca2..bd65894 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -2114,17 +2114,17 @@
     },
     {
         "name": "oojs/oojs-ui",
-        "version": "v0.19.5",
-        "version_normalized": "0.19.5.0",
+        "version": "v0.20.0",
+        "version_normalized": "0.20.0.0",
         "source": {
             "type": "git",
             "url": "https://github.com/wikimedia/oojs-ui.git";,
-            "reference": "cec211014af88f59d4c50674dbeda1cfdad1734b"
+            "reference": "4f9b97498a9f67f8cca372d0b84f35988e37d445"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/oojs-ui/zipball/cec211014af88f59d4c50674dbeda1cfdad1734b";,
-            "reference": "cec211014af88f59d4c50674dbeda1cfdad1734b",
+            "url": 
"https://api.github.com/repos/wikimedia/oojs-ui/zipball/4f9b97498a9f67f8cca372d0b84f35988e37d445";,
+            "reference": "4f9b97498a9f67f8cca372d0b84f35988e37d445",
             "shasum": ""
         },
         "require": {
@@ -2136,7 +2136,7 @@
             "mediawiki/mediawiki-codesniffer": "0.6.0",
             "phpunit/phpunit": "4.8.21"
         },
-        "time": "2017-03-07T22:12:26+00:00",
+        "time": "2017-03-15T16:45:48+00:00",
         "type": "library",
         "installation-source": "dist",
         "autoload": {
diff --git a/oojs/oojs-ui/History.md b/oojs/oojs-ui/History.md
index afbf42d..65764e8 100644
--- a/oojs/oojs-ui/History.md
+++ b/oojs/oojs-ui/History.md
@@ -1,4 +1,51 @@
 # OOjs UI Release History
+## v0.20.0 / 2017-03-15
+### Breaking changes
+* [BREAKING CHANGE] Element#scrollIntoView: Drop `complete` config option 
(James D. Forrester)
+* [BREAKING CHANGE] Element#scrollIntoView: Remove deprecated `complete` 
config parameter (James D. Forrester)
+* [BREAKING CHANGE] LabelElement: Remove deprecated `fitLabel` function (James 
D. Forrester)
+* [BREAKING CHANGE] MessageDialog: Drop the deprecated '`verbose`' flag (James 
D. Forrester)
+* [BREAKING CHANGE] PopupWidget#setAlignment: Remove backwards-compatibility 
(James D. Forrester)
+* [BREAKING CHANGE] Remove CapsuleMultiSelectWidget (James D. Forrester)
+* [BREAKING CHANGE] Remove TextInputMenuSelectWidget (James D. Forrester)
+* [BREAKING CHANGE] TextInputWidget: Remove `type=date`/`month` support 
(Geoffrey Mon)
+* [BREAKING CHANGE] icons: Drop '…Undo' icons, deprecated in 0.18.3 (James D. 
Forrester)
+* [BREAKING CHANGE] icons: Drop 'beta' and 'ribbonPrize', deprecated in 0.18.3 
(James D. Forrester)
+* [BREAKING CHANGE] icons: Drop 'betaLaunch', deprecated in 0.18.3 (James D. 
Forrester)
+* [BREAKING CHANGE] icons: Drop status flags from Wikimedia (logos) icon pack 
(Volker E)
+
+### Deprecations
+* [DEPRECATING CHANGE] ActionWidget/Set: Warn for methods using the `resize` 
event (Prateek Saxena)
+
+### Features
+* Use `<span>` rather than `<div>` for inline-ish widgets (Bartosz Dziewoński)
+* CapsuleMultiselectWidget: Call `updateInputSize` when adding, removing items 
(Prateek Saxena)
+* DropdownInputWidget: Add support for `optgroup` (Prateek Saxena)
+* FieldLayout: Use `<span>` rather than `<div>` when possible (Bartosz 
Dziewoński)
+
+### Styles
+* DropdownInputWidget: Tweak PHP widget's disabled styling (Bartosz Dziewoński)
+* NumberInputWidget: Set input to 100% height (Volker E)
+* MediaWiki theme: Add unit to `line-height` for Chrome (Volker E)
+* MediaWiki theme: Align “framed” ButtonWidgets cross-browser (Volker E)
+* MediaWiki theme: Ensure theme color in disabled TextInputWidget on Safari 
(Volker E)
+* MediaWiki theme: Ensure vertical alignment of dialog top bar items (Volker E)
+* MediaWiki theme: Fix TextInputWidget's IconElement `max-height` (Volker E)
+* MediaWiki theme: Fix appearance of ComboBoxInputWidget PHP (Volker E)
+* MediaWiki theme: Use color palette color for dialog top bar (Volker E)
+* MediaWiki theme: Vertically align label in SelectFileWidget (Volker E)
+
+### Code
+* DropdownInputWidget: Remove accidental patterned background in PHP (Bartosz 
Dziewoński)
+* MediaWiki theme: Align WindowManager to CSS Coding Guidelines (Volker E)
+* MediaWiki theme: Indicators shouldn't provide global `progressive` flag 
(Volker E)
+* MediaWiki theme: Simplify Radio- & Checkbox…optionWidget label rules (Volker 
E)
+* build: Bump various devDependencies to master (James D. Forrester)
+* build: Exclude demos/vendor from composer test too (James D. Forrester)
+* demos: Add ButtonGroupWidget (icon and text) demo (Volker E)
+* demos: Add disabled DropdownInputWidget demo (Bartosz Dziewoński)
+
+
 ## v0.19.5 / 2017-03-07
 ### Deprecations
 * [DEPRECATING CHANGE] icons: Move 'add' from core to 'interactions' pack 
(James D. Forrester)
diff --git a/oojs/oojs-ui/demos/pages/dialogs.js 
b/oojs/oojs-ui/demos/pages/dialogs.js
index 979c28a..ad1cc53 100644
--- a/oojs/oojs-ui/demos/pages/dialogs.js
+++ b/oojs/oojs-ui/demos/pages/dialogs.js
@@ -127,12 +127,11 @@
                                        }
                                },
                                {
-                                       name: 'Message dialog (verbose)',
+                                       name: 'Message dialog (lengthy)',
                                        dialogClass: OO.ui.MessageDialog,
                                        data: {
                                                title: 'Continue?',
-                                               message: 'Lorem ipsum dolor sit 
amet, consectetur adipiscing elit. Pellentesque quis laoreet elit. Nam eu velit 
ullamcorper, volutpat elit sed, viverra massa. Aenean congue aliquam lorem, et 
laoreet risus condimentum vel. Praesent nec imperdiet mauris. Nunc eros magna, 
iaculis sit amet ante id, dapibus tristique lorem. Praesent in feugiat lorem, 
sit amet porttitor eros. Donec sapien turpis, pretium eget ligula id, 
scelerisque tincidunt diam. Pellentesque a venenatis tortor, at luctus nisl. 
Quisque vel urna a enim mattis rutrum. Morbi eget consequat nisl. Nam tristique 
molestie diam ac consequat. Nam varius adipiscing mattis. Praesent sodales 
volutpat nulla lobortis iaculis. Quisque vel odio eget diam posuere imperdiet. 
Fusce et iaculis odio. Donec in nibh ut dui accumsan vehicula quis et massa.',
-                                               verbose: true
+                                               message: 'Lorem ipsum dolor sit 
amet, consectetur adipiscing elit. Pellentesque quis laoreet elit. Nam eu velit 
ullamcorper, volutpat elit sed, viverra massa. Aenean congue aliquam lorem, et 
laoreet risus condimentum vel. Praesent nec imperdiet mauris. Nunc eros magna, 
iaculis sit amet ante id, dapibus tristique lorem. Praesent in feugiat lorem, 
sit amet porttitor eros. Donec sapien turpis, pretium eget ligula id, 
scelerisque tincidunt diam. Pellentesque a venenatis tortor, at luctus nisl. 
Quisque vel urna a enim mattis rutrum. Morbi eget consequat nisl. Nam tristique 
molestie diam ac consequat. Nam varius adipiscing mattis. Praesent sodales 
volutpat nulla lobortis iaculis. Quisque vel odio eget diam posuere imperdiet. 
Fusce et iaculis odio. Donec in nibh ut dui accumsan vehicula quis et massa.'
                                        }
                                },
                                {
diff --git a/oojs/oojs-ui/demos/pages/widgets.js 
b/oojs/oojs-ui/demos/pages/widgets.js
index e15bcb2..d859bbf 100644
--- a/oojs/oojs-ui/demos/pages/widgets.js
+++ b/oojs/oojs-ui/demos/pages/widgets.js
@@ -364,7 +364,25 @@
                                                ]
                                        } ),
                                        {
-                                               label: 'ButtonGroupWidget 
(feat. destructive and progressive ButtonWidget)',
+                                               label: 'ButtonGroupWidget 
(destructive and progressive ButtonWidget)',
+                                               align: 'top'
+                                       }
+                               ),
+                               new OO.ui.FieldLayout(
+                                       new OO.ui.ButtonGroupWidget( {
+                                               items: [
+                                                       new OO.ui.ButtonWidget( 
{
+                                                               icon: 'tag',
+                                                               flags: [ 
'destructive' ]
+                                                       } ),
+                                                       new OO.ui.ButtonWidget( 
{
+                                                               label: 'Two',
+                                                               flags: [ 
'progressive' ]
+                                                       } )
+                                               ]
+                                       } ),
+                                       {
+                                               label: 'ButtonGroupWidget 
(destructive icon and progressive text)\u200E',
                                                align: 'top'
                                        }
                                ),
@@ -1164,8 +1182,7 @@
                                                                label: 'Third'
                                                        }
                                                ],
-                                               value: 'b',
-                                               title: 'Select an item'
+                                               value: 'b'
                                        } ),
                                        {
                                                label: 'DropdownInputWidget',
@@ -1174,6 +1191,44 @@
                                ),
                                new OO.ui.FieldLayout(
                                        new OO.ui.DropdownInputWidget( {
+                                               disabled: true
+                                       } ),
+                                       {
+                                               label: 'DropdownInputWidget 
(disabled)',
+                                               align: 'top'
+                                       }
+                               ),
+                               new OO.ui.FieldLayout(
+                                       new OO.ui.DropdownInputWidget( {
+                                               options: [
+                                                       {
+                                                               optgroup: 
'Vowels'
+                                                       },
+                                                       {
+                                                               data: 'a',
+                                                               label: 'A'
+                                                       },
+                                                       {
+                                                               optgroup: 
'Consonants'
+                                                       },
+                                                       {
+                                                               data: 'b',
+                                                               label: 'B'
+                                                       },
+                                                       {
+                                                               data: 'c',
+                                                               label: 'C'
+                                                       }
+                                               ],
+                                               value: 'b'
+                                       } ),
+                                       {
+                                               label: 'DropdownInputWidget 
(with optgroup)',
+                                               align: 'top'
+                                       }
+                               ),
+                               new OO.ui.FieldLayout(
+                                       new OO.ui.DropdownInputWidget( {
                                                options: [
                                                        { data: 'sq', label: 
'Albanian' },
                                                        { data: 'frp', label: 
'Arpitan' },
diff --git a/oojs/oojs-ui/demos/pages/widgets.php 
b/oojs/oojs-ui/demos/pages/widgets.php
index 05b34c4..6d4a555 100644
--- a/oojs/oojs-ui/demos/pages/widgets.php
+++ b/oojs/oojs-ui/demos/pages/widgets.php
@@ -526,8 +526,7 @@
                                                'label' => 'Third'
                                        ]
                                ],
-                               'value' => 'b',
-                               'title' => 'Select an item'
+                               'value' => 'b'
                        ] ),
                        [
                                'label' => 'DropdownInputWidget',
@@ -536,6 +535,44 @@
                ),
                new OOUI\FieldLayout(
                        new OOUI\DropdownInputWidget( [
+                               'disabled' => true
+                       ] ),
+                       [
+                               'label' => 'DropdownInputWidget (disabled)',
+                               'align' => 'top'
+                       ]
+               ),
+               new OOUI\FieldLayout(
+                       new OOUI\DropdownInputWidget( [
+                               'options' => [
+                                       [
+                                               'optgroup' => 'Vowels'
+                                       ],
+                                       [
+                                               'data' => 'a',
+                                               'label' => 'A'
+                                       ],
+                                       [
+                                               'optgroup' => 'Consonants'
+                                       ],
+                                       [
+                                               'data' => 'b',
+                                               'label' => 'B'
+                                       ],
+                                       [
+                                               'data' => 'c',
+                                               'label' => 'C'
+                                       ]
+                               ],
+                               'value' => 'b'
+                       ] ),
+                       [
+                               'label' => 'DropdownInputWidget (with 
optgroup)',
+                               'align' => 'top'
+                       ]
+               ),
+               new OOUI\FieldLayout(
+                       new OOUI\DropdownInputWidget( [
                                'options' => [
                                        [ 'data' => 'sq', 'label' => 'Albanian' 
],
                                        [ 'data' => 'frp', 'label' => 'Arpitan' 
],
diff --git a/oojs/oojs-ui/package.json b/oojs/oojs-ui/package.json
index d202374..1e34391 100644
--- a/oojs/oojs-ui/package.json
+++ b/oojs/oojs-ui/package.json
@@ -1,6 +1,6 @@
 {
   "name": "oojs-ui",
-  "version": "0.19.5",
+  "version": "0.20.0",
   "description": "User interface classes built on the OOjs framework.",
   "keywords": [
     "oojs-plugin",
@@ -28,13 +28,13 @@
   "devDependencies": {
     "eslint-config-wikimedia": "0.3.0",
     "grunt": "1.0.1",
-    "grunt-banana-checker": "0.5.0",
+    "grunt-banana-checker": "0.6.0",
     "grunt-contrib-clean": "1.0.0",
     "grunt-contrib-concat": "1.0.1",
     "grunt-contrib-copy": "1.0.0",
-    "grunt-contrib-cssmin": "1.0.2",
-    "grunt-contrib-less": "1.4.0",
-    "grunt-contrib-uglify": "2.0.0",
+    "grunt-contrib-cssmin": "2.0.0",
+    "grunt-contrib-less": "1.4.1",
+    "grunt-contrib-uglify": "2.2.0",
     "grunt-contrib-watch": "1.0.0",
     "grunt-csscomb": 
"git://github.com/jdforrester/grunt-csscomb.git#v3.1.0-wmf.1",
     "grunt-cssjanus": "0.3.2",
diff --git a/oojs/oojs-ui/php/layouts/ActionFieldLayout.php 
b/oojs/oojs-ui/php/layouts/ActionFieldLayout.php
index bdcbad0..294a16f 100644
--- a/oojs/oojs-ui/php/layouts/ActionFieldLayout.php
+++ b/oojs/oojs-ui/php/layouts/ActionFieldLayout.php
@@ -32,8 +32,8 @@
 
                // Properties
                $this->buttonWidget = $buttonWidget;
-               $this->button = new Tag( 'div' );
-               $this->input = new Tag( 'div' );
+               $this->button = new Tag( 'span' );
+               $this->input = $this->isFieldInline() ? new Tag( 'span' ) : new 
Tag( 'div' );
 
                // Initialization
                $this->addClasses( [ 'oo-ui-actionFieldLayout' ] );
diff --git a/oojs/oojs-ui/php/layouts/FieldLayout.php 
b/oojs/oojs-ui/php/layouts/FieldLayout.php
index 1681550..beae36b 100644
--- a/oojs/oojs-ui/php/layouts/FieldLayout.php
+++ b/oojs/oojs-ui/php/layouts/FieldLayout.php
@@ -87,9 +87,9 @@
                $this->fieldWidget = $fieldWidget;
                $this->errors = isset( $config['errors'] ) ? $config['errors'] 
: [];
                $this->notices = isset( $config['notices'] ) ? 
$config['notices'] : [];
-               $this->field = new Tag( 'div' );
+               $this->field = $this->isFieldInline() ? new Tag( 'span' ) : new 
Tag( 'div' );
                $this->messages = new Tag( 'ul' );
-               $this->header = new Tag( 'div' );
+               $this->header = new Tag( 'span' );
                $this->body = new Tag( 'div' );
                if ( isset( $config['help'] ) ) {
                        $this->help = new ButtonWidget( [
@@ -168,6 +168,18 @@
        }
 
        /**
+        * Return `true` if the given field widget can be used with `'inline'` 
alignment (see
+        * setAlignment()). Return `false` if it can't or if this can't be 
determined.
+        *
+        * @return bool
+        */
+       public function isFieldInline() {
+               // This is very simplistic, but should be good enough. It's 
important to avoid false positives,
+               // as that will cause the generated HTML to be invalid and go 
all out of whack when parsed.
+               return strtolower( $this->getField()->getTag() ) === 'span';
+       }
+
+       /**
         * Set the field alignment mode.
         *
         * @param string $value Alignment mode, either 'left', 'right', 'top' 
or 'inline'
@@ -179,6 +191,10 @@
                        if ( !in_array( $value, [ 'left', 'right', 'top', 
'inline' ] ) ) {
                                $value = 'left';
                        }
+                       // Validate
+                       if ( $value === 'inline' && !$this->isFieldInline() ) {
+                               $value = 'top';
+                       }
                        // Reorder elements
                        $this->body->clearContent();
                        if ( $value === 'top' ) {
diff --git a/oojs/oojs-ui/php/widgets/ButtonGroupWidget.php 
b/oojs/oojs-ui/php/widgets/ButtonGroupWidget.php
index 58e6240..2937705 100644
--- a/oojs/oojs-ui/php/widgets/ButtonGroupWidget.php
+++ b/oojs/oojs-ui/php/widgets/ButtonGroupWidget.php
@@ -10,6 +10,10 @@
 class ButtonGroupWidget extends Widget {
        use GroupElement;
 
+       /* Static Properties */
+
+       public static $tagName = 'span';
+
        /**
         * @param array $config Configuration options
         * @param ButtonWidget[] $config['items'] Buttons to add
diff --git a/oojs/oojs-ui/php/widgets/ButtonInputWidget.php 
b/oojs/oojs-ui/php/widgets/ButtonInputWidget.php
index a50138a..b4d1c08 100644
--- a/oojs/oojs-ui/php/widgets/ButtonInputWidget.php
+++ b/oojs/oojs-ui/php/widgets/ButtonInputWidget.php
@@ -21,6 +21,8 @@
         */
        public static $supportsSimpleLabel = false;
 
+       public static $tagName = 'span';
+
        /* Properties */
 
        /**
diff --git a/oojs/oojs-ui/php/widgets/ButtonWidget.php 
b/oojs/oojs-ui/php/widgets/ButtonWidget.php
index 8fa1c3f..fcaa205 100644
--- a/oojs/oojs-ui/php/widgets/ButtonWidget.php
+++ b/oojs/oojs-ui/php/widgets/ButtonWidget.php
@@ -15,6 +15,12 @@
        use TabIndexedElement;
        use AccessKeyedElement;
 
+       /* Static Properties */
+
+       public static $tagName = 'span';
+
+       /* Properties */
+
        /**
         * Whether button is active.
         *
diff --git a/oojs/oojs-ui/php/widgets/CheckboxInputWidget.php 
b/oojs/oojs-ui/php/widgets/CheckboxInputWidget.php
index 44167fd..9e6e0d0 100644
--- a/oojs/oojs-ui/php/widgets/CheckboxInputWidget.php
+++ b/oojs/oojs-ui/php/widgets/CheckboxInputWidget.php
@@ -7,6 +7,10 @@
  */
 class CheckboxInputWidget extends InputWidget {
 
+       /* Static Properties */
+
+       public static $tagName = 'span';
+
        /* Properties */
 
        /**
diff --git a/oojs/oojs-ui/php/widgets/DropdownInputWidget.php 
b/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
index ddc3a02..359858c 100644
--- a/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
+++ b/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
@@ -55,21 +55,29 @@
                $value = $this->getValue();
                $isValueAvailable = false;
                $this->options = [];
+               $container = $this->input;
 
                // Rebuild the dropdown menu
                $this->input->clearContent();
                foreach ( $options as $opt ) {
-                       $optValue = $this->cleanUpValue( $opt['data'] );
-                       $option = ( new Tag( 'option' ) )
-                               ->setAttributes( [ 'value' => $optValue ] )
-                               ->appendContent( isset( $opt['label'] ) ? 
$opt['label'] : $optValue );
+                       if ( empty( $opt['optgroup'] ) ) {
+                               $optValue = $this->cleanUpValue( $opt['data'] );
+                               $option = ( new Tag( 'option' ) )
+                                       ->setAttributes( [ 'value' => $optValue 
] )
+                                       ->appendContent( isset( $opt['label'] ) 
? $opt['label'] : $optValue );
 
-                       if ( $value === $optValue ) {
-                               $isValueAvailable = true;
+                               if ( $value === $optValue ) {
+                                       $isValueAvailable = true;
+                               }
+                               $container->appendContent( $option );
+                       } else {
+                               $option = ( new Tag( 'optgroup' ) )
+                                       ->setAttributes( [ 'label' => 
$opt['optgroup'] ] );
+                               $this->input->appendContent( $option );
+                               $container = $option;
                        }
 
                        $this->options[] = $option;
-                       $this->input->appendContent( $option );
                }
 
                // Restore the previous value, or reset to something sensible
@@ -89,9 +97,14 @@
        public function getConfig( &$config ) {
                $o = [];
                foreach ( $this->options as $option ) {
-                       $label = $option->content[0];
-                       $data = $option->getAttribute( 'value' );
-                       $o[] = [ 'data' => $data, 'label' => $label ];
+                       if ( $option->getTag() !== 'optgroup' ) {
+                               $label = $option->content[0];
+                               $data = $option->getAttribute( 'value' );
+                               $o[] = [ 'data' => $data, 'label' => $label ];
+                       } else {
+                               $optgroup = $option->getAttribute( 'label' );
+                               $o[] = [ 'optgroup' => $optgroup ];
+                       }
                }
                $config['options'] = $o;
                return parent::getConfig( $config );
diff --git a/oojs/oojs-ui/php/widgets/RadioInputWidget.php 
b/oojs/oojs-ui/php/widgets/RadioInputWidget.php
index f35f22d..4a0f359 100644
--- a/oojs/oojs-ui/php/widgets/RadioInputWidget.php
+++ b/oojs/oojs-ui/php/widgets/RadioInputWidget.php
@@ -7,6 +7,10 @@
  */
 class RadioInputWidget extends InputWidget {
 
+       /* Static Properties */
+
+       public static $tagName = 'span';
+
        /**
         * @param array $config Configuration options
         * @param boolean $config['selected'] Whether the radio button is 
initially selected
diff --git a/oojs/oojs-ui/php/widgets/TextInputWidget.php 
b/oojs/oojs-ui/php/widgets/TextInputWidget.php
index 0531256..20cf035 100644
--- a/oojs/oojs-ui/php/widgets/TextInputWidget.php
+++ b/oojs/oojs-ui/php/widgets/TextInputWidget.php
@@ -42,7 +42,7 @@
        /**
         * @param array $config Configuration options
         * @param string $config['type'] HTML tag `type` attribute: 'text', 
'password', 'search', 'email',
-        *   'url', 'date', 'month' or 'number'. Ignored if `multiline` is 
true. (default: 'text')
+        *   'url' or 'number'. Ignored if `multiline` is true. (default: 
'text')
         *
         *   Some values of `type` result in additional behaviors:
         *   - `search`: implies `icon: 'search'` and `indicator: 'clear'`; 
when clicked, the indicator
@@ -189,8 +189,6 @@
                        'search',
                        'email',
                        'url',
-                       'date',
-                       'month',
                        'number'
                ];
                return in_array( $config['type'], $allowedTypes ) ? 
$config['type'] : 'text';

-- 
To view, visit https://gerrit.wikimedia.org/r/342864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10ef5d85fcfae3a0b22b07a8a5ed3ae3e2d51288
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vendor
Gerrit-Branch: master
Gerrit-Owner: VolkerE <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to