Bug 712130 - Defer autofocus until after frame construction. r=bz
The autofocus attribute on form elements forces layout in CheckIfFocusable. To avoid unpleasant FOUCs, defer autofocus processing until frames are constructed in PresShell::Initialize. Resolve the race between nsAutoFocusEvent running and page load by checking the readystate at time of event posting. Skip autofocus if the element moved to a different window in the meantime. MozReview-Commit-ID: 90jiJYJWmRg
This commit is contained in:
@@ -1817,6 +1817,8 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
NS_ENSURE_STATE(!mHaveShutDown);
|
||||
}
|
||||
|
||||
mDocument->TriggerAutoFocus();
|
||||
|
||||
NS_ASSERTION(rootFrame, "How did that happen?");
|
||||
|
||||
// Note: when the frame was created above it had the NS_FRAME_IS_DIRTY bit
|
||||
|
||||
Reference in New Issue
Block a user