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: Mon, 14 Nov 2016 20:41:41 -0500
To: Felix Miata <mrmazda@earthlink.net>
Cc: W3C www-style mailing list <www-style@w3.org>
Message-ID: <c1d4e95d0596644ac82f54afeb91ca11@gtalbot.org>
Le 2016-11-14 20:26, Gérard Talbot a écrit :
> Le 2016-11-14 19:05, Felix Miata a écrit :
>> [resend with typos corrected]
>> 
>> Gérard Talbot composed on 2016-11-05 21:23 (UTC-0400):
>> 
>>> Gérard Talbot composed:
>> 
>>>> Felix Miata composed:
>> ...
>>>>> 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.
>> 
>> That's too easy. Try overcoming all too common real world markup like
>> the red H1 following:
>> 
>>    <body>
>>           <p>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 style="color: red;">Text sample</h1>
>>    </body>
>> 
>> with
>> #user-stylesheet-indication
>> {
>>      /* Used by the harness to display and indication there is a
>> user-stylesheet applied */
>>      display: block!important;
>> }
>> #cascade
>> {
>>      /* Used by the test to hide the prerequsite */
>>      display: none;
>> }
>> .cascadered
>> {
>>      color: red;
>> }
>> .cascadegreen
>> {
>>      color: green;
>> }
>> body h1
>> {
>>      color: green!important;
>> }
>> 
>> H1 is red in Firefox 49.0.2 here.
> 
> 
> I created this test
> 
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/cascade-felix-013.xht
> 
> based on your code (I removed .cascadered and .cascadegreen rules
> since they are not involved) and the H1 element is green in Firefox
> 49.0.2 (using Stylish 2.0.7). It is also green with Chrome
> 54.0.2840.100 .

I added another <h1> element but this time with !important in the inline 
style:

line 27: <h1 style="color: red!important;">Text sample 2</h1>

and now H1 is red in both Firefox and Chrome. So, it seems you found 
something here... right now, I can not explain the red result for Text 
sample 2 .

Gérard


> 
> Your "body h1" rule, if the cascade-felix.css code is enabled for all
> URLs, will make h1 elements green everywhere, in all webpages you
> visit, unless you create an user style sheet for only, solely and
> exclusively for the
> www.gtalbot.org/BrowserBugsSection/css21testsuite/cascade-felix-013.xht
> URL, in which case for such URL, the H1 element is green in both
> Firefox 49.0.2 and Chrome 54.0.2840.100 .
> 
> Gérard
Received on Tuesday, 15 November 2016 01:42:17 UTC

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