[Webkit-unassigned] [Bug 9355] !important bug

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Thu Jul 6 16:03:00 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9355





------- Comment #4 from opendarwin.org at bdash.net.nz  2006-07-06 16:02 PDT -------
Created an attachment (id=9240)
 --> (http://bugzilla.opendarwin.org/attachment.cgi?id=9240&action=view)
Reduction

I belive that this reduction demonstrates what you are referring to.  Applying
your example to this reduction, you are asking why

    #middle div.inner {
            background-color: red !important;
            background-color: red;
    }

is different to:

    #middle div.inner {
            background-color: red;
    }

The answer is quite simply that !important is taken into consideration in the
CSS sort order before the specificity of the selector.  While #middle div.inner
is more specific than #outer div, the !important rule wins before specificity
is even checked.  This matches my reading of
http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order, and is consistent
with the behaviour of Firefox, at least on Mac OS X.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list