Closed Bug 186149 Opened 22 years ago Closed 21 years ago

[FIXr] scrollIntoView() does not work on dynamically created elements

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.5alpha

People

(Reporter: bugzilla, Assigned: bzbarsky)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20021217
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20021217

Have a container (div) containings several divs, when hardcoded, i can use the
scrollIntoView(); to scroll to that element.

But when this element is created dynamically, the scrollIntoView() does not work.
See attached testcase.

Reproducible: Always

Steps to Reproduce:
Attached file Testcase.
Not dom events->DOM Html?
Assignee: saari → jst
Component: DOM Events → DOM HTML
QA Contact: vladimire → stummala
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Attached patch Possible patchSplinter Review
The problem (and this affects scrolling to anchors too) is that we can try to
scroll before the reflow events have been processed...

I suppose I could add the flush to ScrollFrameIntoView itself, but the problem
is that reflow can actually trigger frame reconstruction (for example <object>
will call CantRenderReplacedElement from reflow!).  So we want to call
GetPrimaryFrameFor _after_ we flush....
Attachment #121584 - Flags: superreview?(jst)
Attachment #121584 - Flags: review?(peterv)
Taking.
Assignee: dom_bugs → bzbarsky
Blocks: 104383
Keywords: testcase
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Summary: scrollIntoView() does not work on dynamically created elements → [FIX] scrollIntoView() does not work on dynamically created elements
Target Milestone: --- → mozilla1.5alpha
Comment on attachment 121584 [details] [diff] [review]
Possible patch

sr=jst
Attachment #121584 - Flags: superreview?(jst) → superreview+
Attachment #121584 - Flags: review?(peterv) → review+
Summary: [FIX] scrollIntoView() does not work on dynamically created elements → [FIXr] scrollIntoView() does not work on dynamically created elements
Comment on attachment 121584 [details] [diff] [review]
Possible patch

Requesting 1.4b approval; this just makes sure that we reflow before we get the
coordinates we're going to scroll to....
Attachment #121584 - Flags: approval1.4b?
Comment on attachment 121584 [details] [diff] [review]
Possible patch

a=asa (on behalf of drivers) for checkin to 1.4b
Attachment #121584 - Flags: approval1.4b? → approval1.4b+
Fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Works fine now.
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: