Re: [css-regions][css-values] font-size in em, and fragments

On Aug 6, 2013, at 8:00 PM, François REMY <francois.remy.dev@outlook.com> wrote:

> Hi,
> 
> While I was working on some [css-regions] demo (1), I noticed that the "pull-quote text-negociation" didn't work anymore.
> 
> =======================
> 
> Use case: You have a region and you adjust its font-size to avoid it to overflow/overset. 
> 
> =======================
> 
> In previous versions of Blink/Webkit, it used to work because the EM unit was computed relatively to the layout tree (so fragments inside a region with "font-size: 2em" where actually bigger than those in a region with "font-size: 1em".

Are you sure it used to work this way? Do you know when it stopped working this way? From an implementation standpoint I think this behaviour was impossible from the start. The style inheritance follows the DOM tree. Regions are not even found on the ancestor path in the display tree for content nodes (see this the second page of the http://sdrv.ms/17ztnd4 document for a sketch of how the render tree looks like with regions in WebKit/Blink).

> 
> Now, it seems this has been "fixed" and the EM unit is relative to the DOM parent. That means that:
> 
> - if you have a TEXTNODE directly poured into a flow, its FONT-SIZE WILL DEPEND ON THE REGION.
> - if you have an ELEMENT directly poured into a a flow, its FONT-SIZE WILL NOT DEPEND ON THE REGION because the EM value will be computed on the basis on the DOM parent element.

How can you flow a text node inside regions directly, without using flow-into on an element? Are you talking about the new flow-into: content value? The spec states the flow-into property doesn't affect the CSS cascade and I suppose this applies for the EM units resolution as well:
"The ‘flow-into’ property does not affect the CSS cascade and inheritance for the elements on which it is specified. The ‘flow-into’ property does not affect the DOM [DOM] position of an element or its contents. The ‘flow-into’ property affects the visual formatting of elements or contents placed into a named flowand of the region chain laying out content from a named flow."

> 
> This inconsistency is damageable, and I therefore propose to make sure the EM unit in a region fragment is relative to the region itself, not the actual DOM.
> 
> 
> 
> 
> 
> Thoughts?
> 
> 
> 
> 
> 
> (1) https://rawgithub.com/adobe-webplatform/css-regions-polyfill/master/playground/paginated-content/index.html
> ------ only works in Chrome Canary 
> ------ and with Experimental features enabled 		 	   		  

Received on Thursday, 8 August 2013 13:01:17 UTC