diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index d08bfe567fa..3571810b191 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -29,7 +29,6 @@ #include "nsHTMLParts.h" #include "nsIFormControl.h" #include "nsINameSpaceManager.h" -#include "nsIDOMEventReceiver.h" #include "nsLayoutAtoms.h" #include "nsIDOMElement.h" #include "nsListControlFrame.h" @@ -116,13 +115,6 @@ nsComboboxControlFrame::nsComboboxControlFrame() //-------------------------------------------------------------- nsComboboxControlFrame::~nsComboboxControlFrame() { - // get the reciever interface from the browser button's content node - nsCOMPtr reciever(do_QueryInterface(mButtonContent)); - reciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - - nsCOMPtr displayReciever(do_QueryInterface(mDisplayContent)); - displayReciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; @@ -148,9 +140,6 @@ nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) } else if (aIID.Equals(kIFormControlFrameIID)) { *aInstancePtr = (void*) ((nsIFormControlFrame*) this); return NS_OK; - } else if (aIID.Equals(kIDOMMouseListenerIID)) { - *aInstancePtr = (void*)(nsIDOMMouseListener*) this; - return NS_OK; } else if (aIID.Equals(kIAnonymousContentCreatorIID)) { *aInstancePtr = (void*)(nsIAnonymousContentCreator*) this; return NS_OK; @@ -538,6 +527,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, // the display and button heights. nsresult rv = NS_OK; nsIFrame* dropdownFrame = GetDropdownFrame(); + nscoord dropdownYOffset = aHeight; // XXX: Enable this code to debug popping up above the display frame, rather than below it nsRect dropdownRect; @@ -752,7 +742,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, PRBool saveMES = aDesiredSize.maxElementSize != nsnull; nsSize * maxElementSize = nsnull; if (saveMES) { - maxElementSize = new nsSize(*aDesiredSize.maxElementSize); + maxElementSize = new nsSize(); + //maxElementSize = new nsSize(*aDesiredSize.maxElementSize); } nsHTMLReflowMetrics dropdownDesiredSize(maxElementSize); ReflowComboChildFrame(dropdownFrame, aPresContext, dropdownDesiredSize, firstPassState, aStatus, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); @@ -789,7 +780,6 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, } else { // A width has been specified for the select. // Make the display frame's width + button frame width = the width specified. - nsHTMLReflowMetrics dropdownDesiredSize(aDesiredSize); ReflowComboChildFrame(dropdownFrame, aPresContext, dropdownDesiredSize, firstPassState, aStatus, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); // Get unconstrained size of the dropdown list. @@ -920,23 +910,6 @@ nsComboboxControlFrame::GetFrameName(nsString& aResult) const #endif -//---------------------------------------------------------------------- -// nsIDOMMouseListener -//---------------------------------------------------------------------- -nsresult -nsComboboxControlFrame::MouseDown(nsIDOMEvent* aMouseEvent) -{ - /*PRBool isDroppedDown; - IsDroppedDown(&isDroppedDown); - if (isDroppedDown) { - ShowDropDown(!isDroppedDown); - if (isDroppedDown) { - mListControlFrame->CaptureMouseEvents(PR_FALSE); - } - }*/ - return NS_OK; -} - //---------------------------------------------------------------------- // nsIComboboxControlFrame //---------------------------------------------------------------------- @@ -948,9 +921,20 @@ nsComboboxControlFrame::ShowDropDown(PRBool aDoDropDown) } if (!mDroppedDown && aDoDropDown) { + // XXX Temporary for Bug 19416 + nsIFrame* dropdownFrame = GetDropdownFrame(); + nsIView * lstView; + dropdownFrame->GetView(mPresContext, &lstView); + if (lstView) { + lstView->IgnoreSetPosition(PR_FALSE); + } if (mListControlFrame) { mListControlFrame->SyncViewWithFrame(mPresContext); } + // XXX Temporary for Bug 19416 + if (lstView) { + lstView->IgnoreSetPosition(PR_TRUE); + } ToggleList(mPresContext); return NS_OK; } else if (mDroppedDown && !aDoDropDown) { @@ -1260,22 +1244,6 @@ nsComboboxControlFrame::CreateAnonymousContent(nsISupportsArray& aChildList) NS_RELEASE(tag); - // get the reciever interface from the browser button's content node - nsCOMPtr reciever(do_QueryInterface(mButtonContent)); - - // we shouldn't have to unregister this listener because when - // our frame goes away all these content node go away as well - // because our frame is the only one who references them. - reciever->AddEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - - // get the reciever interface from the browser button's content node - nsCOMPtr displayReciever(do_QueryInterface(mDisplayContent)); - - // we shouldn't have to unregister this listener because when - // our frame goes away all these content node go away as well - // because our frame is the only one who references them. - displayReciever->AddEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - return NS_OK; } @@ -1352,13 +1320,6 @@ nsComboboxControlFrame::GetSkipSides() const } -/*nsresult -nsComboboxControlFrame::HandleEvent(nsIDOMEvent* aEvent) -{ - ToggleList(mPresContext); - return NS_OK; -}*/ - //---------------------------------------------------------------------- //nsIRollupListener //---------------------------------------------------------------------- diff --git a/mozilla/layout/forms/nsComboboxControlFrame.h b/mozilla/layout/forms/nsComboboxControlFrame.h index 7ac651d1810..d50e2323fe4 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.h +++ b/mozilla/layout/forms/nsComboboxControlFrame.h @@ -27,7 +27,6 @@ #include "nsAreaFrame.h" #include "nsIFormControlFrame.h" #include "nsIComboboxControlFrame.h" -#include "nsIDOMMouseListener.h" #include "nsVoidArray.h" #include "nsIAnonymousContentCreator.h" #include "nsISelectControlFrame.h" @@ -51,7 +50,6 @@ class nsIListControlFrame; class nsComboboxControlFrame : public nsAreaFrame, public nsIFormControlFrame, public nsIComboboxControlFrame, - public nsIDOMMouseListener, public nsIAnonymousContentCreator, public nsISelectControlFrame, public nsIStatefulFrame, @@ -153,15 +151,6 @@ public: NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue); NS_IMETHOD DoneAddingContent(PRBool aIsDone); - //nsIDOMEventListener - virtual nsresult MouseDown(nsIDOMEvent* aMouseEvent); - virtual nsresult MouseUp(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseDblClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseOver(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseOut(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; } - //nsIStatefulFrame NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType); NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState); diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index d08bfe567fa..3571810b191 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -29,7 +29,6 @@ #include "nsHTMLParts.h" #include "nsIFormControl.h" #include "nsINameSpaceManager.h" -#include "nsIDOMEventReceiver.h" #include "nsLayoutAtoms.h" #include "nsIDOMElement.h" #include "nsListControlFrame.h" @@ -116,13 +115,6 @@ nsComboboxControlFrame::nsComboboxControlFrame() //-------------------------------------------------------------- nsComboboxControlFrame::~nsComboboxControlFrame() { - // get the reciever interface from the browser button's content node - nsCOMPtr reciever(do_QueryInterface(mButtonContent)); - reciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - - nsCOMPtr displayReciever(do_QueryInterface(mDisplayContent)); - displayReciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; @@ -148,9 +140,6 @@ nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) } else if (aIID.Equals(kIFormControlFrameIID)) { *aInstancePtr = (void*) ((nsIFormControlFrame*) this); return NS_OK; - } else if (aIID.Equals(kIDOMMouseListenerIID)) { - *aInstancePtr = (void*)(nsIDOMMouseListener*) this; - return NS_OK; } else if (aIID.Equals(kIAnonymousContentCreatorIID)) { *aInstancePtr = (void*)(nsIAnonymousContentCreator*) this; return NS_OK; @@ -538,6 +527,7 @@ nsComboboxControlFrame::PositionDropdown(nsIPresContext* aPresContext, // the display and button heights. nsresult rv = NS_OK; nsIFrame* dropdownFrame = GetDropdownFrame(); + nscoord dropdownYOffset = aHeight; // XXX: Enable this code to debug popping up above the display frame, rather than below it nsRect dropdownRect; @@ -752,7 +742,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, PRBool saveMES = aDesiredSize.maxElementSize != nsnull; nsSize * maxElementSize = nsnull; if (saveMES) { - maxElementSize = new nsSize(*aDesiredSize.maxElementSize); + maxElementSize = new nsSize(); + //maxElementSize = new nsSize(*aDesiredSize.maxElementSize); } nsHTMLReflowMetrics dropdownDesiredSize(maxElementSize); ReflowComboChildFrame(dropdownFrame, aPresContext, dropdownDesiredSize, firstPassState, aStatus, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); @@ -789,7 +780,6 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, } else { // A width has been specified for the select. // Make the display frame's width + button frame width = the width specified. - nsHTMLReflowMetrics dropdownDesiredSize(aDesiredSize); ReflowComboChildFrame(dropdownFrame, aPresContext, dropdownDesiredSize, firstPassState, aStatus, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); // Get unconstrained size of the dropdown list. @@ -920,23 +910,6 @@ nsComboboxControlFrame::GetFrameName(nsString& aResult) const #endif -//---------------------------------------------------------------------- -// nsIDOMMouseListener -//---------------------------------------------------------------------- -nsresult -nsComboboxControlFrame::MouseDown(nsIDOMEvent* aMouseEvent) -{ - /*PRBool isDroppedDown; - IsDroppedDown(&isDroppedDown); - if (isDroppedDown) { - ShowDropDown(!isDroppedDown); - if (isDroppedDown) { - mListControlFrame->CaptureMouseEvents(PR_FALSE); - } - }*/ - return NS_OK; -} - //---------------------------------------------------------------------- // nsIComboboxControlFrame //---------------------------------------------------------------------- @@ -948,9 +921,20 @@ nsComboboxControlFrame::ShowDropDown(PRBool aDoDropDown) } if (!mDroppedDown && aDoDropDown) { + // XXX Temporary for Bug 19416 + nsIFrame* dropdownFrame = GetDropdownFrame(); + nsIView * lstView; + dropdownFrame->GetView(mPresContext, &lstView); + if (lstView) { + lstView->IgnoreSetPosition(PR_FALSE); + } if (mListControlFrame) { mListControlFrame->SyncViewWithFrame(mPresContext); } + // XXX Temporary for Bug 19416 + if (lstView) { + lstView->IgnoreSetPosition(PR_TRUE); + } ToggleList(mPresContext); return NS_OK; } else if (mDroppedDown && !aDoDropDown) { @@ -1260,22 +1244,6 @@ nsComboboxControlFrame::CreateAnonymousContent(nsISupportsArray& aChildList) NS_RELEASE(tag); - // get the reciever interface from the browser button's content node - nsCOMPtr reciever(do_QueryInterface(mButtonContent)); - - // we shouldn't have to unregister this listener because when - // our frame goes away all these content node go away as well - // because our frame is the only one who references them. - reciever->AddEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - - // get the reciever interface from the browser button's content node - nsCOMPtr displayReciever(do_QueryInterface(mDisplayContent)); - - // we shouldn't have to unregister this listener because when - // our frame goes away all these content node go away as well - // because our frame is the only one who references them. - displayReciever->AddEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID); - return NS_OK; } @@ -1352,13 +1320,6 @@ nsComboboxControlFrame::GetSkipSides() const } -/*nsresult -nsComboboxControlFrame::HandleEvent(nsIDOMEvent* aEvent) -{ - ToggleList(mPresContext); - return NS_OK; -}*/ - //---------------------------------------------------------------------- //nsIRollupListener //---------------------------------------------------------------------- diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h index 7ac651d1810..d50e2323fe4 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h @@ -27,7 +27,6 @@ #include "nsAreaFrame.h" #include "nsIFormControlFrame.h" #include "nsIComboboxControlFrame.h" -#include "nsIDOMMouseListener.h" #include "nsVoidArray.h" #include "nsIAnonymousContentCreator.h" #include "nsISelectControlFrame.h" @@ -51,7 +50,6 @@ class nsIListControlFrame; class nsComboboxControlFrame : public nsAreaFrame, public nsIFormControlFrame, public nsIComboboxControlFrame, - public nsIDOMMouseListener, public nsIAnonymousContentCreator, public nsISelectControlFrame, public nsIStatefulFrame, @@ -153,15 +151,6 @@ public: NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue); NS_IMETHOD DoneAddingContent(PRBool aIsDone); - //nsIDOMEventListener - virtual nsresult MouseDown(nsIDOMEvent* aMouseEvent); - virtual nsresult MouseUp(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseDblClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseOver(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult MouseOut(nsIDOMEvent* aMouseEvent) { return NS_OK; } - virtual nsresult HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; } - //nsIStatefulFrame NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType); NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsISupports** aState);