Follow-up 3ddb3603: unbreak nesting of autosizing or labeled TextInputWidgets
Follow-up 3ddb3603: unbreak nesting of autosizing or labeled TextInputWidgets

The following code:

var t = new OO.ui.TextInputWidget( { autosize: true } ),
	$wrapper = $( '<div>' ).addClass( 'wrapper' );
$wrapper.append( t.$element );
setTimeout( function() {
	$( 'body' ).append( $wrapper );
}, 1000 );

would result in an empty <div class="wrapper"> being appended
to the body, with no TextInputWidget. Autosizing or labeled
TextInputWidgets only worked when either directly or synchronously
attached to the DOM. Nesting them inside of other widgets broke
if there was a delay between the TextInputWidget being appended
to its container and the container then being attached to the DOM.

Fixed by making the evil MutationObserver code in
installParentChangeDetector() wrap the correct node (the topmost node,
not necessarily the widget node itself) in an observed div.

Change-Id: I651e71d4f21edfec6e0bcedb7e1934441ce56947

wikimedia/oojs-ui,wikimedia/oojs-ui,wikimedia/oojs-ui,wikimedia/oojs-ui