- From: Vincent Hardy <vhardy@adobe.com>
- Date: Fri, 13 May 2011 19:20:18 -0700
- To: David Hyatt <hyatt@apple.com>
- CC: "www-style@w3.org CSS" <www-style@w3.org>
On May 13, 2011, at 3:01 PM, David Hyatt wrote:
> On May 13, 2011, at 4:08 PM, Vincent Hardy wrote:
>
>> No, my concern is to separate out issues: one is to scope selectors that only apply to elements flowed in a region (which @region-style <region-sel> accomplishes), the other being the selection of elements (or lines) and the last one is extensibility.
>>
>> I like the idea of having a ::lines-in-region pseudo element and I think it expresses the selection part really well. For extensibility, I would like that we would do something like:
>>
>> @region-style <region_sel> {
>> h1:before {
>> content: "(continued)";
>> }
>> }
>>
>> in the future. To be able to have richer region styling in the future, I think we need to have a scoping syntax. I would prefer an @ rule over putting the additional scoping on individual selectors. For my previous example, we would otherwise have to write something like:
>>
>> h1:before-in-region(<region_sel>) {}
>>
>> or something of that sort.
>
> Another idea might be to add a scoping qualifier that says you're only styling lines,
>
> @region-style lines <region_sel>
> {
> h1 { color: red; font-size: larger } /* Only applies to the lines of h1 */
> }
>
> Then in the future we could say that the keyword is optional and/or introduce new types that might support different property subsets, e.g.,
>
> @region-style all <region_sel>
> {
> }
>
> or just
>
> @region-style <region_sel>
> {
> }
Yes, that sounds good and provides both scoping and room for future extension.
>
> You still have the computed style issue to deal with here though. You'd need a new method like getComputedRegionStyle that could indicate what you're asking for (the lines in a particular region). That's one advantage of the ::lines-in-region() pseudo-element syntax. It works with the existing CSS OM.
One idea that came up in internal discussions here is to say that selectors in an @region rule would only work, for elements, if the element is fully in the region.
So for example, if we had:
@region <region-A-sel> {
#div_1 {}
#div_2 {}
}
and assuming that div_1 is fully in region-A and div_2 is split over region-A and region-B, only the #div_1 selector would actually be a match. Our feeling is that if you combine this with the lines selectors, we would get the effects we want and not introduce a computed style for a div that is different depending on the region.
Vincent.
Received on Saturday, 14 May 2011 02:21:51 UTC