Closed Bug 372797 Opened 19 years ago Closed 19 years ago

Convert ScrollFrameIntoView users to use ScrollContentIntoView

Categories

(Core :: General, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(1 file, 1 obsolete file)

See bug 372665. Better to handle scrolling into view consistently. So, if possible, only ScrollContentIntoView should be used, and ScrollFrameIntoView and ScrollContentIntoView could be then merged together.
Attached patch patch (obsolete) — Splinter Review
The a bit ugly part is in nsAccessNode::ScrollTo. I basically inlined part of nsAccessNode::GetFrame to get the right content easily. nsGenericHTMLElement::GetFormControlFrameFor should do at least as "powerful" flush as ScrollContentIntoView to ensure everything is ok. With the patch nsLayoutUtils::ScrollIntoView isn't needed anymore, because nsGenericHTMLFormElement::SetFocusAndScrollIntoView does the scrolling.
Assignee: nobody → Olli.Pettay
Status: NEW → ASSIGNED
Attachment #257498 - Flags: review?(roc)
Why don't you just have nsAccessNode call GetFrame() and then use that frame's GetContent()? Are you fixing a bug where nsAccessNode::ScrollTo needed to flush before calling GetFrame, but wasn't? nsIFrame* frame = presShell->GetPrimaryFrameFor(c); Can you just remove this (from nsSpatialNavigation::setFocusedContent) and the "if (frame)" test? Otherwise looks good.
Attached patch fixed commentsSplinter Review
Attachment #257663 - Flags: review?(roc)
Attachment #257498 - Attachment is obsolete: true
Attachment #257498 - Flags: review?(roc)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Yes. "RESOLVED FIXED" ;)
For the nsAccessNode change, it would have been better to do: nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode); It avoids a GetPrimaryFrameFor() -- no big deal though.
So I'm a little confused here. What was the reason for the GetFormControlFrameFor change (to flush layout, not just frames)?
IIRC, (my memory isn't too good when trying to remember things I did 22 months ago) it was because the old ScrollContentIntoView used to flush layout.
Yes, but this function is called for things other than scrolling, and some of those are perf-sensitive. Shouldn't SetFocusAndScrollIntoView handle the flushing itself if that's what it needs?
OK, so I'm going to back out that change in bug 67752.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: