Update OOjs UI to v0.23.2
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-core.js
index 4300e88..af099a9 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.22.4
+ * OOjs UI v0.23.2
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2017 OOjs UI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2017-08-01T23:45:14Z
+ * Date: 2017-09-26T20:18:42Z
  */
 ( function ( OO ) {
 
@@ -362,6 +362,8 @@ OO.ui.infuse = function ( idOrNode ) {
                'ooui-toolgroup-expand': 'More',
                // Label for the fake tool that collapses the full list of tools in a toolbar group
                'ooui-toolgroup-collapse': 'Fewer',
+               // Default label for the tooltip for the button that removes a tag item
+               'ooui-item-remove': 'Remove',
                // Default label for the accept button of a confirmation dialog
                'ooui-dialog-message-accept': 'OK',
                // Default label for the reject button of a confirmation dialog
@@ -659,7 +661,7 @@ OO.ui.Element.static.tagName = 'div';
 OO.ui.Element.static.infuse = function ( idOrNode ) {
        var obj = OO.ui.Element.static.unsafeInfuse( idOrNode, false );
        // Verify that the type matches up.
-       // FIXME: uncomment after T89721 is fixed (see T90929)
+       // FIXME: uncomment after T89721 is fixed, see T90929.
        /*
        if ( !( obj instanceof this['class'] ) ) {
                throw new Error( 'Infusion type mismatch!' );
@@ -681,7 +683,7 @@ OO.ui.Element.static.infuse = function ( idOrNode ) {
  */
 OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
        // look for a cached result of a previous infusion.
-       var id, $elem, data, cls, parts, parent, obj, top, state, infusedChildren;
+       var id, $elem, error, data, cls, parts, parent, obj, top, state, infusedChildren;
        if ( typeof idOrNode === 'string' ) {
                id = idOrNode;
                $elem = $( document.getElementById( id ) );
@@ -690,7 +692,14 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
                id = $elem.attr( 'id' );
        }
        if ( !$elem.length ) {
-               throw new Error( 'Widget not found: ' + id );
+               if ( typeof idOrNode === 'string' ) {
+                       error = 'Widget not found: ' + idOrNode;
+               } else if ( idOrNode && idOrNode.selector ) {
+                       error = 'Widget not found: ' + idOrNode.selector;
+               } else {
+                       error = 'Widget not found';
+               }
+               throw new Error( error );
        }
        if ( $elem[ 0 ].oouiInfused ) {
                $elem = $elem[ 0 ].oouiInfused;
@@ -735,12 +744,7 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
        parts = data._.split( '.' );
        cls = OO.getProp.apply( OO, [ window ].concat( parts ) );
        if ( cls === undefined ) {
-               // The PHP output might be old and not including the "OO.ui" prefix
-               // TODO: Remove this back-compat after next major release
-               cls = OO.getProp.apply( OO, [ OO.ui ].concat( parts ) );
-               if ( cls === undefined ) {
-                       throw new Error( 'Unknown widget type: id: ' + id + ', class: ' + data._ );
-               }
+               throw new Error( 'Unknown widget type: id: ' + id + ', class: ' + data._ );
        }
 
        // Verify that we're creating an OO.ui.Element instance
@@ -796,7 +800,7 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
                if ( $elem[ 0 ] !== obj.$element[ 0 ] ) {
                        $elem.replaceWith( obj.$element );
                        // This element is now gone from the DOM, but if anyone is holding a reference to it,
-                       // let's allow them to OO.ui.infuse() it and do what they expect (T105828).
+                       // let's allow them to OO.ui.infuse() it and do what they expect, see T105828.
                        // Do not use jQuery.data(), as using it on detached nodes leaks memory in 1.x line by design.
                        $elem[ 0 ].oouiInfused = obj.$element;
                }
@@ -2679,8 +2683,8 @@ OO.ui.mixin.IconElement.prototype.setIcon = function ( icon ) {
  * @chainable
  */
 OO.ui.mixin.IconElement.prototype.setIconTitle = function ( iconTitle ) {
-       iconTitle = typeof iconTitle === 'function' ||
-               ( typeof iconTitle === 'string' && iconTitle.length ) ?
+       iconTitle =
+               ( typeof iconTitle === 'function' || ( typeof iconTitle === 'string' && iconTitle.length ) ) ?
                        OO.ui.resolveMsg( iconTitle ) : null;
 
        if ( this.iconTitle !== iconTitle ) {
@@ -2848,8 +2852,8 @@ OO.ui.mixin.IndicatorElement.prototype.setIndicator = function ( indicator ) {
  * @chainable
  */
 OO.ui.mixin.IndicatorElement.prototype.setIndicatorTitle = function ( indicatorTitle ) {
-       indicatorTitle = typeof indicatorTitle === 'function' ||
-               ( typeof indicatorTitle === 'string' && indicatorTitle.length ) ?
+       indicatorTitle =
+               ( typeof indicatorTitle === 'function' || ( typeof indicatorTitle === 'string' && indicatorTitle.length ) ) ?
                        OO.ui.resolveMsg( indicatorTitle ) : null;
 
        if ( this.indicatorTitle !== indicatorTitle ) {
@@ -2949,12 +2953,25 @@ OO.ui.mixin.LabelElement.static.label = null;
  *
  * @param {string} text Text
  * @param {string} query Query to find
+ * @param {Function} [compare] Optional string comparator, e.g. Intl.Collator().compare
  * @return {jQuery} Text with the first match of the query
  *  sub-string wrapped in highlighted span
  */
-OO.ui.mixin.LabelElement.static.highlightQuery = function ( text, query ) {
-       var $result = $( '<span>' ),
+OO.ui.mixin.LabelElement.static.highlightQuery = function ( text, query, compare ) {
+       var i, offset, tLen, qLen,
+               $result = $( '<span>' );
+
+       if ( compare ) {
+               tLen = text.length;
+               qLen = query.length;
+               for ( i = 0; offset === undefined && i <= tLen - qLen; i++ ) {
+                       if ( compare( query, text.slice( i, i + qLen ) ) === 0 ) {
+                               offset = i;
+                       }
+               }
+       } else {
                offset = text.toLowerCase().indexOf( query.toLowerCase() );
+       }
 
        if ( !query.length || offset === -1 ) {
                return $result.text( text );
@@ -3019,10 +3036,11 @@ OO.ui.mixin.LabelElement.prototype.setLabel = function ( label ) {
  *
  * @param {string} text Text label to set
  * @param {string} query Substring of text to highlight
+ * @param {Function} [compare] Optional string comparator, e.g. Intl.Collator().compare
  * @chainable
  */
-OO.ui.mixin.LabelElement.prototype.setHighlightedQuery = function ( text, query ) {
-       return this.setLabel( this.constructor.static.highlightQuery( text, query ) );
+OO.ui.mixin.LabelElement.prototype.setHighlightedQuery = function ( text, query, compare ) {
+       return this.setLabel( this.constructor.static.highlightQuery( text, query, compare ) );
 };
 
 /**
@@ -3072,25 +3090,21 @@ OO.ui.mixin.LabelElement.prototype.setLabelContent = function ( label ) {
  *
  * - **progressive**:  Progressive styling is applied to convey that the widget will move the user forward in a process.
  * - **destructive**: Destructive styling is applied to convey that the widget will remove something.
- * - **constructive**: Constructive styling is applied to convey that the widget will create something.
+ * - **constructive**: Constructive styling is deprecated since v0.23.2 and equivalent to progressive.
  *
  * The flags affect the appearance of the buttons:
  *
  *     @example
  *     // FlaggedElement is mixed into ButtonWidget to provide styling flags
  *     var button1 = new OO.ui.ButtonWidget( {
- *         label: 'Constructive',
- *         flags: 'constructive'
+ *         label: 'Progressive',
+ *         flags: 'progressive'
  *     } );
  *     var button2 = new OO.ui.ButtonWidget( {
  *         label: 'Destructive',
  *         flags: 'destructive'
  *     } );
- *     var button3 = new OO.ui.ButtonWidget( {
- *         label: 'Progressive',
- *         flags: 'progressive'
- *     } );
- *     $( 'body' ).append( button1.$element, button2.$element, button3.$element );
+ *     $( 'body' ).append( button1.$element, button2.$element );
  *
  * {@link OO.ui.ActionWidget ActionWidgets}, which are a special kind of button that execute an action, use these flags: **primary** and **safe**.
  * Please see the [OOjs UI documentation on MediaWiki] [1] for more information.
@@ -3102,7 +3116,7 @@ OO.ui.mixin.LabelElement.prototype.setLabelContent = function ( label ) {
  *
  * @constructor
  * @param {Object} [config] Configuration options
- * @cfg {string|string[]} [flags] The name or names of the flags (e.g., 'constructive' or 'primary') to apply.
+ * @cfg {string|string[]} [flags] The name or names of the flags (e.g., 'progressive' or 'primary') to apply.
  *  Please see the [OOjs UI documentation on MediaWiki] [2] for more information about available flags.
  *  [2]: https://www.mediawiki.org/wiki/OOjs_UI/Elements/Flagged
  * @cfg {jQuery} [$flagged] The flagged element. By default,
@@ -4834,7 +4848,7 @@ OO.ui.mixin.ClippableElement.prototype.clip = function () {
        clipHeight = allotedHeight < naturalHeight;
 
        if ( clipWidth ) {
-               // The order matters here. If overflow is not set first, Chrome displays bogus scrollbars. (T157672)
+               // The order matters here. If overflow is not set first, Chrome displays bogus scrollbars. See T157672.
                // Forcing a reflow is a smaller workaround than calling reconsiderScrollbars() for this case.
                this.$clippable.css( 'overflowX', 'scroll' );
                void this.$clippable[ 0 ].offsetHeight; // Force reflow
@@ -4850,7 +4864,7 @@ OO.ui.mixin.ClippableElement.prototype.clip = function () {
                } );
        }
        if ( clipHeight ) {
-               // The order matters here. If overflow is not set first, Chrome displays bogus scrollbars. (T157672)
+               // The order matters here. If overflow is not set first, Chrome displays bogus scrollbars. See T157672.
                // Forcing a reflow is a smaller workaround than calling reconsiderScrollbars() for this case.
                this.$clippable.css( 'overflowY', 'scroll' );
                void this.$clippable[ 0 ].offsetHeight; // Force reflow
@@ -6064,12 +6078,12 @@ OO.ui.SelectWidget.prototype.onFocus = function ( event ) {
                // This widget was focussed, e.g. by the user tabbing to it.
                // The styles for focus state depend on one of the items being selected.
                if ( !this.getSelectedItem() ) {
-                       item = this.getFirstSelectableItem();
+                       item = this.findFirstSelectableItem();
                }
        } else {
                // One of the options got focussed (and the event bubbled up here).
                // They can't be tabbed to, but they can be activated using accesskeys.
-               item = this.getTargetItem( event );
+               item = this.findTargetItem( event );
        }
 
        if ( item ) {
@@ -6096,7 +6110,7 @@ OO.ui.SelectWidget.prototype.onMouseDown = function ( e ) {
 
        if ( !this.isDisabled() && e.which === OO.ui.MouseButtons.LEFT ) {
                this.togglePressed( true );
-               item = this.getTargetItem( e );
+               item = this.findTargetItem( e );
                if ( item && item.isSelectable() ) {
                        this.pressItem( item );
                        this.selecting = item;
@@ -6118,7 +6132,7 @@ OO.ui.SelectWidget.prototype.onMouseUp = function ( e ) {
 
        this.togglePressed( false );
        if ( !this.selecting ) {
-               item = this.getTargetItem( e );
+               item = this.findTargetItem( e );
                if ( item && item.isSelectable() ) {
                        this.selecting = item;
                }
@@ -6145,7 +6159,7 @@ OO.ui.SelectWidget.prototype.onMouseMove = function ( e ) {
        var item;
 
        if ( !this.isDisabled() && this.pressed ) {
-               item = this.getTargetItem( e );
+               item = this.findTargetItem( e );
                if ( item && item !== this.selecting && item.isSelectable() ) {
                        this.pressItem( item );
                        this.selecting = item;
@@ -6165,7 +6179,7 @@ OO.ui.SelectWidget.prototype.onMouseOver = function ( e ) {
                return;
        }
        if ( !this.isDisabled() ) {
-               item = this.getTargetItem( e );
+               item = this.findTargetItem( e );
                this.highlightItem( item && item.isHighlightable() ? item : null );
        }
        return false;
@@ -6193,7 +6207,7 @@ OO.ui.SelectWidget.prototype.onMouseLeave = function () {
 OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) {
        var nextItem,
                handled = false,
-               currentItem = this.getHighlightedItem() || this.getSelectedItem();
+               currentItem = this.findHighlightedItem() || this.getSelectedItem();
 
        if ( !this.isDisabled() && this.isVisible() ) {
                switch ( e.keyCode ) {
@@ -6207,13 +6221,13 @@ OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) {
                        case OO.ui.Keys.UP:
                        case OO.ui.Keys.LEFT:
                                this.clearKeyPressBuffer();
-                               nextItem = this.getRelativeSelectableItem( currentItem, -1 );
+                               nextItem = this.findRelativeSelectableItem( currentItem, -1 );
                                handled = true;
                                break;
                        case OO.ui.Keys.DOWN:
                        case OO.ui.Keys.RIGHT:
                                this.clearKeyPressBuffer();
-                               nextItem = this.getRelativeSelectableItem( currentItem, 1 );
+                               nextItem = this.findRelativeSelectableItem( currentItem, 1 );
                                handled = true;
                                break;
                        case OO.ui.Keys.ESCAPE:
@@ -6319,13 +6333,13 @@ OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) {
        }
        this.keyPressBufferTimer = setTimeout( this.clearKeyPressBuffer.bind( this ), 1500 );
 
-       item = this.getHighlightedItem() || this.getSelectedItem();
+       item = this.findHighlightedItem() || this.getSelectedItem();
 
        if ( this.keyPressBuffer === c ) {
                // Common (if weird) special case: typing "xxxx" will cycle through all
                // the items beginning with "x".
                if ( item ) {
-                       item = this.getRelativeSelectableItem( item, 1 );
+                       item = this.findRelativeSelectableItem( item, 1 );
                }
        } else {
                this.keyPressBuffer += c;
@@ -6333,7 +6347,7 @@ OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) {
 
        filter = this.getItemMatcher( this.keyPressBuffer, false );
        if ( !item || !filter( item ) ) {
-               item = this.getRelativeSelectableItem( item, 1, filter );
+               item = this.findRelativeSelectableItem( item, 1, filter );
        }
        if ( item ) {
                if ( this.isVisible() && item.constructor.static.highlightable ) {
@@ -6363,7 +6377,7 @@ OO.ui.SelectWidget.prototype.getItemMatcher = function ( s, exact ) {
                s = s.normalize();
        }
        s = exact ? s.trim() : s.replace( /^\s+/, '' );
-       re = '^\\s*' + s.replace( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' ).replace( /\s+/g, '\\s+' );
+       re = '^\\s*' + s.replace( /([\\{}()|.?*+\-^$[\]])/g, '\\$1' ).replace( /\s+/g, '\\s+' );
        if ( exact ) {
                re += '\\s*$';
        }
@@ -6418,8 +6432,12 @@ OO.ui.SelectWidget.prototype.onToggle = function ( visible ) {
  * @param {jQuery.Event} e
  * @return {OO.ui.OptionWidget|null} Outline item widget, `null` if none was found
  */
-OO.ui.SelectWidget.prototype.getTargetItem = function ( e ) {
-       return $( e.target ).closest( '.oo-ui-optionWidget' ).data( 'oo-ui-optionWidget' ) || null;
+OO.ui.SelectWidget.prototype.findTargetItem = function ( e ) {
+       var $option = $( e.target ).closest( '.oo-ui-optionWidget' );
+       if ( !$option.closest( '.oo-ui-selectWidget' ).is( this.$element ) ) {
+               return null;
+       }
+       return $option.data( 'oo-ui-optionWidget' ) || null;
 };
 
 /**
@@ -6439,11 +6457,11 @@ OO.ui.SelectWidget.prototype.getSelectedItem = function () {
 };
 
 /**
- * Get highlighted item.
+ * Find highlighted item.
  *
  * @return {OO.ui.OptionWidget|null} Highlighted item, `null` if no item is highlighted
  */
-OO.ui.SelectWidget.prototype.getHighlightedItem = function () {
+OO.ui.SelectWidget.prototype.findHighlightedItem = function () {
        var i, len;
 
        for ( i = 0, len = this.items.length; i < len; i++ ) {
@@ -6454,6 +6472,17 @@ OO.ui.SelectWidget.prototype.getHighlightedItem = function () {
        return null;
 };
 
+/**
+ * Get highlighted item.
+ *
+ * @deprecated 0.23.1 Use {@link #findHighlightedItem} instead.
+ * @return {OO.ui.OptionWidget|null} Highlighted item, `null` if no item is highlighted
+ */
+OO.ui.SelectWidget.prototype.getHighlightedItem = function () {
+       OO.ui.warnDeprecation( 'SelectWidget#getHighlightedItem: Deprecated function. Use findHighlightedItem instead. See T76630.' );
+       return this.findHighlightedItem();
+};
+
 /**
  * Toggle pressed state.
  *
@@ -6664,7 +6693,7 @@ OO.ui.SelectWidget.prototype.chooseItem = function ( item ) {
 };
 
 /**
- * Get an option by its position relative to the specified item (or to the start of the option array,
+ * Find an option by its position relative to the specified item (or to the start of the option array,
  * if item is `null`). The direction in which to search through the option array is specified with a
  * number: -1 for reverse (the default) or 1 for forward. The method will return an option, or
  * `null` if there are no options in the array.
@@ -6675,7 +6704,7 @@ OO.ui.SelectWidget.prototype.chooseItem = function ( item ) {
  *  true. Function takes an OO.ui.OptionWidget and returns a boolean.
  * @return {OO.ui.OptionWidget|null} Item at position, `null` if there are no items in the select
  */
-OO.ui.SelectWidget.prototype.getRelativeSelectableItem = function ( item, direction, filter ) {
+OO.ui.SelectWidget.prototype.findRelativeSelectableItem = function ( item, direction, filter ) {
        var currentIndex, nextIndex, i,
                increase = direction > 0 ? 1 : -1,
                len = this.items.length;
@@ -6702,14 +6731,44 @@ OO.ui.SelectWidget.prototype.getRelativeSelectableItem = function ( item, direct
        return null;
 };
 
+/**
+ * Get an option by its position relative to the specified item (or to the start of the option array,
+ * if item is `null`). The direction in which to search through the option array is specified with a
+ * number: -1 for reverse (the default) or 1 for forward. The method will return an option, or
+ * `null` if there are no options in the array.
+ *
+ * @deprecated 0.23.1 Use {@link #findRelativeSelectableItem} instead
+ * @param {OO.ui.OptionWidget|null} item Item to describe the start position, or `null` to start at the beginning of the array.
+ * @param {number} direction Direction to move in: -1 to move backward, 1 to move forward
+ * @param {Function} [filter] Only consider items for which this function returns
+ *  true. Function takes an OO.ui.OptionWidget and returns a boolean.
+ * @return {OO.ui.OptionWidget|null} Item at position, `null` if there are no items in the select
+ */
+OO.ui.SelectWidget.prototype.getRelativeSelectableItem = function ( item, direction, filter ) {
+       OO.ui.warnDeprecation( 'SelectWidget#getRelativeSelectableItem: Deprecated function. Use findRelativeSelectableItem instead. See T76630.' );
+       return this.findRelativeSelectableItem( item, direction, filter );
+};
+
+/**
+ * Find the next selectable item or `null` if there are no selectable items.
+ * Disabled options and menu-section markers and breaks are not selectable.
+ *
+ * @return {OO.ui.OptionWidget|null} Item, `null` if there aren't any selectable items
+ */
+OO.ui.SelectWidget.prototype.findFirstSelectableItem = function () {
+       return this.findRelativeSelectableItem( null, 1 );
+};
+
 /**
  * Get the next selectable item or `null` if there are no selectable items.
  * Disabled options and menu-section markers and breaks are not selectable.
  *
+ * @deprecated 0.23.1 Use {@link OO.ui.SelectWidget#findFirstSelectableItem} instead.
  * @return {OO.ui.OptionWidget|null} Item, `null` if there aren't any selectable items
  */
 OO.ui.SelectWidget.prototype.getFirstSelectableItem = function () {
-       return this.getRelativeSelectableItem( null, 1 );
+       OO.ui.warnDeprecation( 'SelectWidget#getFirstSelectableItem: Deprecated function. Use findFirstSelectableItem instead. See T76630.' );
+       return this.findFirstSelectableItem();
 };
 
 /**
@@ -7054,9 +7113,9 @@ OO.ui.MenuSelectWidget.prototype.onDocumentMouseDown = function ( e ) {
        if (
                this.isVisible() &&
                !OO.ui.contains(
-                               this.$element.add( this.$widget ).add( this.$autoCloseIgnore ).get(),
-                               e.target,
-                               true
+                       this.$element.add( this.$widget ).add( this.$autoCloseIgnore ).get(),
+                       e.target,
+                       true
                )
        ) {
                this.toggle( false );
@@ -7067,7 +7126,7 @@ OO.ui.MenuSelectWidget.prototype.onDocumentMouseDown = function ( e ) {
  * @inheritdoc
  */
 OO.ui.MenuSelectWidget.prototype.onKeyDown = function ( e ) {
-       var currentItem = this.getHighlightedItem() || this.getSelectedItem();
+       var currentItem = this.findHighlightedItem() || this.getSelectedItem();
 
        if ( !this.isDisabled() && this.isVisible() ) {
                switch ( e.keyCode ) {
@@ -8147,51 +8206,6 @@ OO.ui.CheckboxMultiselectWidget.prototype.simulateLabelClick = function () {
        this.focus();
 };
 
-/**
- * FloatingMenuSelectWidget was a menu that would stick under a specified
- * container, even when it is inserted elsewhere in the document.
- * This functionality is now included in MenuSelectWidget, and FloatingMenuSelectWidget
- * is preserved for backwards-compatibility.
- *
- * @class
- * @extends OO.ui.MenuSelectWidget
- * @deprecated since v0.21.3, use MenuSelectWidget instead.
- *
- * @constructor
- * @param {OO.ui.Widget} [inputWidget] Widget to provide the menu for.
- *   Deprecated, omit this parameter and specify `$container` instead.
- * @param {Object} [config] Configuration options
- * @cfg {jQuery} [$container=inputWidget.$element] Element to render menu under
- */
-OO.ui.FloatingMenuSelectWidget = function OoUiFloatingMenuSelectWidget( inputWidget, config ) {
-       OO.ui.warnDeprecation( 'FloatingMenuSelectWidget is deprecated. Use the MenuSelectWidget instead.' );
-
-       // Allow 'inputWidget' parameter and config for backwards compatibility
-       if ( OO.isPlainObject( inputWidget ) && config === undefined ) {
-               config = inputWidget;
-               inputWidget = config.inputWidget;
-       }
-
-       // Configuration initialization
-       config = config || {};
-
-       // Properties
-       this.inputWidget = inputWidget; // For backwards compatibility
-       this.$container = config.$floatableContainer || config.$container || this.inputWidget.$element;
-
-       // Parent constructor
-       OO.ui.FloatingMenuSelectWidget.parent.call( this, $.extend( {}, config, { $floatableContainer: this.$container } ) );
-
-       // Initialization
-       this.$element.addClass( 'oo-ui-floatingMenuSelectWidget' );
-       // For backwards compatibility
-       this.$element.addClass( 'oo-ui-textInputMenuSelectWidget' );
-};
-
-/* Setup */
-
-OO.inheritClass( OO.ui.FloatingMenuSelectWidget, OO.ui.MenuSelectWidget );
-
 /**
  * Progress bars visually display the status of an operation, such as a download,
  * and can be either determinate or indeterminate:
@@ -8372,7 +8386,7 @@ OO.mixinClass( OO.ui.InputWidget, OO.ui.mixin.AccessKeyedElement );
  */
 OO.ui.InputWidget.static.reusePreInfuseDOM = function ( node, config ) {
        config = OO.ui.InputWidget.parent.static.reusePreInfuseDOM( node, config );
-       // Reusing $input lets browsers preserve inputted values across page reloads (T114134)
+       // Reusing `$input` lets browsers preserve inputted values across page reloads, see T114134.
        config.$input = $( node ).find( '.oo-ui-inputWidget-input' );
        return config;
 };
@@ -8967,7 +8981,7 @@ OO.ui.DropdownInputWidget.prototype.setValue = function ( value ) {
        value = this.cleanUpValue( value );
        // Only allow setting values that are actually present in the dropdown
        selected = this.dropdownWidget.getMenu().getItemFromData( value ) ||
-               this.dropdownWidget.getMenu().getFirstSelectableItem();
+               this.dropdownWidget.getMenu().findFirstSelectableItem();
        this.dropdownWidget.getMenu().selectItem( selected );
        value = selected ? selected.getData() : '';
        OO.ui.DropdownInputWidget.parent.prototype.setValue.call( this, value );
@@ -9588,7 +9602,7 @@ OO.ui.TextInputWidget = function OoUiTextInputWidget( config ) {
        }, config );
 
        if ( config.multiline ) {
-               OO.ui.warnDeprecation( 'TextInputWidget: config.multiline is deprecated. Use the MultilineTextInputWidget instead. See T130434 for details.' );
+               OO.ui.warnDeprecation( 'TextInputWidget: config.multiline is deprecated. Use the MultilineTextInputWidget instead. See T130434.' );
                return new OO.ui.MultilineTextInputWidget( config );
        }
 
@@ -10712,7 +10726,7 @@ OO.ui.ComboBoxInputWidget.prototype.onInputChange = function ( value ) {
        var match = this.menu.getItemFromData( value );
 
        this.menu.selectItem( match );
-       if ( this.menu.getHighlightedItem() ) {
+       if ( this.menu.findHighlightedItem() ) {
                this.menu.highlightItem( match );
        }
 
@@ -10760,7 +10774,7 @@ OO.ui.ComboBoxInputWidget.prototype.onMenuChoose = function ( item ) {
 OO.ui.ComboBoxInputWidget.prototype.onMenuItemsChange = function () {
        var match = this.menu.getItemFromData( this.getValue() );
        this.menu.selectItem( match );
-       if ( this.menu.getHighlightedItem() ) {
+       if ( this.menu.findHighlightedItem() ) {
                this.menu.highlightItem( match );
        }
        this.$element.toggleClass( 'oo-ui-comboBoxInputWidget-empty', this.menu.isEmpty() );