Bug Tracker

Ticket #2090 (closed bug: fixed)

Opened 7 years ago

Last modified 6 years ago

.css() causes error when called on an element not in the DOM on Safari

Reported by: nostrademons Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

In the attached test case, Firefox gives none/none/changed/changed and IE gives none/none/auto/auto, indicating that they at least returned undefined or a default value, respectively. Safari, however, gives none/none/changed/changeme and displays "Undefined value" and "Null value" in the error console, preventing further JavaScript execution.

An undefined return value is fine, but it probably shouldn't throw an exception. A common idiom in the UI classes is 'parseInt($(el).css(prop))
0', assigning a default value if the property doesn't exist. This behavior causes the whole widget to break instead of functioning with the defaults (I first noticed it with UI Slider).

Attachments

css.html Download (786 bytes) - added by nostrademons 7 years ago.
.css test case

Change History

Changed 7 years ago by nostrademons

.css test case

comment:1 Changed 6 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to fixed

This appears to work as desired in 1.2.6 for the test case.

Note: See TracTickets for help on using tickets.