mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
Bug 320938 - autocompletion of a text-field pops up above firefox. patch=mwu, r=jst
This commit is contained in:
parent
60526043fd
commit
0564b9ebaa
@ -216,6 +216,17 @@ nsFormFillController::SetPopupOpen(PRBool aPopupOpen)
|
||||
{
|
||||
if (mFocusedPopup) {
|
||||
if (aPopupOpen) {
|
||||
// make sure input field is visible before showing popup (bug 320938)
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mFocusedInput);
|
||||
nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(mFocusedInput);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
||||
nsIFrame *frame = presShell->GetPrimaryFrameFor(content.get());
|
||||
if (frame)
|
||||
presShell->ScrollFrameIntoView(frame,
|
||||
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,
|
||||
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
|
||||
|
||||
nsRect popupRect = GetScreenOrigin(mFocusedInput);
|
||||
mFocusedPopup->OpenPopup(this, popupRect.x, popupRect.y+popupRect.height, popupRect.width);
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user