nowrap issues

David Hyatt hyatt@apple.com
Thu, 16 Jan 2003 14:30:22 -0800


I implemented this, and it works.  I just added the new value, and then 
do this in RenderTableCell's setStyle.

if (style->whiteSpace() == KONQ_NOWRAP) {
         // Figure out if we are really nowrapping or if we should just
         // use normal instead.  If the width of the cell is fixed, then
         // we don't actually use NOWRAP.
         if (style->width().isFixed())
             style->setWhiteSpace(NORMAL);
         else
             style->setWhiteSpace(NOWRAP);
  }

This lets you get rid of the table cell casting and checks in 
RenderFlow::calcMinMaxWidth too.

dave

On Thursday, January 16, 2003, at 01:42 PM, David Hyatt wrote:

> So now that I made nowrap work like the KHTML trunk (I was improperly 
> applying nowrap when calcing the minmax for block children, when it 
> should have only applied for minmax calcs of inline children), Apple's 
> internal HR site misrenders.  It does so because it has a construction 
> like the following:
>
> <td nowrap>
> <div>
> Some text that shouldn't wrap.
> </div>
> </td>
>
> The problem with the current way table nowrap is handled is that it 
> isn't placed into CSS, so there's no inheritance of white-space into 
> child content.  The <div> thinks it has white-space: normal, so it 
> computes a min-width that is way too small.
>
> My idea for correcting this is to actually make a new CSS value for 
> the white-space property, -konq-nowrap, that can be used to represent 
> <td nowrap>.  When encountered, the value can be dynamically mapped to 
> "normal" if the cell has a fixed width or to "nowrap" if the cell does 
> not.
>
> What do you think?
>
> dave
> (hyatt@apple.com)
>
> _______________________________________________
> Khtml-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/khtml-devel