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

VERIFIED FIXED in mozilla1.5alpha

Status

()

Core
DOM: Core & HTML
P1
normal
VERIFIED FIXED
15 years ago
9 years ago

People

(Reporter: José Jeria, Assigned: bz)

Tracking

({testcase})

Trunk
mozilla1.5alpha
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
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:
(Reporter)

Comment 1

15 years ago
Created attachment 109753 [details]
Testcase.

Comment 2

15 years ago
Not dom events->DOM Html?
Assignee: saari → jst
Component: DOM Events → DOM HTML
QA Contact: vladimire → stummala
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Created attachment 121584 [details] [diff] [review]
Possible patch

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 8

15 years ago
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
Last Resolved: 15 years ago
Resolution: --- → FIXED
(Reporter)

Comment 10

15 years ago
Works fine now.
Status: RESOLVED → VERIFIED

Updated

9 years ago
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.