Opened 10 years ago

Closed 10 years ago

#8430 closed defect (fixed)

dojox.gfx._removeClass fails if there are no classes yet

Reported by: Christian Schröder Owned by: Eugene Lazutkin
Priority: high Milestone: 1.3
Component: DojoX GFX Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

if a node does not have any class the _removeClass method will fail, because it will dereference on null.

i attched a patch checking for null first and returning immediately if the className attribute is null.

Attachments (1)

dojo-patch.txt (1.3 KB) - added by Christian Schröder 10 years ago.
fix for _removeClass, _addClass and _hasClass in dojox.gfx

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by Christian Schröder

dojo.gfx._addClass also has a null issue i updated the patch

comment:2 Changed 10 years ago by Christian Schröder

_hasNode also hs null issue, if the class esked for is named null.

updated patch

also the attribute name is possibly wrong. in FF3 on Ubuntu 8.10 it only works if i set the attribute named "class" not "className" this hs to be digged in further. i won't include this into the patch.

Changed 10 years ago by Christian Schröder

Attachment: dojo-patch.txt added

fix for _removeClass, _addClass and _hasClass in dojox.gfx

comment:3 Changed 10 years ago by Eugene Lazutkin

Component: GeneralDojoX GFX
Milestone: tbdfuture
Owner: changed from anonymous to Eugene Lazutkin
Status: newassigned

comment:4 Changed 10 years ago by Christian Schröder

ok, according to http://www.w3.org/TR/SVG/styling.html#ClassAttribute the attribute really should be named "class"

comment:5 Changed 10 years ago by Eugene Lazutkin

Milestone: future1.3

I updated these functions.

Interesting that they are not used on dojox.gfx. How do you use them and why?

comment:6 Changed 10 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [16632]) Fixing possible empty CSS class string, !strict, fixes #8430.

Note: See TracTickets for help on using tickets.