Closed Bug 77947 Opened 24 years ago Closed 6 years ago

floating point math in CalcLineHeight() necessary?

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: waterson, Unassigned)

References

Details

(Keywords: perf)

While profiling the test case in bug 56854, the floating point conversion done in CalcLineHeight() jumped out as a major component of this routine's time. Is it necessary? Can it be improved? (Refer to bug 56854 for details.)
Blocks: 56854
Status: NEW → ASSIGNED
Priority: -- → P5
Target Milestone: --- → mozilla0.9.1
Keywords: donttest, perf
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Target Milestone: mozilla0.9.2 → mozilla1.0
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
remove self
Target Milestone: mozilla1.0.1 → Future
OS: Windows 2000 → All
Hardware: PC → All
.
Assignee: waterson → block-and-inline
Status: ASSIGNED → NEW
Component: Layout → Layout: Block & Inline
Priority: P5 → --
QA Contact: petersen → ian
Target Milestone: Future → ---
Assignee: layout.block-and-inline → nobody
QA Contact: ian → layout.block-and-inline

From looking, ComputeLineHeight generally can't avoid floats in the special cases, since it's dealing with float values and fontInflation.
The primary case of GetFontMetricsForComputedStyle() avoids unneeded float ops as far as is reasonable. I think we can close this.

NSCoords are ints and so the float calcs get rounded, though there's a "we'd like to make them floats someday" comment which likely goes back to the Netscape days and which would probably break a lot...

Flags: needinfo?(svoisen)

Jonathan — Thoughts on closing this?

Flags: needinfo?(svoisen) → needinfo?(jfkthame)

:jesup is correct in comment 4, we can't simply remove all floating-point work from here, though we can (and do) avoid it in some cases. I don't think this is useful as it stands.

(I'm interested in more generally re-examining how line height is computed, particularly for 'normal', as this is a perennial source of compat/interop issues, but that's not this bug - and any revision to this will likely still include floating-point math in some way.)

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(jfkthame)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.