Bug Tracker

Modify

Ticket #2273 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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

comment:1 Changed 5 years ago by brandon

  • need changed from Review to Test Case
  • Owner set to brandon

comment:2 Changed 4 years ago by brandon

  • Component changed from core to dimensions

comment:3 Changed 4 years ago by brandon

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from 1.2.3 to 1.3.3

fixed in r6313

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.