W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2016

[csswg-drafts] [css-box-3][css-21] Positioning boxes with { float:left; width:0px; }

From: François REMY via GitHub <sysbot+gh@w3.org>
Date: Thu, 06 Oct 2016 20:30:24 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-181517622-1475785822-sysbot+gh@w3.org>
FremyCompany has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-box-3][css-21] Positioning boxes with { float:left; width:0px;
 } ==
A float is positioned according to various rules, whose following are 
relevant in this case: 
> • The outer top of an element's floating box may not be higher than 
the top of any line-box 
containing a box generated by an element earlier in the source 
document. 
> • A floating box must be placed as high as possible. 
> • A left-floating box must be put as far to the left as possible, a 
right-floating box as far to the right 
as possible. A higher position is preferred over one that is further 
to the left/right. 

I guess how most browsers implement the first rule in code is: 
> Whenever the line builder has to position a float whose width is 
{NECESSARY}px in a line box that is 
already {COMMITTED}px wide, in a constrained space of {AVAILABLE}px, 
then the float can be placed to 
the left of the line box if NECESSARY ≤ AVAILABLE - COMMITTED. 

This isn't entirely true, though. In the case of 0px-wide floaters, it
 is ALWAYS possible to put the floater on the same line as the current
 one. This is what Edge implements. This is not what most others seems
 to be doing in the case the line is "already too big" (for instance 
contains an unbreakable word or a picture that is longer than the 
container width). 

In short, most browsers just decide to push the float beneath the 
current line box based on the fact that 
``` 0 ≤ 200 - 300 ⇔ 0 ≤ -100``` (a very well-known corollary of the 
Zero Theorem). This is not a correct implementation of CSS 2.1 rules. 

Should we file bugs on browsers here, or should we change the rules to
 match Chrome and Firefox? 

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/576 using your GitHub 
account
Received on Thursday, 6 October 2016 20:30:38 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:04 UTC