From 050e71bdd88708ce6e8462a89af4399cffa72cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 4 Dec 2012 09:21:33 -0500 Subject: [PATCH] Revert "Dialog: Cleanup style properties on _destroy. Reenables style check in domEqual, while removing commented and unnecessary old code. Fixes #8119 - Dialog: Destroying a dialog leaves style, scrollleft, and scrolltop leftovers." This reverts commit d687a1b10d1e176a6a8dd4420f1ea3a890640da0. --- tests/unit/dialog/dialog_methods.js | 2 -- tests/unit/testsuite.js | 32 +++++++++++++++++++++++++++-- ui/jquery.ui.dialog.js | 5 ----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 3753144f3..e5275c7a4 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -35,8 +35,6 @@ test("init", function() { test("destroy", function() { expect( 6 ); - // expect dialogs to be hidden before and after - $( "#dialog1, #form-dialog" ).hide(); domEqual( "#dialog1", function() { var dialog = $( "#dialog1" ).dialog().dialog( "destroy" ); equal( dialog.parent()[ 0 ], $( "#qunit-fixture" )[ 0 ] ); diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 808e6c6ea..18337fe4e 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -210,10 +210,36 @@ window.domEqual = function( selector, modifier, message ) { "nodeName", "role", "tabIndex", - "title", - "style" + "title" ]; +/* + function getElementStyles( elem ) { + var key, len, + style = elem.ownerDocument.defaultView ? + elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : + elem.currentStyle, + styles = {}; + if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { + len = style.length; + while ( len-- ) { + key = style[ len ]; + if ( typeof style[ key ] === "string" ) { + styles[ $.camelCase( key ) ] = style[ key ]; + } + } + // support: Opera, IE <9 + } else { + for ( key in style ) { + if ( typeof style[ key ] === "string" ) { + styles[ key ] = style[ key ]; + } + } + } + + return styles; + } +*/ function extract( elem ) { if ( !elem || !elem.length ) { QUnit.push( false, actual, expected, @@ -231,6 +257,8 @@ window.domEqual = function( selector, modifier, message ) { var value = elem.attr( attr ); result[ attrĀ ] = value !== undefined ? value : ""; }); + // TODO: Enable when we can figure out what's happening with accordion + //result.style = getElementStyles( elem[ 0 ] ); result.events = $._data( elem[ 0 ], "events" ); result.data = $.extend( {}, elem.data() ); delete result.data[ $.expando ]; diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 472d686a2..361beeb4c 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -127,11 +127,6 @@ $.widget("ui.dialog", { this.element .removeUniqueId() .removeClass( "ui-dialog-content ui-widget-content" ) - .css({ - "width": "", - "min-height": "", - "height": "" - }) .hide() // without detaching first, the following becomes really slow .detach();