Ticket #2273 (closed bug: fixed)
Other windows and documents
| Reported by: | flesler | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | dimensions | Version: | 1.2.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When the functions height and width are generated, since line 1325, source release. this[0] is compared against 'window' and 'document', that detection leaves out any other window and document that might be evaluated. These might come from an iframe, a popup, etc. My suggestion is to use object detection instead. It'll certainly look less clear, but will cover these cases.
I came up with an option for detection which is: windows: if( elem.scrollBy ).... documents: if( elem.nodeName == '#document' )......
Of course this also requires that if a window is detected, elem.document is used and not that document. If a document is detected, elem.body and elem.documentElement are used instead.
This checks are just an example, maybe someone can come up with more reliable ones.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
