Open Bug 125560 Opened 22 years ago Updated 2 years ago

Rounding error positioning float: right inside block with percentage margins

Categories

(Core :: Layout: Floats, defect, P3)

defect

Tracking

()

Future

People

(Reporter: Daniel.Steinberger, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: css1, Whiteboard: [CSS1-5.5.5][CSS1-5.5.25])

Attachments

(2 files, 1 obsolete file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.8+)
Gecko/20020212
BuildID:    2002021203

due to rounding errors, Mozilla (and thus Netscape 6.x) may not move a
right-floated element over as far as it should be - this way the overlapping
margins display wrong.

Reproducible: Always
Steps to Reproduce:
1. visit URL or open testcase
(2. if you're at the URL, go down to the punchbox "better stick to what's needed")
3. resize your window a little, until you can see a border at the right of the
punchbox

Actual Results:  sometimes (rounding?) there is a border

Expected Results:  border should never appear

Opera6 does it perfectly right (at least my testcase)
IE6 does.. strange things. it doesn't change the display, but it doesn't display
it perfectly either
Mozilla does it well, except when your window is at a bad size
Attached file the mentioned testcase (obsolete) —
this is a simplyfied testcase demonstrating the issue. you may find the same
testcase here: http://frozenfire.dnsalias.net/NEMESiS/testcases/rounding.html -
it's a stipped down example of Eric A. Meyer's punchbox demo. easy to read.
QA Contact: petersen → moied
Confirmed with build ID 20020214 on win2k
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Target Milestone: --- → Future
Blocks: 134942
.
Assignee: attinasi → float
Component: Layout → Layout: Floats
Priority: P4 → --
QA Contact: moied → ian
Target Milestone: Future → ---
Priority: -- → P3
Target Milestone: --- → Future
I dont see any odd thing with the testcase, is this WFM? Build 20040114, Windows XP.
it's still there in mozilla-1.6 (id 20040113) - so it probably will be for your
build. did you RESIZE you window pixelwise? the bug only appears sometimes, when
the window-width triggers this rounding error.
I've attached a somewhat reduced testcase. To see the bug, it is essential that
the containing block of the float: right have a percentage margin. Furthermore,
the analogous testcase with float: left (included) shows no rounding errors at
any window width, regardless of resizing from right or left.
Attachment #69511 - Attachment is obsolete: true
Keywords: css1
Summary: rounding error (?) with right floating DIVs and negative margins → Rounding error positioning float: right inside block with percentage margins
Whiteboard: [CSS1-5.5.5][CSS1-5.5.25]
*** Bug 214567 has been marked as a duplicate of this bug. ***
I'm seeing this on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:)
Gecko/20040309

It's definitely still a bug.
OS: Windows XP → All
Hardware: PC → All
Confirmed.

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040331
Microsoft Windows 2000 Professional 5.00.2195 SP4
A similar thing happens when a div with a percent-based width contains two other
divs, one floated left, one right, whose widths add up to 100%. It seems to be
the same issue. Testcase follows...
The divs are coloured for clarity.
This doesn't seem to reproduce using ems in the outer div, nor in both the
outer and inner divs, resizing window, text or both.
Removing the percentage width from the outer div, or assigning a width of 100%
seems to fix the bug.
Any percentage width other than 100% seems to reproduce the bug.
Hmm, this looks like a rounding error in the computed values; not sure if we care enough to do double-precision math, though.
Assignee: layout.floats → nobody
QA Contact: ian → layout.floats
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: