diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index db75a739a719..adfe86b0a331 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -501,9 +501,10 @@ nsComboboxControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); + } } } diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 0b3d14c61129..83645ecbee07 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -225,9 +225,10 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 019b8d4d2906..e1966a5a1092 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -638,9 +638,10 @@ nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 6c9cdf83bf4c..9409a6fe08ff 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -361,9 +361,11 @@ nsHTMLButtonControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); + } } } diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp index 5dec9265503e..7632dc8823df 100644 --- a/layout/forms/nsImageControlFrame.cpp +++ b/layout/forms/nsImageControlFrame.cpp @@ -327,9 +327,10 @@ nsImageControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/forms/nsIsIndexFrame.cpp b/layout/forms/nsIsIndexFrame.cpp index b89989a6c183..2ef2900831d0 100644 --- a/layout/forms/nsIsIndexFrame.cpp +++ b/layout/forms/nsIsIndexFrame.cpp @@ -276,9 +276,10 @@ nsIsIndexFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 07ac05cd303a..45d0acb322bf 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -2034,9 +2034,10 @@ nsListControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index db75a739a719..adfe86b0a331 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -501,9 +501,10 @@ nsComboboxControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); + } } } diff --git a/layout/html/forms/src/nsFileControlFrame.cpp b/layout/html/forms/src/nsFileControlFrame.cpp index 0b3d14c61129..83645ecbee07 100644 --- a/layout/html/forms/src/nsFileControlFrame.cpp +++ b/layout/html/forms/src/nsFileControlFrame.cpp @@ -225,9 +225,10 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsFormControlFrame.cpp b/layout/html/forms/src/nsFormControlFrame.cpp index 019b8d4d2906..e1966a5a1092 100644 --- a/layout/html/forms/src/nsFormControlFrame.cpp +++ b/layout/html/forms/src/nsFormControlFrame.cpp @@ -638,9 +638,10 @@ nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsGfxListControlFrame.cpp b/layout/html/forms/src/nsGfxListControlFrame.cpp index df1391d52122..ef51fb3acc5c 100644 --- a/layout/html/forms/src/nsGfxListControlFrame.cpp +++ b/layout/html/forms/src/nsGfxListControlFrame.cpp @@ -2215,9 +2215,10 @@ nsGfxListControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/layout/html/forms/src/nsGfxTextControlFrame2.cpp index b99ba0243d9e..f160377e9a1b 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -2195,7 +2195,19 @@ nsGfxTextControlFrame2::GetSizeFromContent(PRInt32* aSize) const } void nsGfxTextControlFrame2::SetFocus(PRBool aOn , PRBool aRepaint){} -void nsGfxTextControlFrame2::ScrollIntoView(nsIPresContext* aPresContext){} + +void nsGfxTextControlFrame2::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + if (presShell) { + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); + } + } +} + void nsGfxTextControlFrame2::MouseClicked(nsIPresContext* aPresContext){} void nsGfxTextControlFrame2::Reset(nsIPresContext* aPresContext) diff --git a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 6c9cdf83bf4c..9409a6fe08ff 100644 --- a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -361,9 +361,11 @@ nsHTMLButtonControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); + } } } diff --git a/layout/html/forms/src/nsImageControlFrame.cpp b/layout/html/forms/src/nsImageControlFrame.cpp index 5dec9265503e..7632dc8823df 100644 --- a/layout/html/forms/src/nsImageControlFrame.cpp +++ b/layout/html/forms/src/nsImageControlFrame.cpp @@ -327,9 +327,10 @@ nsImageControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsIsIndexFrame.cpp b/layout/html/forms/src/nsIsIndexFrame.cpp index b89989a6c183..2ef2900831d0 100644 --- a/layout/html/forms/src/nsIsIndexFrame.cpp +++ b/layout/html/forms/src/nsIsIndexFrame.cpp @@ -276,9 +276,10 @@ nsIsIndexFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } } diff --git a/layout/html/forms/src/nsListControlFrame.cpp b/layout/html/forms/src/nsListControlFrame.cpp index 07ac05cd303a..45d0acb322bf 100644 --- a/layout/html/forms/src/nsListControlFrame.cpp +++ b/layout/html/forms/src/nsListControlFrame.cpp @@ -2034,9 +2034,10 @@ nsListControlFrame::ScrollIntoView(nsIPresContext* aPresContext) if (aPresContext) { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - presShell->ScrollFrameIntoView(this, + if (presShell) { + presShell->ScrollFrameIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - + } } }