Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-page-floats] Absolutely positioned? #243

Open
bradkemper opened this issue Jun 25, 2016 · 3 comments
Open

[css-page-floats] Absolutely positioned? #243

bradkemper opened this issue Jun 25, 2016 · 3 comments

Comments

@bradkemper
Copy link
Contributor

bradkemper commented Jun 25, 2016

https://drafts.csswg.org/css-page-floats/#relation_to_absolutely_positioned_exclusions implies that page floats are absolutely positioned, with the actual position determined by the spec logic. The subsections are about how "absolutely positioned exclusions" are different from inline floats. So are these actual absolutely positioned exclusions (with automatic locations based on values defined in this spec)? Or are they just similar to "absolutely positioned" items, and if so, how similar? For instance, do they create a containing block for their positioned descendants? Are margins not collapsed? Are 'auto' margins changed to 0? Are 'auto' widths shrink-wrapped? Do most 'display-outside: inline' things become block? Put another way, is the computed value of 'position', 'absolute'?

IMO, the answer to all these should be "yes". The spec kind of implies it, but the closest it comes to actually saying so is "Floats that are not inline floats should behave the same as absolutely positioned exclusions." Related question: what if 'left', 'right', 'top', and/or 'bottom' are not 'auto' for the page-floated item? What wins?

Note that setting position:absolute normally overrides floats, but these aren't really floats, they're absolutely positioned exclusions with actual positions determined another way. Another reason why the 'float' property should not be overloaded to include this completely separate model of wrapping.

@bradkemper
Copy link
Contributor Author

If page floating something makes its position property compute to absolute, then the spec should also say that the float-reference becomes the containing block.

@johanneswilm
Copy link
Contributor

Maybe the wording isn't clear enough. The point is saying that they behave like exclusions that are absolutely positions, where the positioning part is taken care of by means of what is specified in the page float spec. In other words: If you have a browser with exclusions and you can absolutely position elements in that browser, then you should be able to polyfill this spec with JavaScript.

@bradkemper
Copy link
Contributor Author

I took that to be the general point, but the details aren't clear:

There are several side effects of absolutely positioning things; I've listed several. It should be made clear which things about position:absolute apply, and which don't. Even with your reply, I don't know to what extent they are "like" absolutely positioned items. If they don't share all or most of the same features/side-effects, then an uninformed polfill will produce different results.

I think the clearest and easiest way to deal with it is to go ahead and say that this property causes position to compute to absolute, overriding any other value of positionon the element, causing it to ignore top, right, bottom, and left property values, and causing the float-reference to become the containing block (preventing other ancestors with non-static positions from becoming its containing block).

Otherwise, if that's not the case, then you should detail how this is different from an absolutely positioned exclusion (aside from not needing any non-auto top, right, bottom, and left property values). And to what extent it is the same. Details should include auto margins, collapsing margins, auto widths, what happens when you page float an inline, what happens if you have position:relative and top, right, bottom, and left values on a page float, etc. (and probably other considerations).

How can anyone create a polyfill without knowing these details, when absolute positioning changes these details? Some of these details can also add to your list of how inline floats are different from absolutely positioned exclusions. How page floats are different from absolutely positioned exclusions is an equally important thing to distinguish, after that list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants