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

Re: [css21] undo style declarations / cascading

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 8 Nov 2012 19:55:44 -0800
Message-ID: <CALRQH78NZYQN50JxZ6Yb35SYZRMcYB_dYYLtbS3WJqLyRdpOig@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
On Thu, Nov 8, 2012 at 9:46 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Wed, Nov 7, 2012 at 9:15 PM, Andrew Fedoniouk
> <news@terrainformatica.com> wrote:
>> Consider this markup
>> <body id=main>
>>     ...
>>     <div id=editor contenteditable>
>>         <table width=700 >...</table>
>>     </div>
>> </body>
>> And in styles declared somewhere for the page there is such rule:
>> #main table { width:100%; }
>> that obviously applies to the #editor>table element and
>> that ruins the design of content inside #editor.
>> So there is a need for something like
>> #editor>table { width: <use-default-handling>; }
>> But I simply don't know what to put there. width:auto has different meaning
>> for the table and other elements like img, textarea, etc.
>> Disclaimer: I do know that @width and the like are deprecated but that
>> is about editing real documents from the web wilderness.
>> It should be something to achieve this, no?
> fantasai and I just started our fixup of the Cascade module on
> Tuesday, and added in the 'default' css-wide keyword, based on
> discussions like this over the years:
> <http://dev.w3.org/csswg/css3-cascade/#default-keyword>.
> However, due to the design of presentational hints like the 'width'
> attribute, this still won't *quite* do what you want - if you use
> 'default' in an author-level stylesheet, it'll strip away all the
> author-level rules, which includes presentational attributes.
> fantasai and I debated whether presentational hints should stay where
> they currently are (at the very bottom of the author level) or should
> move to a separate cascade level immediately below author.  The
> difference isn't detectable currently, but will be after browsers
> implement 'default'.
> Currently we're sticking with the existing definition, but we could be
> convinced to do the separate cascade level.

I am not sure I understand why your mechanism need to affect

As for me all this is quite trivial...

Let's assume that 'default' has the same principle of applicability as e.g.
'thin' value in lengths.

If so I do not see any problems with this:

#content table { width:100%; }
#editor table { width: default; height:default; border: default; }
@media handheld { #editor table { width: 100px; } }

On non-handhelds the table will use width defined by @width but
on handhelds it will always be 100px;

Did I miss something in principle?

Andrew Fedoniouk.

Received on Friday, 9 November 2012 03:56:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:23 UTC