Closed
Bug 91380
Opened 25 years ago
Closed 25 years ago
Implementation of nsScrollBoxObject::ScrollToElement and EnsureElementIsVisible
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: kinger, Assigned: bryner)
Details
Attachments
(2 files)
|
4.96 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.92 KB,
patch
|
Details | Diff | Splinter Review |
We needed these two functions for Komodo, so we implemented them. The work was
done by Shane Caraveo, who is copied on the bug, so address any questions to
Shane.
Patch coming ...
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
Hmmm, aparently Shane does not have a bugzilla account
Comment 3•25 years ago
|
||
bryner, can you land these in the tree? the work appears to be done.
Assignee: trudelle → bryner
| Assignee | ||
Comment 4•25 years ago
|
||
A few nits:
- in nsScrollBoxObject::ScrollToElement, why do you bother getting the width and
height if they aren't needed?
+ // get the twips rectangle from teh boxobject (which has pixels)
fix the typo (this appears in two places)
Also, can you explain what algorithm you are using in EnsureElementIsVisible to
compute the scroll position?
Comment 5•25 years ago
|
||
Ok, fixing typos and removing some unused code, patch to follow.
As an explanation of the computation in EnsureElementIsVisible (if I'm not
explaining this clearly, let me know):
if (horiz) {
// if the right edge of the element is to the right of the
// right edge of the viewable box, get the difference, and move
// the left edge that many twips
if (rect.x + rect.width > cp.x + crect.width) {
newx = cp.x + ((rect.x + rect.width)-(cp.x + crect.width));
// else if the left edge of the element is not within the viewable box,
// make the left edge of the viewable box the left edge of the element
} else if (rect.x < cp.x) {
newx = rect.x;
}
// if neither of the above, the element is already fully visible
} else {
// if the bottom edge of the element is to the below the
// bottom edge of the viewable box, get the difference, and move
// the top edge that many twips
if (rect.y + rect.height > cp.y + crect.height) {
newx = cp.y + ((rect.y + rect.height)-(cp.y + crect.height));
// else if the top edge of the element is above the top edge of
// the viewable box,
// make the top edge of the viewable box the top edge of the element
} else if (rect.y < cp.y) {
newy = rect.y;
}
// if neither of the above, the element is already fully visible
}
Comment 6•25 years ago
|
||
| Assignee | ||
Comment 7•25 years ago
|
||
ok, r=bryner
| Reporter | ||
Comment 8•25 years ago
|
||
Does this need an sr? It would be nice if it made it in before the freeze
tomorrow.
| Assignee | ||
Comment 9•25 years ago
|
||
yes, it needs an sr.
Comment 10•25 years ago
|
||
Pick an sr=, likely hyatt or ben, and email them for review
cc:reviewers@mozilla.org
Comment 11•25 years ago
|
||
sr=hyatt
| Assignee | ||
Comment 12•25 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 13•25 years ago
|
||
May God have mercy on us all. The 212 bug spam-o-rama is Now!
QA Contact: aegis → jrgm
You need to log in
before you can comment on or make changes to this bug.
Description
•