Bug Tracker

Ticket #1303 (closed bug: wontfix)

Opened 7 years ago

Last modified 7 years ago

$("#content").attr("clientHeight") doesn't work in Firefox

Reported by: Mario Owned by:
Priority: trivial Milestone: 1.2.2
Component: core Version: 1.1.2
Keywords: Cc:
Blocking: Blocked by:

Description

I have a div with id 'content'..

Calling $("#content").attr("clientHeight") returns undefined in Firefox, but works in IE6.

I tried $("#content").get()[0]clientHeight? and that worked in Firefox as well, and adding clientHeight to

var fix = jQuery.isXMLDoc(elem) ? {} : {

"for": "htmlFor", "class": "className", "float": jQuery.browser.msie ? "styleFloat" : "cssFloat", cssFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat", innerHTML: "innerHTML", className: "className", value: "value", disabled: "disabled", checked: "checked", readonly: "readOnly", selected: "selected", clientHeight: "clientHeight"

};

fixed the problem.

Change History

comment:1 Changed 7 years ago by brandon

  • Owner paul deleted
  • Priority changed from minor to trivial
  • Component changed from dimensions to core

comment:2 Changed 7 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone changed from 1.1.3 to 1.2.2

clientHeight and clientWidth are undependable. The bug reporter said it worked in IE but not in FF. It also doesn't work in Opera or Safari. Adding "clientHeight" and "clientWidth" to the list as the reporter suggests does make it work in FF, Opera, and Safari.

But under certain conditions (like the elem is display:none or in IE when there is no CSS layout for the element), they will still return undefined in browser dependent ways. Since the reporting of this bug, width() and height() have been added to the core and those functions already try to deal with clientHeight and clientWidth oddities.

For those reasons I'm going to close this bug as wontfix. If someone feels they have a compelling reason I'm overlooking please reopen it and let us know.

Note: See TracTickets for help on using tickets.