if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
- var left,
+ var left, rsLeft,
ret = elem.currentStyle && elem.currentStyle[ name ],
- rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style;
if ( ret === null && style ) {
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+
// Remember the original values
left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
$divNormal.remove();
});
+test("getting dimensions shouldnt modify runtimeStyle see #9233", function() {
+ expect( 1 );
+
+ var $div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ),
+ div = $div.get( 0 ),
+ runtimeStyle = div.runtimeStyle;
+
+ if ( runtimeStyle ) {
+ div.runtimeStyle.marginLeft = "12em";
+ div.runtimeStyle.left = "11em";
+ }
+
+ $div.outerWidth( true );
+
+ if ( runtimeStyle ) {
+ equal( div.runtimeStyle.left, "11em", "getting dimensions modifies runtimeStyle, see #9233" );
+ } else {
+ ok( true, "this browser doesnt support runtimeStyle, see #9233" );
+ }
+
+ $div.remove();
+});
+
test("outerHeight()", function() {
expect(11);