Skip to content

Commit 555ac38

Browse files
committed
[css-floats] Start some notes on floats.
1 parent 3435104 commit 555ac38

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

css-floats/float-notes.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
Float Notes
2+
===========
3+
4+
Three types of float: inline, side (block, inline), corner.
5+
Side and corner are "page floats".
6+
7+
'float' is shorthand for:
8+
9+
* float-origin: inline | block | flow-root | column | page | page( [ content-box | margin-box | bleed-box ] )
10+
* 'float' defaults this to "inline" for left/right/start/end single keywords, to "block" for everything else.
11+
* float-policy: ??? (see Håkon's Figures draft)
12+
* float-position:
13+
left | right | start | end |
14+
block-start | block-end |
15+
???
16+
* float-offset: [ <length> | <percentage> | <line-height-unit> ]{1,4}
17+
18+
'clear' means "if something is already there (value of clear), I want to go somewhere else".
19+
20+
* column, page - if you're not the first thing in this column/page + position, move to next fragment and try again
21+
22+
Acceptable Floating Scenarios That Need Syntax
23+
----------------------------------------------
24+
25+
1. inline left/right (today's float)
26+
2. side float to block side of current fragment
27+
1. always float
28+
2. float if close to edge, otherwise in-flow
29+
3. float if crossing fragment boundary, otherwise in-flow
30+
1. always up (same page, anchor pushes to next)
31+
2. always down (next page, anchor left on previous)
32+
3. use JLREQ 4.3.5 condition to determine up or down
33+
3. float to specific fragment
34+
1. corner float
35+
2. side float
36+
4. float to subsequent fragment
37+
1. corner float
38+
2. side float
39+
5. column spanning/intrusions?
40+
41+
Auto-Switching Float Types
42+
--------------------------
43+
44+
1. in-flow to side
45+
1. become a side float if close to the edge (Figures’ snap() function)
46+
2. become a side (bottom of current/top of next) float if falling across a fragment boundary
47+
1. inline/corner to side - some functionality to say if the leftover text space is too small, become a side float instead - JLREQ 4.3.3.e elaborates
48+
49+
Syntaxes???
50+
-----------
51+
52+
1: float: left | right
53+
54+
2.1: float: block-start | block-end
55+
* two block-end floats - first goes on bottom (similar to float: right)? Do we need a reverse keyword?
56+
57+
2.2: float: snap && [ block-start <<length>>? || block-end <<length>>? || inline-start <<length>>? || inline-end <<length>>? ]
58+
59+
2.3.1: float: before-break
60+
2.3.2: float: after-break
61+
2.3.3: float: across-break
62+
63+
3/4. float: <position> && <origin>? && [ next ?? <integer> ]
64+
(Intentional that you have to specify a particular or subsequent fragment to use this grammar clause.)
65+
66+
[Brad's thoughts on defining position](https://lists.w3.org/Archives/Public/www-style/2015Nov/0105.html)
67+
68+
3.1: float: top left 2;
69+
3.2: float: block-start page 2; /* float to the top of the 2nd page */
70+
71+
Allow %s for the fragment-locator?
72+
For long doc, allows to say "put this about halfway through",
73+
regardless of how it actually fragments on a given screen.
74+
Maybe just source-location + "next" is enough.
75+
76+
Need to define what to do if there isn't a given fragment.
77+
78+
79+
Layout
80+
------
81+
82+
The float-origin changes the float's CB.
83+
* What happens if there's a BFC boundary between the float's anchor and the desired float-origin?
84+
Floats shouldn't cross BFC boundaries.
85+
Require reparenting?
86+
Talk to implementors about this, as it'll be unpopular.
87+
88+
Resolving conflicts: resolve floats outside-in?
89+
Start at page level, then work inward to find positions of things.
90+
91+
Clearing
92+
--------
93+
94+
Def need the 8 cardinal values matching float-position
95+
96+
* 'both' for left+right
97+
* <origin> for all positions in that origin
98+
99+
If you can't clear, then what?
100+
* stay in-flow (ignore 'float')
101+
* ignore 'clear', just float as normal.
102+
* disappear
103+
* move to another specified position
104+
105+
float: top right;
106+
clear: top left / top right, top right / bottom right, bottom right / bottom left, bottom left / discard;
107+
clear: [ <clear-position> / <clear-behavior>? ]#
108+
* shift (default): shifts below stuff in clear-position (or above for bottom floats)
109+
* <position>
110+
* discard
111+
* unfloat
112+
* unclear
113+
* next <position>? / [ unfloat | unclear | discard ]? (default is unfloat) (triggers if there's no next fragment to go to)
114+
115+
If you can clear, where to move to?
116+
* clear: left/right/both move you down
117+
* page/column floats move to next fragmentainer (or if they're a top float, maybe they want to move to bottom float)
118+
119+
clear: top / bottom, bottom / next top;
120+
/* gives alternating top/bottom behavior, because we re-evaluate 'clear' when moving to another fragment */

0 commit comments

Comments
 (0)