Bug 89738

Summary: Percentage widths less than 1% rounded to zero
Product: [Applications] konqueror Reporter: Phil Endecott <spam_from_kde_bugzilla>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Testcase mentioned in description

Description Phil Endecott 2004-09-18 01:59:40 UTC
Version:            (using KDE KDE 3.2.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Absolute widths specified using percentages of less than 1 seem to be
rounded down to 0 pixels.

The test case that I will attach contains a series of nested pairs of
divs.  In each case the outer div, whose width is specified as a
number of pixels, changes.  At the same time the inner div's width is
specied as a percentage and also changes reciprocally so that its width
in absolute terms should remain the same at 1 pixel wide.  So for
example in one case the outer div is 10 pixels wide and the inner div
is 10% wide, and in another case the outer div is 1000 pixels wide and
the inner div is 0.1% wide.

It seems that in the cases where the percentage is less than one,
nothing is displayed.  I'm guessing that there is some incorrect
rounding going on somewhere.

I see the behaviour that I expect in Mozilla and Internet Explorer.

I use code similar to this at http://treefic.com [click on one of the
demo images] and am keen to have it work on all browsers including
Konqueror and Safari.  An earlier version of treefic.com did work in
Konqueror, but I changed to percentages so that it scales correctly if
the user changes font sizes.


Regards,

--Phil Endecott.
Comment 1 Phil Endecott 2004-09-18 02:00:44 UTC
Created attachment 7566 [details]
Testcase mentioned in description
Comment 2 Thiago Macieira 2005-10-01 03:00:50 UTC
Larger problem: KHTML rounds percentages down to the integer part, so anything less than 1% is rounded down to 0.

*** This bug has been marked as a duplicate of 113630 ***