Closed
Bug 245133
Opened 21 years ago
Closed 21 years ago
[FIX]bad focus behaviour when moving a text input and immediately focus on it in the same function
Categories
(Core :: Layout: Form Controls, defect, P3)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha2
People
(Reporter: nirvn.asia, Assigned: bzbarsky)
References
()
Details
Attachments
(2 files)
2.77 KB,
text/html
|
Details | |
3.83 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040530 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040530 Firefox/0.8.0+
If you call a function (say 'openMoveDiv()') that will move a text input in a
div to a new location on the page where you mouse clicked, and that you focus on
the input in the same function, the browser will scroll back to the old
div/input location.
Reproducible: Always
Steps to Reproduce:
1.Open proofofbug.html;
2.Go to the end of the page, click on 'Open div container here';
3. you can reproduce the behaviour infinitly by using the link at the beginning
of the page when your div is at the bottom, and vice-versa.
Actual Results:
the page scrolls back to the old text input position
Expected Results:
focus on the text using its new position
Reporter | ||
Comment 1•21 years ago
|
||
use this file to test the bug
Reporter | ||
Comment 2•21 years ago
|
||
I forgot to mention that there's an easy workaround: simply set a timeout
function (like 200ms later) that will focus the text input ...
![]() |
Assignee | |
Comment 3•21 years ago
|
||
Not at all related to the JS engine. The JS engine knows nothing about focus,
positions, etc.
Assignee: general → nobody
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → Layout: Form Controls
Ever confirmed: true
QA Contact: pschwartau → core.layout.form-controls
![]() |
Assignee | |
Comment 4•21 years ago
|
||
So the point is that we should be flushing reflows before trying to scroll
frames into view. Not sure whether the flush should be in
nsPresShell::ScrollFrameIntoView or in its callers.... Putting it in
ScrollFrameIntoView makes the most sense to me -- I don't really see a
reasonable situation where we'd want to ScrollFrameIntoView _without_ flushing.
Comment 5•21 years ago
|
||
Agreed.
![]() |
Assignee | |
Comment 6•21 years ago
|
||
Actually, this is a little tough... The problem is that we really need to flush
out both style and layout before scrolling. But we don't want to be flushing
out style while inside a frame impl, since the style change can tear down the frame.
So I think the right thing to do is to fix form control content impls to flush
before scrolling (like anchors and areas do).
![]() |
Assignee | |
Comment 7•21 years ago
|
||
On second thought, the right fix is to make Flush_Frames flush out style
reresolves (so that any frame reconstructs get flushed) and then have
ScrollFrameIntoView flush just reflow.
![]() |
Assignee | |
Comment 8•21 years ago
|
||
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
![]() |
Assignee | |
Comment 9•21 years ago
|
||
Comment on attachment 149702 [details] [diff] [review]
Patch
jst, what do you think? Note that the GetPrimaryFrame code in
nsGenericHTMLElement flushes Flush_Frames, which is why this is happy.
Attachment #149702 -
Flags: superreview?(jst)
Attachment #149702 -
Flags: review?(jst)
![]() |
Assignee | |
Updated•21 years ago
|
OS: Windows XP → All
Priority: -- → P3
Hardware: PC → All
Summary: bad focus behaviour when moving a text input and immediately focus on it in the same function → [FIX]bad focus behaviour when moving a text input and immediately focus on it in the same function
Target Milestone: --- → mozilla1.8alpha2
Comment 10•21 years ago
|
||
Comment on attachment 149702 [details] [diff] [review]
Patch
Looks good. r+sr=jst
Attachment #149702 -
Flags: superreview?(jst)
Attachment #149702 -
Flags: superreview+
Attachment #149702 -
Flags: review?(jst)
Attachment #149702 -
Flags: review+
![]() |
Assignee | |
Comment 11•21 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•