Skip to main content

Bug Tracker

Side navigation

#2858 closed enhancement (invalid)

Opened May 14, 2008 03:33AM UTC

Closed May 14, 2008 05:39PM UTC

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:
Description

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?

Attachments (0)
Change History (2)

Changed May 14, 2008 05:13PM UTC by flesler comment:1

component: coredimensions
owner: → brandon

Changed May 14, 2008 05:39PM UTC by brandon comment:2

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.