Open
Bug 519787
Opened 15 years ago
Updated 2 years ago
Implement nsLayoutUtils node-position-compare functions on top of nsContentUtils::ComparePosition
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
NEW
People
(Reporter: sicking, Unassigned)
Details
nsLayoutUtils::CompareTreePosition and nsLayoutUtils::DoCompareTreePosition can and should be implemented on top of nsContentUtils::ComparePosition, in order to reduce code duplication. The only overhead would be an extra couple of conditional branches.
Comment 1•15 years ago
|
||
Note that the layout version has a common ancestor hint that's actually an important optimization for its callers....
Reporter | ||
Comment 2•15 years ago
|
||
Yeah, just noticed that. Looking at how it's used...
Reporter | ||
Comment 3•15 years ago
|
||
The only two callsites that take advantage of that optimization are
Displaylists: IsContentLEQ [1]
Forms: CompareFormControlPosition [2]
I suspect that displaylists are more perf critical here. Maybe even critical enough that we need to keep this function?
[1] http://mxr.mozilla.org/mozilla-central/source/layout/base/nsDisplayList.cpp#503
[2] http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLFormElement.cpp#1303
Comment 4•15 years ago
|
||
Display lists are pretty critical. But I think we should generally be using this more, fwiw....
Reporter | ||
Comment 5•15 years ago
|
||
One solution would be to move the function to nsContentUtils and then factor things such that code could be shared once the parent-chains had been built.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•