W3C home > Mailing lists > Public > www-style@w3.org > May 2011

[css3-regions] Feedback on regions document

From: David Hyatt <hyatt@apple.com>
Date: Wed, 11 May 2011 11:13:43 -0500
Message-id: <085B50AF-6504-43E0-BBA8-0A2CA142680E@apple.com>
To: "www-style@w3.org CSS" <www-style@w3.org>
Overall I like the direction of this document.  I have two major issues with it.

(1) The @region-style feature is going to be an implementation nightmare, and I'm not convinced that it is necessary.  I think the objects that you'd style differently would typically be known to fit fully in the first region anyway.

If this feature absolutely must exist, then let's at least limit it to lines.  Browsers have already largely dealt with the consequences of having lines with different styles.

So instead of

@region-style <region1_sel> {
    #article {
        font-weight: bold;
        color: #0C3D5F;
        font-size: larger;

I would suggest writing it like:

    font-weight: bold;
    color: #0C3D5F;
    font-size: larger;

This still allows you some nice styling flexibility, and it's forward-compatible in the sense that we can tie it to first-line and just say it works the same way.  It's significantly easier to implement, especially in engines like WebKit that don't waste memory representing split blocks with multiple boxes.

(2) My second major issue with the document is that I don't believe we should ever allow regions to be explicit DOM elements.  I think regions should always be created anonymously.  The examples for positioned elements and flexible boxes are just clumsy.

<div id="article">...</div>
        <div id="region_A"></div>
        <div id="region_1"></div>
        <div id="region_2"></div>
        <div id="region_3"></div>
        <div id="region_4"></div>

In this example you define both your real content in the article div, but then you make a bunch of sibling positioned divs that are purely presentational.  What you really want (and I mentioned this in a previous email to the list) is the ability to create anonymous positioned regions.  I think a new property is perfect for this.

#article {
   flow: article_flow;
   positioned-regions: region_A, region_B, region_3, region_4;

You wouldn't need to explicitly specify content: from(article_flow), since the regions are obviously created to hold article_flow content.

Then each region could be individually referenced using its name with a region pseudo-element (I'm assuming region is replacing the term slot).

#article::region(region_A) { ... }

I would just cut the flexible box example.  I don't think we *have* to make regions compatible with every last layout system we devise, especially if that means forcing authors to throw in presentational divs just to represent the regions.  If regions can work anonymously with grids, multi-column and positioned elements, that gives authors more than enough options.

Received on Wednesday, 11 May 2011 16:14:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:45 UTC