[csswg-drafts] [css-shapes] Allow new formatting contexts to be sized based on *bounding* float-area.

bfgeek has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-shapes] Allow new formatting contexts to be sized based on *bounding* float-area. ==
With css-shapes, floats are positioned based on their margin-box. See example-5 in:
https://drafts.csswg.org/css-shapes-1/#relation-to-box-model-and-float-behavior

They will not try and place themselves based on the "float-area", instead the bounding margin-box.

New formatting contexts however, (`overflow: hidden`, etc) are a different story. It's not exactly clear what the spec intended here.

Currently today in Blinks implementation we will try and size new formatting contexts based on the "float-area". Our implementation uses a previous frame's data, which is completely broken.

In order to do this "correctly" you would have to iterate through every available inline-size, (stepping probably at each pixel?), perform a layout, and check if the block-size of the new FC will fit in the given area.

We (blink) have added a UseCounter for the broken behaviour, are probably going to move to our default sizing/positioning algorithm for new-FCs in the near future.

Given the "correct" behaviour is expensive (requires potentially N layouts - where N is a large number), it might be worth changing the spec to size & position new-FCs similar to how floats currently behave.

This would leave only line-boxes being sized and positioned based on the "float-area". 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1970 using your GitHub account

Received on Friday, 10 November 2017 18:15:58 UTC