Bug Tracker

Opened 15 years ago

Closed 15 years ago

#2858 closed enhancement (invalid)

Redundant discriminant on window size?

Reported by: ericsk Owned by: brandon
Priority: minor Milestone: 1.2.4
Component: dimensions Version: 1.2.3
Keywords: window size Cc:
Blocked by: Blocking:


In the bottom of core.js, the following code segment is to determine which method reports the correct window size:

this[0] == window ?
      // Opera reports document.body.client[Width/Height] properly in both quirks and standards
      jQuery.browser.opera && document.body[ "client" + name ] ||

      // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
      jQuery.browser.safari && window[ "inner" + name ] ||

      // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
      document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :

However, I think the code

jQuery.browser.opera && document.body[ "client" + name ] ||

is redundant because this discriminant has finally tries document.body['client'+name] yet.

How do you think?

Change History (2)

comment:1 Changed 15 years ago by flesler

Component: coredimensions
Owner: set to brandon

comment:2 Changed 15 years ago by brandon

Resolution: invalid
Status: newclosed

The comment above the line in question states that opera needs to use document.body for both standards and quirks modes.

Note: See TracTickets for help on using tickets.