Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Merge fix for bug #6088 #2

Closed
wants to merge 1 commit into from

2 participants

@Oblomov

Hello, on March this year I wrote and submitted a patch to fix bug 6088. Could you please consider this fix for review & merge?

@Oblomov Oblomov Fix 'walks like a window, quacks like a window' test
In some browsers (at least Opera and IE) the inclusion of the prototype
library can cause the tested window properties to become available in
other HTML elements.

An effect of this is that the change introduced in [6313] causes the
width to be reported incorrectly on these elements (the document width
is used instead of the actual element width).

This is solved by checking for parentNode, which is null or undefined
on window and document objects but not on HTML elements.

Fixes #6088
7ac80fa
@jeresig

Landed an alternative fix here: c8dd49f

@asher00 asher00 referenced this pull request from a commit in asher00/jquery
@asher00 asher00 test 브랜치에서 수정#2 6071db0
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 5, 2010
  1. @Oblomov

    Fix 'walks like a window, quacks like a window' test

    Oblomov authored
    In some browsers (at least Opera and IE) the inclusion of the prototype
    library can cause the tested window properties to become available in
    other HTML elements.
    
    An effect of this is that the change introduced in [6313] causes the
    width to be reported incorrectly on these elements (the document width
    is used instead of the actual element width).
    
    This is solved by checking for parentNode, which is null or undefined
    on window and document objects but not on HTML elements.
    
    Fixes #6088
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/dimensions.js
View
2  src/dimensions.js
@@ -31,7 +31,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
});
}
- return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ return ("scrollTo" in elem && elem.document && !elem.parentNode) ? // does it walk and quack like a window?
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ] :
Something went wrong with that request. Please try again.