Bug Tracker

Opened 8 years ago

Closed 7 years ago

#2090 closed bug (fixed)

.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:
Blocked by: Blocking:


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 (1)

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

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by nostrademons

.css test case

comment:1 Changed 7 years ago by dmethvin

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

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

Note: See TracTickets for help on using tickets.