Opened 12 years ago

Closed 11 years ago

#6059 closed defect (invalid)

dojox.fx.addClass will not override classes set in an object's ID style

Reported by: guest Owned by: dante
Priority: high Milestone: future
Component: Dojox Version: 1.1b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Bryan Forbes)

for instance with this:

#piggie {

position: relative; border: 1px solid black; left: 50px; width: 200px;

} .tst {

height: 200px; background: #fff;

} .testTargetClass {

width: 400px; height: 400px; background: #ff0000;

}

calling

dojox.fx.addClass({ node: 'piggie', cssClass: 'testTargetClass' }).play();

affects ONLY the height. Moving the initial width declaration to the .tst class block causes it to affect both.

if this is as intended, could we get an override argument?

Attachments (1)

css.html (735 bytes) - added by dante 11 years ago.
test case showing ids to be more specific, and workaround

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by dylan

Milestone: 1.1
Owner: changed from anonymous to Bryan Forbes

comment:2 Changed 12 years ago by dylan

Milestone: 1.11.2

comment:3 Changed 11 years ago by Bryan Forbes

Component: GeneralDojox
Description: modified (diff)
Owner: changed from Bryan Forbes to dante

comment:4 Changed 11 years ago by dante

Milestone: 1.2future

what does adding !important to the .testTargetClass rule do? It seems to me this is the natural behavior of CSS, as id's are more specific than class names (iirc)

Changed 11 years ago by dante

Attachment: css.html added

test case showing ids to be more specific, and workaround

comment:5 Changed 11 years ago by dante

Resolution: invalid
Status: newclosed

If we had a 'cantfix' message, I would use that. The !important allows the rules to be applied to the ID's, but id selectors are more specific. the #id.class combination rules also work. CSS quirk, and this is a case we can't work around methinks (not without removing the id but that sounds really bad).

Note: See TracTickets for help on using tickets.