зеркало из https://github.com/mozilla/pjs.git
Land bug 72747 in pieces: use CSS instead of C++ to ensure single line text inputs don't have scrollbars. b=72747 r+sr=roc
This commit is contained in:
Родитель
addb69cbb7
Коммит
462cb0cabd
|
@ -105,15 +105,6 @@ public:
|
|||
|
||||
NS_IMETHOD GetScrollableView(nsPresContext* aContext, nsIScrollableView** aResult)=0;
|
||||
|
||||
|
||||
/**
|
||||
* Set information about whether the vertical and horizontal scrollbars
|
||||
* are currently visible
|
||||
*/
|
||||
NS_IMETHOD SetScrollbarVisibility(nsPresContext* aPresContext,
|
||||
PRBool aVerticalVisible,
|
||||
PRBool aHorizontalVisible) = 0;
|
||||
|
||||
NS_IMETHOD GetScrollbarBox(PRBool aVertical, nsIBox** aResult) = 0;
|
||||
|
||||
NS_IMETHOD CurPosAttributeChanged(nsPresContext* aPresContext,
|
||||
|
|
|
@ -1876,7 +1876,7 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// make sure the the form registers itself on the initial/first reflow
|
||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
|
||||
nsFormControlFrame::RegUnRegAccessKey(aPresContext, this, PR_TRUE);
|
||||
mNotifyOnInput = PR_TRUE;//its ok to notify now. all has been prepared.
|
||||
}
|
||||
|
||||
|
@ -2996,16 +2996,6 @@ nsTextControlFrame::SetInitialChildList(nsPresContext* aPresContext,
|
|||
// than descending from the root frame of the frame hierarchy.
|
||||
first->AddStateBits(NS_FRAME_REFLOW_ROOT);
|
||||
|
||||
//we must turn off scrollbars for singleline text controls
|
||||
if (IsSingleLineTextControl())
|
||||
{
|
||||
nsIScrollableFrame *scrollableFrame = nsnull;
|
||||
if (first)
|
||||
first->QueryInterface(NS_GET_IID(nsIScrollableFrame), (void **) &scrollableFrame);
|
||||
if (scrollableFrame)
|
||||
scrollableFrame->SetScrollbarVisibility(aPresContext,PR_FALSE,PR_FALSE);
|
||||
}
|
||||
|
||||
//register keylistener
|
||||
nsCOMPtr<nsIDOMEventReceiver> erP;
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP))) && erP)
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
#include "nsIScrollbarFrame.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
@ -1275,17 +1274,6 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsISupportsArray& aAnonymousChildr
|
|||
if (shell)
|
||||
document = shell->GetDocument();
|
||||
|
||||
// The anonymous <div> used by <inputs> never gets scrollbars.
|
||||
nsCOMPtr<nsITextControlFrame> textFrame(do_QueryInterface(parent));
|
||||
if (textFrame) {
|
||||
// Make sure we are not a text area.
|
||||
nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent()));
|
||||
if (!textAreaElement) {
|
||||
mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// create horizontal scrollbar
|
||||
if (!document) {
|
||||
return;
|
||||
|
|
|
@ -105,15 +105,6 @@ public:
|
|||
|
||||
NS_IMETHOD GetScrollableView(nsPresContext* aContext, nsIScrollableView** aResult)=0;
|
||||
|
||||
|
||||
/**
|
||||
* Set information about whether the vertical and horizontal scrollbars
|
||||
* are currently visible
|
||||
*/
|
||||
NS_IMETHOD SetScrollbarVisibility(nsPresContext* aPresContext,
|
||||
PRBool aVerticalVisible,
|
||||
PRBool aHorizontalVisible) = 0;
|
||||
|
||||
NS_IMETHOD GetScrollbarBox(PRBool aVertical, nsIBox** aResult) = 0;
|
||||
|
||||
NS_IMETHOD CurPosAttributeChanged(nsPresContext* aPresContext,
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
#include "nsIScrollbarFrame.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
@ -1275,17 +1274,6 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsISupportsArray& aAnonymousChildr
|
|||
if (shell)
|
||||
document = shell->GetDocument();
|
||||
|
||||
// The anonymous <div> used by <inputs> never gets scrollbars.
|
||||
nsCOMPtr<nsITextControlFrame> textFrame(do_QueryInterface(parent));
|
||||
if (textFrame) {
|
||||
// Make sure we are not a text area.
|
||||
nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent()));
|
||||
if (!textAreaElement) {
|
||||
mNeverHasVerticalScrollbar = mNeverHasHorizontalScrollbar = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// create horizontal scrollbar
|
||||
if (!document) {
|
||||
return;
|
||||
|
|
|
@ -244,10 +244,6 @@ public:
|
|||
NS_IMETHOD GetScrollPosition(nsPresContext* aContext, nscoord &aX, nscoord& aY) const;
|
||||
NS_IMETHOD ScrollTo(nsPresContext* aContext, nscoord aX, nscoord aY, PRUint32 aFlags);
|
||||
|
||||
NS_IMETHOD SetScrollbarVisibility(nsPresContext* aPresContext,
|
||||
PRBool aVerticalVisible,
|
||||
PRBool aHorizontalVisible);
|
||||
|
||||
NS_IMETHOD GetScrollbarBox(PRBool aVertical, nsIBox** aResult);
|
||||
|
||||
NS_IMETHOD CurPosAttributeChanged(nsPresContext* aPresContext,
|
||||
|
@ -377,10 +373,6 @@ public:
|
|||
NS_IMETHOD GetScrollPosition(nsPresContext* aContext, nscoord &aX, nscoord& aY) const;
|
||||
NS_IMETHOD ScrollTo(nsPresContext* aContext, nscoord aX, nscoord aY, PRUint32 aFlags);
|
||||
|
||||
NS_IMETHOD SetScrollbarVisibility(nsPresContext* aPresContext,
|
||||
PRBool aVerticalVisible,
|
||||
PRBool aHorizontalVisible);
|
||||
|
||||
NS_IMETHOD GetScrollbarBox(PRBool aVertical, nsIBox** aResult);
|
||||
|
||||
NS_IMETHOD CurPosAttributeChanged(nsPresContext* aPresContext,
|
||||
|
|
|
@ -98,10 +98,6 @@ input {
|
|||
text-indent: 0;
|
||||
}
|
||||
|
||||
input > .anonymous-div {
|
||||
white-space : nowrap;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin: 1px 0 1px 0;
|
||||
border: 2px inset ThreeDFace;
|
||||
|
@ -136,6 +132,11 @@ input > .anonymous-div {
|
|||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
input > .anonymous-div {
|
||||
white-space : nowrap;
|
||||
overflow: hidden ! important;
|
||||
}
|
||||
|
||||
select {
|
||||
margin: 0;
|
||||
border-color: ThreeDFace;
|
||||
|
|
|
@ -1876,7 +1876,7 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// make sure the the form registers itself on the initial/first reflow
|
||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
|
||||
nsFormControlFrame::RegUnRegAccessKey(aPresContext, this, PR_TRUE);
|
||||
mNotifyOnInput = PR_TRUE;//its ok to notify now. all has been prepared.
|
||||
}
|
||||
|
||||
|
@ -2996,16 +2996,6 @@ nsTextControlFrame::SetInitialChildList(nsPresContext* aPresContext,
|
|||
// than descending from the root frame of the frame hierarchy.
|
||||
first->AddStateBits(NS_FRAME_REFLOW_ROOT);
|
||||
|
||||
//we must turn off scrollbars for singleline text controls
|
||||
if (IsSingleLineTextControl())
|
||||
{
|
||||
nsIScrollableFrame *scrollableFrame = nsnull;
|
||||
if (first)
|
||||
first->QueryInterface(NS_GET_IID(nsIScrollableFrame), (void **) &scrollableFrame);
|
||||
if (scrollableFrame)
|
||||
scrollableFrame->SetScrollbarVisibility(aPresContext,PR_FALSE,PR_FALSE);
|
||||
}
|
||||
|
||||
//register keylistener
|
||||
nsCOMPtr<nsIDOMEventReceiver> erP;
|
||||
if (NS_SUCCEEDED(mContent->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP))) && erP)
|
||||
|
|
|
@ -98,10 +98,6 @@ input {
|
|||
text-indent: 0;
|
||||
}
|
||||
|
||||
input > .anonymous-div {
|
||||
white-space : nowrap;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin: 1px 0 1px 0;
|
||||
border: 2px inset ThreeDFace;
|
||||
|
@ -136,6 +132,11 @@ input > .anonymous-div {
|
|||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
input > .anonymous-div {
|
||||
white-space : nowrap;
|
||||
overflow: hidden ! important;
|
||||
}
|
||||
|
||||
select {
|
||||
margin: 0;
|
||||
border-color: ThreeDFace;
|
||||
|
|
Загрузка…
Ссылка в новой задаче