Closed Bug 4098 Opened 26 years ago Closed 26 years ago

Fractions of pixels should round *down*, not to nearest integer

Categories

(Core :: Layout, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED WONTFIX

People

(Reporter: ian, Assigned: peterl-retired)

References

()

Details

NGLayout, build of 1999-03-20, fails the half-size box acid test, although it passes both the normal and double size versions. Apparent problems are mainly the placement of elements. The size and color of elements seems to be ok. [ ccing Todd. I hope that's what you want, Todd... sorry about the spam. :-) ]
Assignee: troy → kipp
Status: NEW → ASSIGNED
Severity: normal → trivial
The problem is that the widths of the left floated elements are being rounded up so that they just exceed the available width, and so the floats are moving down. In other words, NGLayout is technically speaking acting correctly, since the spec does not define rounding behaviour. I would suggest, however, that this could be 'fixed' by always rounding _down_, instead of rounding to the nearest integer number of pixels. That way, 50%+50% could never add up to more than 100%. (If rounding-to-nearest-integer is used, then 50%+50% of 3px is 4px, because the first 50% of 3 is 1.5 which rounds to 2px.) [ reducing severity as this really is a trivial problem ]
Summary: NGLayout fails the boxacidtest - dramatically → Fractions of pixels should round *down*, not to nearest integer
Changing summary to a more accurate description of the problem.
Assignee: kipp → peterl
Status: ASSIGNED → NEW
peter and ian can argue this one out; if something definitive comes of it, then assign specific bugs to specific code. thanks.
Sorry, we really need to round up as well as down, there are too many cases where cumulative rounding errors would be too great otherwise. By rounding both ways, rounding errors at least tend to cancel each other out...
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
The half-size boxacidtest is a bit funny because the dl's computed width comes out to either 234 or 236 px, because its padding is 2.5px. I think NGLayout's rounding methods are legitimate. The other two versions of the boxacidtest always assume that the UA will round up, and therefore use numbers that are slightly low. As long as nothing can happen with repeated use of the same units to fill a space, I think you're OK.
*** Bug 8532 has been marked as a duplicate of this bug. ***
Blocks: acid1
This actually looks fixed now, despite being marked WONTFIX.
*** Bug 21193 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.