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

Re: [css-syntax]The emperor isn't naked, but he's wearing his underpants on his head

From: Gérard Talbot <www-style@gtalbot.org>
Date: Sat, 05 Nov 2016 21:23:11 -0400
To: Felix Miata <mrmazda@earthlink.net>
Cc: W3C www-style mailing list <www-style@w3.org>
Message-ID: <5d756534e077ed2ac29b3a6085417d40@gtalbot.org>
Le 2016-11-05 20:01, Gérard Talbot a écrit :
> Le 2016-11-05 19:03, Felix Miata a écrit :
>> Gérard Talbot composed on 2016-11-05 17:47 (UTC-0400):
>> 
>>> An inline style is (should be!) for an unique element.
>>> Therefore, an inline style should be more specific than a class.
>> 
>> That only works if the only styles are author, or if users aren't
>> supposed to have ultimate control.
> 
> Yes. If media (origin) is the same and if importance (user, author,
> user agent with !important or not) is the same, then inline style is
> more specific than a class attribute.
> 
> https://www.w3.org/TR/CSS21/cascade.html#cascading-order
> 
>> AFAICT, inline styles are
>> hopelessly immune to user overrides,
> 
> Hm... no. An author inline style can be (will be and should be)
> overriden by an user !important class attribute. Untangling
> specificity only comes after untangling importance. And I believe the
> CSS 2.1 test suite has not tested this... can not find it in
> 
> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/chapter-6.htm#s6.4
> 
> [
> I think we need to test this... Something like:
> 
>  <body>
>         <p id="cascade">PREREQUISITE: The <a
> href="support/cascade.css">"cascade.css"</a> file is enabled as the
> user agent's user style sheet.</p>
>         <p>Test passes if "Text sample" is green.</p>
>         <h1 class="cascadegreenimportant" style="color: red;">Text 
> sample</h1>
>  </body>
> 
> where the user style sheet is:
> 
> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/support/cascade.css
> 
> ]

Felix,

I just tested this with Stylish 2.0.7 for Firefox

https://addons.mozilla.org/en-US/firefox/addon/stylish/

and with

userScriptCSS 1.4 for Chrome

https://chrome.google.com/webstore/detail/userscriptcss/pdfbjinabdohnegjnbfgdgohlhegamnm

on this test:

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/cascade-013.xht

and it works. Firefox 49.0.2 and Chrome 54.0.2840.90 pass this test.

Gérard
Received on Sunday, 6 November 2016 01:23:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:05 UTC