Tip for you to quick and comfortable testing: my program PHP-Aquarium <HTML> <HEAD> <STYLE type="text/css"> td { font-size:12px } td:first-line { font-size:24px } </STYLE> </HEAD> <BODY> <H3>Calculation of column width with CCS-pseudo-class first-line.</H3> <P>Column width seems to be calculated before the first-line attributes are applied - wrong?</P> <TABLE cellspacing=0 border=1> <TR> <TD>erste Zeile<br>zweite Zeile</TD> </TR> </TABLE> <P>Awaited:</P> <TABLE cellspacing=0 border=1> <TR> <TD>erste Zeile<br>zweite breitererere Zeile</TD> </TR> </TABLE> </BODY> </HTML>
Priority P1 because I guess its an organizational thing (order) inside the webkit engine which will effect other problems too. So its a good bug to understand and test the problem. I am happy that I have not to do this ;-)
Firefox 3.0.3 doesnt break the first line but calculates the width of the column if second line has the font-size of the first line. Different but not better ;-)
More variations: <HTML> <HEAD> <STYLE type="text/css"> td { font-size:12px } td:first-line { font-size:24px } td.no:first-line { font-size:12px } </STYLE> </HEAD> <BODY> <H3>Calculation of column width with CCS-pseudo-class first-line.</H3> <P>Column width seems to be calculated before the first-line attributes are applied - wrong?</P> <TABLE cellspacing=0 border=1> <TR> <TD>erste Zeile<br>zweite Zeile</TD> </TR> </TABLE> <P>Awaited:</P> <TABLE cellspacing=0 border=1> <TR> <TD>erste Zeile<br>zweite breitererere Zeile</TD> </TR> </TABLE> <P>No work around: nowrap</P> <TABLE cellspacing=0 border=1> <TR> <TD nowrap >erste Zeile<br>zweite Zeile</TD> </TR> </TABLE> <P>Same with CSS: white-space:nowrap</P> <TABLE cellspacing=0 border=1> <TR> <TD style="white-space:nowrap">erste Zeile<br>zweite Zeile</TD> </TR> </TABLE> <P>So what about &nbsp; ?</P> <TABLE cellspacing=0 border=1> <TR> <TD style="white-space:nowrap">erste Zeile<br>zweite Zeile</TD> </TR> </TABLE> <P>Seems my theory is true:</P> <TABLE cellspacing=0 border=1> <TR> <TD>ersteextrabreite Zeile<br>zweite Zeile</TD> </TR> </TABLE> <TABLE cellspacing=0 border=1> <TR> <TD class=no>ersteextrabreite Zeile</TD> </TR> </TABLE> <P> </P> <TABLE cellspacing=0 border=1> <TR> <TD>erste extrabreite Zeile<br>zweite Zeile</TD> </TR> </TABLE> <TABLE cellspacing=0 border=1> <TR> <TD class=no>erste extrabreite Zeile</TD> </TR> </TABLE> </BODY> </HTML>
Isnt solved up to r58391.
Not a bug. This is undefined in the specs, and I believe our behavior is reasonable. You have to determine what size something is before you can determine what the first line is. You may then have to adjust what is actually on the first line, based on the ::first-line styles, but ideally you want to minimize the amount of layout changes based on that. If the spec ever specifies what to do here, we should ensure that we match it. Until then, I'm marking this as WONTFIX.
Created attachment 112092 [details] Two unsuccessful attempts in trying to get control over line break.