зеркало из https://github.com/mozilla/gecko-dev.git
Add GetFrameForPoint to return the combobox when it is disabled. Added disabled code.
This commit is contained in:
Родитель
a2644affcd
Коммит
0701d68531
|
@ -636,8 +636,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIFrame* displayFrame = GetDisplayFrame(aPresContext);
|
||||
nsIFrame* dropdownFrame = GetDropdownFrame();
|
||||
|
||||
// Don't try to do any special sizing and positioning unless all of the frames
|
||||
// have been created.
|
||||
// Don't try to do any special sizing and positioning unless all of the frames
|
||||
// have been created.
|
||||
if ((nsnull == displayFrame) ||
|
||||
(nsnull == buttonFrame) ||
|
||||
(nsnull == dropdownFrame))
|
||||
|
@ -837,6 +837,18 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsComboboxControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
|
||||
{
|
||||
if (nsFormFrame::GetDisabled(this)) {
|
||||
*aFrame = this;
|
||||
return NS_OK;
|
||||
} else {
|
||||
return nsHTMLContainerFrame::GetFrameForPoint(aPoint, aFrame);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
|
@ -948,10 +960,8 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aEvent->message == NS_KEY_PRESS) {
|
||||
int x = 0;
|
||||
x++;
|
||||
if (nsFormFrame::GetDisabled(this)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -91,6 +91,8 @@ public:
|
|||
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom** aListName) const;
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
|
||||
|
||||
// nsIFormControlFrame
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD GetName(nsString* aName);
|
||||
|
|
|
@ -636,8 +636,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIFrame* displayFrame = GetDisplayFrame(aPresContext);
|
||||
nsIFrame* dropdownFrame = GetDropdownFrame();
|
||||
|
||||
// Don't try to do any special sizing and positioning unless all of the frames
|
||||
// have been created.
|
||||
// Don't try to do any special sizing and positioning unless all of the frames
|
||||
// have been created.
|
||||
if ((nsnull == displayFrame) ||
|
||||
(nsnull == buttonFrame) ||
|
||||
(nsnull == dropdownFrame))
|
||||
|
@ -837,6 +837,18 @@ nsComboboxControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValue
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsComboboxControlFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
|
||||
{
|
||||
if (nsFormFrame::GetDisabled(this)) {
|
||||
*aFrame = this;
|
||||
return NS_OK;
|
||||
} else {
|
||||
return nsHTMLContainerFrame::GetFrameForPoint(aPoint, aFrame);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
NS_IMETHODIMP
|
||||
|
@ -948,10 +960,8 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext& aPresContext,
|
|||
if (nsEventStatus_eConsumeNoDefault == aEventStatus) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aEvent->message == NS_KEY_PRESS) {
|
||||
int x = 0;
|
||||
x++;
|
||||
if (nsFormFrame::GetDisabled(this)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -91,6 +91,8 @@ public:
|
|||
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
||||
nsIAtom** aListName) const;
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
|
||||
|
||||
// nsIFormControlFrame
|
||||
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD GetName(nsString* aName);
|
||||
|
|
Загрузка…
Ссылка в новой задаче