[whatwg] <main> UA style sheet

Simon Pieters simonp at opera.com
Wed Nov 7 05:59:08 PST 2012


Hi

https://dvcs.w3.org/hg/html-extensions/raw-file/tip/maincontent/index.html  
says

[[
The User Agent style sheet should include the following style rule for the  
main element:
   main {
    display:block;
    }
]]

I think this is a bit inconsistent with the HTML spec.

First, it should be clear that this should hook in to the HTML spec's  
Rendering section, because this section has special rules when it comes to  
conformance classes and the use of words with requirements, as explained  
at the start of the section.

http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#rendering

This section also has this requirement:

[[
The CSS rules given in these subsections are, except where otherwise  
specified, expected to be used as part of the user-agent level style sheet  
defaults for all documents that contain HTML elements.
]]

I propose the following concrete text:

[[
=== Rendering ===

This section is to be treated as a subsection of HTML's Rendering section  
for the purpose of terminology, conformance classes and requirements.  
[HTML]

CSS:
... the style sheet ...
]]

Finally, I think the style sheet needs some tweaks. If we want <main> to  
have the same styles as <aside> (except for the effect <aside> has on  
<h1>, since <main> is not a sectioning element), I think the style sheet  
should be:

@namespace url(http://www.w3.org/1999/xhtml);
main { unicode-bidi: isolate; display: block; }

Replace this rule in the HTML spec:

:matches([dir=ltr i], [dir=rtl i], [dir=auto  
i]):not(address):not(blockquote
):not(center):not(div):not(figure):not(figcaption):not(footer):not(form
):not(header):not(hr):not(legend):not(listing):not(p):not(plaintext):not(pre
):not(summary):not(xmp):not(article):not(aside):not(h1):not(h2):not(h3):not(h4
):not(h5):not(h6):not(hgroup):not(nav):not(section):not(table):not(caption
):not(colgroup):not(col):not(thead):not(tbody):not(tfoot):not(tr):not(td
):not(th):not(dir):not(dd):not(dl):not(dt):not(menu):not(ol):not(ul):not(li)  
{
   unicode-bidi: embed;
}

with:

:matches([dir=ltr i], [dir=rtl i], [dir=auto  
i]):not(address):not(blockquote
):not(center):not(div):not(figure):not(figcaption):not(footer):not(form
):not(header):not(hr):not(legend):not(listing):not(p):not(plaintext):not(pre
):not(summary):not(xmp):not(article):not(aside):not(main):not(h1):not(h2):not(h3):not(h4
):not(h5):not(h6):not(hgroup):not(nav):not(section):not(table):not(caption
):not(colgroup):not(col):not(thead):not(tbody):not(tfoot):not(tr):not(td
):not(th):not(dir):not(dd):not(dl):not(dt):not(menu):not(ol):not(ul):not(li)  
{
   unicode-bidi: embed;
}

-- 
Simon Pieters
Opera Software


More information about the whatwg mailing list