W3C home > Mailing lists > Public > www-style@w3.org > November 2016

Re: [CSS22] [Section 6.4.2 !important rules] How an user style sheet rule can override an author inline style with !important

From: Xidorn Quan <me@upsuper.org>
Date: Tue, 15 Nov 2016 15:25:47 +1100
Message-Id: <1479183947.1606738.787973401.27948483@webmail.messagingengine.com>
To: www-style@w3.org
On Tue, Nov 15, 2016, at 02:20 PM, GĂ©rard Talbot wrote:
> but again, my understanding is specificity should not matter since user 
> style sheet for that h1 element has !important. What am I missing here?
> For convenience, people can use one of these extensions for that test:
> The "Text sample 2" is red in Firefox 49.0.2, Firefox 53.0a1, Chrome 
> 54.0.2840.100 when I use one of those extensions.

Your understanding is correct that important rules in user style sheet
should override important rules in author style sheet no matter what
specificity they have.

I tested in Firefox, and it seems if the style is put in userContent.css
[1], the testcase works as expected. (userContent.css currently doesn't
work with multi-process Firefox, though, which is a known bug [2] we are
working on.)

The issue here is that, those extensions are not really using user style
sheet. I believe they are implemented by inserting the rules into the
page somehow, so they are actually author style sheet from perspective
of browsers' style system. This is not necessarily something we should
blame the extensions, though, because it could be due to lack of
extension API support from browsers.

[1] http://kb.mozillazine.org/UserContent.css
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1046166

- Xidorn
Received on Tuesday, 15 November 2016 04:26:15 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:15:01 UTC