Bug 21588 - Calculation of column width with CSS-pseudo-class first-line
Summary: Calculation of column width with CSS-pseudo-class first-line
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL: https://macshot.de/php-aquarium
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-14 06:26 PDT by Rüdiger Cordes
Modified: 2011-10-22 11:28 PDT (History)
1 user (show)

See Also:


Attachments
Two unsuccessful attempts in trying to get control over line break. (1.17 KB, text/html)
2011-10-22 11:28 PDT, Rüdiger Cordes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Cordes 2008-10-14 06:26:11 PDT
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>
Comment 1 Rüdiger Cordes 2008-10-14 06:39:13 PDT
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 ;-)
Comment 2 Rüdiger Cordes 2008-10-14 06:48:46 PDT
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 ;-) 
Comment 3 Rüdiger Cordes 2008-10-14 09:47:59 PDT
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 &amp;nbsp; ?</P>
<TABLE cellspacing=0 border=1>
 <TR>
  <TD style="white-space:nowrap">erste&nbsp;Zeile<br>zweite Zeile</TD>
 </TR>
</TABLE>
<P>Seems my theory is true:</P>
<TABLE cellspacing=0 border=1>
 <TR>
  <TD>ersteextrabreite&nbsp;Zeile<br>zweite Zeile</TD>
 </TR>
</TABLE>
<TABLE cellspacing=0 border=1>
 <TR>
  <TD class=no>ersteextrabreite&nbsp;Zeile</TD>
 </TR>
</TABLE>
<P>&nbsp;</P>
<TABLE cellspacing=0 border=1>
 <TR>
  <TD>erste extrabreite&nbsp;Zeile<br>zweite Zeile</TD>
 </TR>
</TABLE>
<TABLE cellspacing=0 border=1>
 <TR>
  <TD class=no>erste extrabreite Zeile</TD>
 </TR>
</TABLE>
</BODY>
</HTML>
Comment 4 Rüdiger Cordes 2010-04-28 20:44:11 PDT
Isnt solved up to r58391.
Comment 5 Tab Atkins 2011-10-21 15:04:12 PDT
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.
Comment 6 Rüdiger Cordes 2011-10-22 11:28:33 PDT
Created attachment 112092 [details]
Two unsuccessful attempts in trying to get control over line break.