Re: [css-writing-modes][CSS21] propagation of 'direction' from <body>

On 02/18/2015 06:29 AM, Simon Pieters wrote:
>
>>    a) Propagating at the HTML layer removes all of the CSS complexities,
>>       making it easier to fix all the bugs and keep them fixed. Only one
>>       lookup needs to happen.
>
> Maybe it introduces other bugs instead?

It's a much simpler operation, so while it might introduce other
bugs, it has less potential for bugginess now and in the future.
For example, besides the things tested (overflow, scrolling)
printing is also affected by the root writing mode. It affects
the direction of pagination, it affects which page is printed
first (:left or :right), it affects whether :left is equivalent
to :recto or :verso, etc. It also affects the cascade: whether
margin-left maps to margin-start depends on the writing mode.

Basically there are many, many interactions in CSS that would
have to be special-cased, whereas at the HTML layer, it's merely
a weird exception that <html> copies its 'dir' value from <body>.

>>    b) Content that misplaces dir=rtl is handled, and improved because now
>>       the <head> is also RTL.
>
> This is not relevant outside test cases.

It affects <title> and its presentation. (Or should.)

>> Wrt compat concerns of only handling dir=rtl and not 'direction: rtl':
>>
>>    Greg Whitworth found on a database of 1.3 million pages only 0.03% use
>>    'direction: rtl' at all. The number setting that on <body> is a subset
>>    of all that, and the number setting it on <body> and not <html> and
>>    relying on that making the root behave as RTL is a subset of *that*.
>
> Did that database include external stylesheets?

I don't know.

> In httparchive I get a different figure. Looking for pages that set direction: rtl or writing-mode: vertical-* on <body>,
> either in style="", or in a stylesheet:
>
> SELECT page, COUNT(*) as num
> FROM [httparchive:runs.2014_08_15_requests_body]
> WHERE REGEXP_MATCH(LOWER(body), r'<body\s[^>]*style\s*=\s*["\'][^"\']*(direction\s*:\s*rtl|writing-mode\s*:\s*vertical)')
> OR REGEXP_MATCH(LOWER(body), r'body\s*\{[^}]*(direction\s*:\s*rtl|writing-mode\s*:\s*vertical-)')
> GROUP BY page
> ORDER BY num desc;
>
> 4222 pages out of 130k pages; ~3.25%. This is much higher than <body dir=rtl> (~0.25%). (The sets might be overlapping, but
> even if they overlap perfectly it still leaves ~3.00% with only direction/writing-mode.)

What are the stats for just 'direction'?

~fantasai

Received on Thursday, 19 February 2015 18:12:33 UTC