Closed
Bug 120690
Opened 24 years ago
Closed 22 years ago
NSToCoordCeil() is buggy
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
DUPLICATE
of bug 118117
People
(Reporter: bryner, Unassigned)
References
Details
Reproduced this on Linux and Windows:
Calling NSToCoordCeil(0.0) returns 1! The reason seems to be that
CEIL_CONST_FLOAT at the top of nsUnitConversion.h has too many digits, and the
compiler rounds the number to 1.0.
Comment 2•24 years ago
|
||
This isn't me, but the "peterl" before me. My CVS account is "peterlubczynski".
-->back to default owner
Assignee: peterl → dougt
Comment 3•24 years ago
|
||
Over to layout team. This file should probably move there anyway.
Assignee: dougt → attinasi
Component: XPCOM → Layout
QA Contact: scc → petersen
Updated•24 years ago
|
Target Milestone: --- → mozilla1.0
Comment 4•24 years ago
|
||
The only active component in layout that uses this is mathml. -->mathml
Assignee: attinasi → rbs
Component: Layout → MathML
QA Contact: petersen → ian
| Reporter | ||
Comment 5•24 years ago
|
||
Uh, I'm going to put this back. This function is used extensively by nsRect in
gfx, so it affects nearly everyone who uses nsRect's.
Component: MathML → Layout
Comment 6•24 years ago
|
||
This functionalty should be moved out of XPCOM.
It was in rev 3.3 that peterl replaced the standard C functions with these:
http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/xpcom/ds/nsUnitConversion.h
I suspect the change may have been for speed reasons since reliable versions
aren't that cheap. For example, JS uses the following one (s/-inf/+inf/, BTW):
http://lxr.mozilla.org/seamonkey/source/js/src/fdlibm/s_ceil.c#48
There could be similar problems with NSToCoordFloor which is used even more than
NSToCoordCeil. Looks like a premature optimzation since the other side of the
coin is that having such functions around for that long means people may have
built on the behavior.
Comment 8•23 years ago
|
||
So can we switch to just using ceil() and floor() instead?
Possibly. Just need a good testing window (e.g. 1.5).
-> re-assigning to default, so that it gets triaged properly.
Assignee: rbs → misc
Component: Layout → Layout: Misc Code
QA Contact: ian → nobody
Updated•23 years ago
|
Target Milestone: mozilla1.0 → ---
Ultimately I'd like to have only integer arithmetic in layout.
Comment 11•22 years ago
|
||
Isn't this a dup of bug 118117?
Comment 12•22 years ago
|
||
*** This bug has been marked as a duplicate of 118117 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Updated•8 years ago
|
Product: Core → Core Graveyard
Updated•8 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•