diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 73d2459ab17..15ea1caa331 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -302,6 +302,18 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) //XXX: TODO Implement focus for combobox. } +void +nsComboboxControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + // Toggle dropdown list. void diff --git a/mozilla/layout/forms/nsComboboxControlFrame.h b/mozilla/layout/forms/nsComboboxControlFrame.h index 8c1f450e946..907bdb8a7d5 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.h +++ b/mozilla/layout/forms/nsComboboxControlFrame.h @@ -100,6 +100,7 @@ public: NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue); NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue); void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); virtual void PostCreateWidget(nsIPresContext* aPresContext, nscoord& aWidth, nscoord& aHeight); diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index a0767b3adb1..28355ff7208 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -43,7 +43,7 @@ #include "nsIDOMDocument.h" #include "nsDocument.h" #include "nsIDOMMouseListener.h" - +#include "nsIPresShell.h" static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID); @@ -188,6 +188,18 @@ nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) } } +void +nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + /** * This is called when our browse button is clicked */ diff --git a/mozilla/layout/forms/nsFileControlFrame.h b/mozilla/layout/forms/nsFileControlFrame.h index 01a1616b126..a49ab236f33 100644 --- a/mozilla/layout/forms/nsFileControlFrame.h +++ b/mozilla/layout/forms/nsFileControlFrame.h @@ -77,6 +77,7 @@ public: virtual void Reset(); NS_IMETHOD GetType(PRInt32* aType) const; void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); diff --git a/mozilla/layout/forms/nsFormControlFrame.cpp b/mozilla/layout/forms/nsFormControlFrame.cpp index 3ea3d5500c2..ddca70209cb 100644 --- a/mozilla/layout/forms/nsFormControlFrame.cpp +++ b/mozilla/layout/forms/nsFormControlFrame.cpp @@ -268,6 +268,18 @@ nsFormControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { } +void +nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + const nsIID& nsFormControlFrame::GetIID() { @@ -387,7 +399,8 @@ nsFormControlFrame::IsSuccessful(nsIFormControlFrame* aSubmitter) return (NS_CONTENT_ATTR_HAS_VALUE == GetName(&name)); } -NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext, +NS_METHOD +nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext, nsGUIEvent* aEvent, nsEventStatus& aEventStatus) { @@ -463,7 +476,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, return NS_OK; } -nsresult nsFormControlFrame::GetDefaultCheckState(PRBool *aState) +nsresult +nsFormControlFrame::GetDefaultCheckState(PRBool *aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) { @@ -473,7 +487,8 @@ nsresult nsFormControlFrame::GetDefaultCheckState(PRBool *aState) return res; } -nsresult nsFormControlFrame::SetDefaultCheckState(PRBool aState) +nsresult +nsFormControlFrame::SetDefaultCheckState(PRBool aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -484,7 +499,8 @@ nsresult nsFormControlFrame::SetDefaultCheckState(PRBool aState) return res; } -nsresult nsFormControlFrame::GetCurrentCheckState(PRBool *aState) +nsresult +nsFormControlFrame::GetCurrentCheckState(PRBool *aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -495,7 +511,8 @@ nsresult nsFormControlFrame::GetCurrentCheckState(PRBool *aState) return res; } -nsresult nsFormControlFrame::SetCurrentCheckState(PRBool aState) +nsresult +nsFormControlFrame::SetCurrentCheckState(PRBool aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -506,27 +523,30 @@ nsresult nsFormControlFrame::SetCurrentCheckState(PRBool aState) return res; } -NS_IMETHODIMP nsFormControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue) +NS_IMETHODIMP +nsFormControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue) { return NS_OK; } -NS_IMETHODIMP nsFormControlFrame::GetProperty(nsIAtom* aName, nsString& aValue) +NS_IMETHODIMP +nsFormControlFrame::GetProperty(nsIAtom* aName, nsString& aValue) { return NS_OK; } -nsresult nsFormControlFrame::RequiresWidget(PRBool & aRequiresWidget) +nsresult +nsFormControlFrame::RequiresWidget(PRBool & aRequiresWidget) { aRequiresWidget = PR_TRUE; return NS_OK; } -NS_IMETHODIMP nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight) +NS_IMETHODIMP +nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight) { mSuggestedWidth = aWidth; mSuggestedHeight = aHeight; return NS_OK; } - diff --git a/mozilla/layout/forms/nsFormControlFrame.h b/mozilla/layout/forms/nsFormControlFrame.h index 847bd3666c7..32f65bc5794 100644 --- a/mozilla/layout/forms/nsFormControlFrame.h +++ b/mozilla/layout/forms/nsFormControlFrame.h @@ -134,7 +134,7 @@ public: nscoord& aWidth, nscoord& aHeight); virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE); - + virtual void ScrollIntoView(nsIPresContext* aPresContext); virtual void Reset(); virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter); diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index cfb6a2f044d..93159516afb 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -270,6 +270,18 @@ nsHTMLButtonControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { } +void +nsHTMLButtonControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + void nsHTMLButtonControlFrame::GetTranslatedRect(nsRect& aRect) { diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index e8c5a3c3884..3ca00c4b2b1 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -114,6 +114,7 @@ public: virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; } void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index 26cba786ba3..029958f60d4 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -100,6 +100,7 @@ public: virtual void Reset() {}; void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); @@ -276,6 +277,18 @@ nsImageControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) }*/ } +void +nsImageControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + void nsImageControlFrame::GetTranslatedRect(nsRect& aRect) { diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index f68817e3478..5030518c4df 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -1463,6 +1463,19 @@ nsListControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) // XXX:TODO Make set focus work } +//--------------------------------------------------------- +void +nsListControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + //--------------------------------------------------------- NS_IMETHODIMP diff --git a/mozilla/layout/forms/nsListControlFrame.h b/mozilla/layout/forms/nsListControlFrame.h index 5a293c26074..5f65cd74e51 100644 --- a/mozilla/layout/forms/nsListControlFrame.h +++ b/mozilla/layout/forms/nsListControlFrame.h @@ -78,6 +78,7 @@ public: NS_IMETHOD GetFormContent(nsIContent*& aContent) const; virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE); + virtual void ScrollIntoView(nsIPresContext* aPresContext); virtual void MouseClicked(nsIPresContext* aPresContext); virtual void Reset(); virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 73d2459ab17..15ea1caa331 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -302,6 +302,18 @@ nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) //XXX: TODO Implement focus for combobox. } +void +nsComboboxControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + // Toggle dropdown list. void diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h index 8c1f450e946..907bdb8a7d5 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h @@ -100,6 +100,7 @@ public: NS_IMETHOD SetProperty(nsIAtom* aName, const nsString& aValue); NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue); void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); virtual void PostCreateWidget(nsIPresContext* aPresContext, nscoord& aWidth, nscoord& aHeight); diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index a0767b3adb1..28355ff7208 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -43,7 +43,7 @@ #include "nsIDOMDocument.h" #include "nsDocument.h" #include "nsIDOMMouseListener.h" - +#include "nsIPresShell.h" static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID); @@ -188,6 +188,18 @@ nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) } } +void +nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + /** * This is called when our browse button is clicked */ diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.h b/mozilla/layout/html/forms/src/nsFileControlFrame.h index 01a1616b126..a49ab236f33 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.h +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.h @@ -77,6 +77,7 @@ public: virtual void Reset(); NS_IMETHOD GetType(PRInt32* aType) const; void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp index 3ea3d5500c2..ddca70209cb 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp @@ -268,6 +268,18 @@ nsFormControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { } +void +nsFormControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + const nsIID& nsFormControlFrame::GetIID() { @@ -387,7 +399,8 @@ nsFormControlFrame::IsSuccessful(nsIFormControlFrame* aSubmitter) return (NS_CONTENT_ATTR_HAS_VALUE == GetName(&name)); } -NS_METHOD nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext, +NS_METHOD +nsFormControlFrame::HandleEvent(nsIPresContext& aPresContext, nsGUIEvent* aEvent, nsEventStatus& aEventStatus) { @@ -463,7 +476,8 @@ nsFormControlFrame::GetFont(nsIPresContext* aPresContext, return NS_OK; } -nsresult nsFormControlFrame::GetDefaultCheckState(PRBool *aState) +nsresult +nsFormControlFrame::GetDefaultCheckState(PRBool *aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; if (NS_OK == mContent->QueryInterface(kIDOMHTMLInputElementIID, (void**)&inputElement)) { @@ -473,7 +487,8 @@ nsresult nsFormControlFrame::GetDefaultCheckState(PRBool *aState) return res; } -nsresult nsFormControlFrame::SetDefaultCheckState(PRBool aState) +nsresult +nsFormControlFrame::SetDefaultCheckState(PRBool aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -484,7 +499,8 @@ nsresult nsFormControlFrame::SetDefaultCheckState(PRBool aState) return res; } -nsresult nsFormControlFrame::GetCurrentCheckState(PRBool *aState) +nsresult +nsFormControlFrame::GetCurrentCheckState(PRBool *aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -495,7 +511,8 @@ nsresult nsFormControlFrame::GetCurrentCheckState(PRBool *aState) return res; } -nsresult nsFormControlFrame::SetCurrentCheckState(PRBool aState) +nsresult +nsFormControlFrame::SetCurrentCheckState(PRBool aState) { nsresult res = NS_OK; nsIDOMHTMLInputElement* inputElement; @@ -506,27 +523,30 @@ nsresult nsFormControlFrame::SetCurrentCheckState(PRBool aState) return res; } -NS_IMETHODIMP nsFormControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue) +NS_IMETHODIMP +nsFormControlFrame::SetProperty(nsIAtom* aName, const nsString& aValue) { return NS_OK; } -NS_IMETHODIMP nsFormControlFrame::GetProperty(nsIAtom* aName, nsString& aValue) +NS_IMETHODIMP +nsFormControlFrame::GetProperty(nsIAtom* aName, nsString& aValue) { return NS_OK; } -nsresult nsFormControlFrame::RequiresWidget(PRBool & aRequiresWidget) +nsresult +nsFormControlFrame::RequiresWidget(PRBool & aRequiresWidget) { aRequiresWidget = PR_TRUE; return NS_OK; } -NS_IMETHODIMP nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight) +NS_IMETHODIMP +nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight) { mSuggestedWidth = aWidth; mSuggestedHeight = aHeight; return NS_OK; } - diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.h b/mozilla/layout/html/forms/src/nsFormControlFrame.h index 847bd3666c7..32f65bc5794 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.h +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.h @@ -134,7 +134,7 @@ public: nscoord& aWidth, nscoord& aHeight); virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE); - + virtual void ScrollIntoView(nsIPresContext* aPresContext); virtual void Reset(); virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter); diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index cfb6a2f044d..93159516afb 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -270,6 +270,18 @@ nsHTMLButtonControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { } +void +nsHTMLButtonControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + void nsHTMLButtonControlFrame::GetTranslatedRect(nsRect& aRect) { diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h index e8c5a3c3884..3ca00c4b2b1 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h @@ -114,6 +114,7 @@ public: virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; } void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); diff --git a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp index 26cba786ba3..029958f60d4 100644 --- a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp @@ -100,6 +100,7 @@ public: virtual void Reset() {}; void SetFocus(PRBool aOn, PRBool aRepaint); + void ScrollIntoView(nsIPresContext* aPresContext); NS_IMETHOD GetFont(nsIPresContext* aPresContext, nsFont& aFont); @@ -276,6 +277,18 @@ nsImageControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) }*/ } +void +nsImageControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + void nsImageControlFrame::GetTranslatedRect(nsRect& aRect) { diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index f68817e3478..5030518c4df 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -1463,6 +1463,19 @@ nsListControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) // XXX:TODO Make set focus work } +//--------------------------------------------------------- +void +nsListControlFrame::ScrollIntoView(nsIPresContext* aPresContext) +{ + if (aPresContext) { + nsCOMPtr presShell; + aPresContext->GetShell(getter_AddRefs(presShell)); + presShell->ScrollFrameIntoView(this, + NS_PRESSHELL_SCROLL_ANYWHERE,NS_PRESSHELL_SCROLL_ANYWHERE); + + } +} + //--------------------------------------------------------- NS_IMETHODIMP diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.h b/mozilla/layout/html/forms/src/nsListControlFrame.h index 5a293c26074..5f65cd74e51 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.h +++ b/mozilla/layout/html/forms/src/nsListControlFrame.h @@ -78,6 +78,7 @@ public: NS_IMETHOD GetFormContent(nsIContent*& aContent) const; virtual void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE); + virtual void ScrollIntoView(nsIPresContext* aPresContext); virtual void MouseClicked(nsIPresContext* aPresContext); virtual void Reset(); virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);