Backing out changes for bug 326944, really this time\!

This commit is contained in:
roc+@cs.cmu.edu
2006-02-27 04:13:51 +00:00
parent 8f10cbef4b
commit 0efab978e0
14 changed files with 49 additions and 70 deletions

View File

@@ -57,7 +57,6 @@ REQUIRES = content \
locale \ locale \
necko \ necko \
string \ string \
webshell \
widget \ widget \
xpcom \ xpcom \
$(NULL) $(NULL)

View File

@@ -41,7 +41,7 @@
#include "nsIAccessibilityService.h" #include "nsIAccessibilityService.h"
#include "nsIAccessibleEvent.h" #include "nsIAccessibleEvent.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsComboboxControlFrame.h" #include "nsIComboboxControlFrame.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIDOMHTMLInputElement.h" #include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLOptGroupElement.h" #include "nsIDOMHTMLOptGroupElement.h"
@@ -632,8 +632,8 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsIFrame *selectFrame = presShell->GetPrimaryFrameFor(selectContent); nsIFrame *selectFrame = presShell->GetPrimaryFrameFor(selectContent);
nsComboboxControlFrame *comboBoxFrame; nsIComboboxControlFrame *comboBoxFrame = nsnull;
selectFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboBoxFrame); CallQueryInterface(selectFrame, &comboBoxFrame);
if (comboBoxFrame) { if (comboBoxFrame) {
nsIFrame *listFrame = comboBoxFrame->GetDropDown(); nsIFrame *listFrame = comboBoxFrame->GetDropDown();
if (comboBoxFrame->IsDroppedDown() && listFrame) { if (comboBoxFrame->IsDroppedDown() && listFrame) {
@@ -849,8 +849,8 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetState(PRUint32 *_retval)
nsAccessible::GetState(_retval); nsAccessible::GetState(_retval);
nsIFrame *frame = GetBoundsFrame(); nsIFrame *frame = GetBoundsFrame();
nsComboboxControlFrame *comboFrame; nsIComboboxControlFrame *comboFrame = nsnull;
frame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboFrame); frame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (comboFrame && comboFrame->IsDroppedDown()) if (comboFrame && comboFrame->IsDroppedDown())
*_retval |= STATE_EXPANDED; *_retval |= STATE_EXPANDED;
@@ -908,10 +908,7 @@ nsHTMLComboboxAccessible::GetFocusedOptionAccessible()
if (!mWeakShell) { if (!mWeakShell) {
return nsnull; // Shut down return nsnull; // Shut down
} }
nsCOMPtr<nsIComboboxControlFrame> cbxFrame = do_QueryInterface(GetFrame());
nsIFrame *frame = GetFrame();
nsComboboxControlFrame *cbxFrame;
frame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&cbxFrame);
if (!cbxFrame) { if (!cbxFrame) {
return nsnull; return nsnull;
} }
@@ -1127,8 +1124,8 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::DoAction(PRUint8 aIndex)
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& _retval) NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& _retval)
{ {
nsIFrame *boundsFrame = GetBoundsFrame(); nsIFrame *boundsFrame = GetBoundsFrame();
nsComboboxControlFrame* comboFrame; nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboFrame); boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) if (!comboFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@@ -1199,8 +1196,8 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetState(PRUint32 *_retval)
nsAccessible::GetState(_retval); nsAccessible::GetState(_retval);
nsIFrame *boundsFrame = GetBoundsFrame(); nsIFrame *boundsFrame = GetBoundsFrame();
nsComboboxControlFrame* comboFrame; nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboFrame); boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) if (!comboFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@@ -1266,8 +1263,8 @@ NS_IMETHODIMP nsHTMLComboboxListAccessible::GetState(PRUint32 *aState)
nsAccessible::GetState(aState); nsAccessible::GetState(aState);
nsIFrame *boundsFrame = GetBoundsFrame(); nsIFrame *boundsFrame = GetBoundsFrame();
nsComboboxControlFrame* comboFrame; nsIComboboxControlFrame* comboFrame = nsnull;
boundsFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboFrame); boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) if (!comboFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

View File

@@ -56,7 +56,7 @@
#include "nsHTMLAtoms.h" #include "nsHTMLAtoms.h"
#include "nsIEditorDocShell.h" #include "nsIEditorDocShell.h"
#include "nsIFormControl.h" #include "nsIFormControl.h"
#include "nsComboboxControlFrame.h" #include "nsIComboboxControlFrame.h"
#include "nsIDOMHTMLAnchorElement.h" #include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLInputElement.h" #include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNSHTMLInputElement.h" #include "nsIDOMNSHTMLInputElement.h"
@@ -1777,8 +1777,8 @@ nsEventStateManager::DoScrollText(nsPresContext* aPresContext,
passToParent = !canScroll; passToParent = !canScroll;
// Comboboxes need special care. // Comboboxes need special care.
nsComboboxControlFrame* comboBox; nsIComboboxControlFrame* comboBox = nsnull;
scrollFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboBox); CallQueryInterface(scrollFrame, &comboBox);
if (comboBox) { if (comboBox) {
if (comboBox->IsDroppedDown()) { if (comboBox->IsDroppedDown()) {
// Don't propagate to parent when drop down menu is active. // Don't propagate to parent when drop down menu is active.

View File

@@ -78,7 +78,7 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsComboboxControlFrame.h" #include "nsIComboboxControlFrame.h"
#include "nsIListControlFrame.h" #include "nsIListControlFrame.h"
#include "nsIFrame.h" #include "nsIFrame.h"
@@ -2035,8 +2035,8 @@ void nsHTMLSelectElement::DispatchContentReset() {
// Only dispatch content reset notification if this is a list control // Only dispatch content reset notification if this is a list control
// frame or combo box control frame. // frame or combo box control frame.
if (IsCombobox()) { if (IsCombobox()) {
nsComboboxControlFrame* comboFrame; nsIComboboxControlFrame* comboFrame = nsnull;
formControlFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboFrame); CallQueryInterface(formControlFrame, &comboFrame);
if (comboFrame) { if (comboFrame) {
comboFrame->OnContentReset(); comboFrame->OnContentReset();
} }

View File

@@ -93,8 +93,6 @@ EXPORTS = \
nsCSSFrameConstructor.h \ nsCSSFrameConstructor.h \
nsChangeHint.h \ nsChangeHint.h \
nsCompatibility.h \ nsCompatibility.h \
nsCounterManager.h \
nsGenConList.h \
nsFrameManager.h \ nsFrameManager.h \
nsFrameManagerBase.h \ nsFrameManagerBase.h \
nsFrameTraversal.h \ nsFrameTraversal.h \
@@ -113,7 +111,6 @@ EXPORTS = \
nsLayoutUtils.h \ nsLayoutUtils.h \
nsPresContext.h \ nsPresContext.h \
nsPresState.h \ nsPresState.h \
nsQuoteList.h \
nsStyleChangeList.h \ nsStyleChangeList.h \
nsStyleConsts.h \ nsStyleConsts.h \
$(NULL) $(NULL)

View File

@@ -72,7 +72,7 @@
#include "nsLayoutAtoms.h" #include "nsLayoutAtoms.h"
#include "nsIDOMHTMLSelectElement.h" #include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLLegendElement.h" #include "nsIDOMHTMLLegendElement.h"
#include "nsComboboxControlFrame.h" #include "nsIComboboxControlFrame.h"
#include "nsIListControlFrame.h" #include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h" #include "nsISelectControlFrame.h"
#include "nsIRadioControlFrame.h" #include "nsIRadioControlFrame.h"
@@ -5254,10 +5254,10 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// Combobox - Old Native Implementation // Combobox - Old Native Implementation
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
nsComboboxControlFrame* comboBox; nsIComboboxControlFrame* comboBox = nsnull;
comboboxFrame->QueryInterface(nsComboboxControlFrame::GetCID(), (void**)&comboBox); CallQueryInterface(comboboxFrame, &comboBox);
NS_ASSERTION(comboBox, "NS_NewComboboxControlFrame returned frame that " NS_ASSERTION(comboBox, "NS_NewComboboxControlFrame returned frame that "
"doesn't implement nsComboboxControlFrame"); "doesn't implement nsIComboboxControlFrame");
// Create a listbox // Create a listbox
nsIFrame* listFrame = NS_NewListControlFrame(mPresShell); nsIFrame* listFrame = NS_NewListControlFrame(mPresShell);

View File

@@ -75,7 +75,7 @@ REQUIRES = xpcom \
EXPORTS = \ EXPORTS = \
nsIListControlFrame.h \ nsIListControlFrame.h \
nsIImageControlFrame.h \ nsIImageControlFrame.h \
nsComboboxControlFrame.h \ nsIComboboxControlFrame.h \
nsIFormControlFrame.h \ nsIFormControlFrame.h \
nsIRadioControlFrame.h \ nsIRadioControlFrame.h \
nsICheckboxControlFrame.h \ nsICheckboxControlFrame.h \

View File

@@ -363,8 +363,8 @@ nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
if (aIID.Equals(GetCID())) { if (aIID.Equals(NS_GET_IID(nsIComboboxControlFrame))) {
*aInstancePtr = this; *aInstancePtr = (void*)(nsIComboboxControlFrame*)this;
return NS_OK; return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) { } else if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = (void*)(nsIFormControlFrame*)this; *aInstancePtr = (void*)(nsIFormControlFrame*)this;
@@ -1551,6 +1551,12 @@ nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame)
CallQueryInterface(mDropdownFrame, &mListControlFrame); CallQueryInterface(mDropdownFrame, &mListControlFrame);
} }
nsIFrame*
nsComboboxControlFrame::GetDropDown()
{
return mDropdownFrame;
}
// Toggle dropdown list. // Toggle dropdown list.
NS_IMETHODIMP NS_IMETHODIMP

View File

@@ -54,6 +54,7 @@
#include "nsAreaFrame.h" #include "nsAreaFrame.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIAnonymousContentCreator.h" #include "nsIAnonymousContentCreator.h"
#include "nsISelectControlFrame.h" #include "nsISelectControlFrame.h"
#include "nsIRollupListener.h" #include "nsIRollupListener.h"
@@ -75,11 +76,9 @@ class nsIScrollableView;
*/ */
#define NS_COMBO_FRAME_POPUP_LIST_INDEX (NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX + 1) #define NS_COMBO_FRAME_POPUP_LIST_INDEX (NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX + 1)
#define NS_COMBOBOX_CONTROL_FRAME_CID \
{ 0xa5df992a, 0xc832, 0x45b1, {0x8c, 0xc4, 0x00, 0x80, 0x4c, 0xba, 0xcf, 0xab}}
class nsComboboxControlFrame : public nsAreaFrame, class nsComboboxControlFrame : public nsAreaFrame,
public nsIFormControlFrame, public nsIFormControlFrame,
public nsIComboboxControlFrame,
public nsIAnonymousContentCreator, public nsIAnonymousContentCreator,
public nsISelectControlFrame, public nsISelectControlFrame,
public nsIRollupListener, public nsIRollupListener,
@@ -93,8 +92,6 @@ public:
nsComboboxControlFrame(); nsComboboxControlFrame();
~nsComboboxControlFrame(); ~nsComboboxControlFrame();
NS_DEFINE_STATIC_CID_ACCESSOR(NS_COMBOBOX_CONTROL_FRAME_CID)
// nsISupports // nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
@@ -149,16 +146,16 @@ public:
virtual void SetFocus(PRBool aOn, PRBool aRepaint); virtual void SetFocus(PRBool aOn, PRBool aRepaint);
//nsIComboboxControlFrame //nsIComboboxControlFrame
PRBool IsDroppedDown() { return mDroppedDown; } virtual PRBool IsDroppedDown() { return mDroppedDown; }
void ShowDropDown(PRBool aDoDropDown); virtual void ShowDropDown(PRBool aDoDropDown);
virtual nsIFrame* GetDropDown() { return mDropdownFrame; } virtual nsIFrame* GetDropDown();
void SetDropDown(nsIFrame* aDropDownFrame); virtual void SetDropDown(nsIFrame* aDropDownFrame);
void RollupFromList(); virtual void RollupFromList();
void AbsolutelyPositionDropDown(); virtual void AbsolutelyPositionDropDown();
PRInt32 GetIndexOfDisplayArea(); virtual PRInt32 GetIndexOfDisplayArea();
nsresult RedisplaySelectedText(); NS_IMETHOD RedisplaySelectedText();
PRInt32 UpdateRecentIndex(PRInt32 aIndex); virtual PRInt32 UpdateRecentIndex(PRInt32 aIndex);
void OnContentReset(); virtual void OnContentReset();
// nsISelectControlFrame // nsISelectControlFrame
NS_IMETHOD AddOption(nsPresContext* aPresContext, PRInt32 index); NS_IMETHOD AddOption(nsPresContext* aPresContext, PRInt32 index);

View File

@@ -1702,7 +1702,7 @@ nsListControlFrame::SetComboboxFrame(nsIFrame* aComboboxFrame)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
if (nsnull != aComboboxFrame) { if (nsnull != aComboboxFrame) {
rv = aComboboxFrame->QueryInterface(nsComboboxControlFrame::GetCID(),(void**) &mComboboxFrame); rv = aComboboxFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame),(void**) &mComboboxFrame);
} }
return rv; return rv;
} }

View File

@@ -60,7 +60,7 @@
class nsIDOMHTMLSelectElement; class nsIDOMHTMLSelectElement;
class nsIDOMHTMLOptionsCollection; class nsIDOMHTMLOptionsCollection;
class nsIDOMHTMLOptionElement; class nsIDOMHTMLOptionElement;
class nsComboboxControlFrame; class nsIComboboxControlFrame;
class nsIViewManager; class nsIViewManager;
class nsPresContext; class nsPresContext;
class nsVoidArray; class nsVoidArray;
@@ -256,7 +256,7 @@ protected:
PRInt32 mStartSelectionIndex; PRInt32 mStartSelectionIndex;
PRInt32 mEndSelectionIndex; PRInt32 mEndSelectionIndex;
nsComboboxControlFrame *mComboboxFrame; nsIComboboxControlFrame *mComboboxFrame;
nscoord mMaxWidth; nscoord mMaxWidth;
nscoord mMaxHeight; nscoord mMaxHeight;
PRInt32 mNumDisplayRows; PRInt32 mNumDisplayRows;

View File

@@ -84,15 +84,8 @@ REQUIRES += ctl
endif endif
EXPORTS = \ EXPORTS = \
nsAbsoluteContainingBlock.h \
nsAreaFrame.h \
nsBlockFrame.h \
nsContainerFrame.h \
nsFrame.h \
nsFrameList.h \ nsFrameList.h \
nsHTMLContainerFrame.h \
nsHTMLParts.h \ nsHTMLParts.h \
nsHTMLReflowCommand.h \
nsHTMLReflowMetrics.h \ nsHTMLReflowMetrics.h \
nsHTMLReflowState.h \ nsHTMLReflowState.h \
nsIAnonymousContentCreator.h \ nsIAnonymousContentCreator.h \
@@ -108,11 +101,7 @@ EXPORTS = \
nsIScrollableFrame.h \ nsIScrollableFrame.h \
nsIScrollableViewProvider.h \ nsIScrollableViewProvider.h \
nsIStatefulFrame.h \ nsIStatefulFrame.h \
nsLineBox.h \
nsPlaceholderFrame.h \
nsReflowPath.h \
nsReflowType.h \ nsReflowType.h \
nsSplittableFrame.h \
$(NULL) $(NULL)
ifdef IBMBIDI ifdef IBMBIDI

View File

@@ -38,7 +38,6 @@
#ifndef nsBlockFrame_h___ #ifndef nsBlockFrame_h___
#define nsBlockFrame_h___ #define nsBlockFrame_h___
#include "nsPresContext.h"
#include "nsHTMLContainerFrame.h" #include "nsHTMLContainerFrame.h"
#include "nsHTMLParts.h" #include "nsHTMLParts.h"
#include "nsAbsoluteContainingBlock.h" #include "nsAbsoluteContainingBlock.h"
@@ -256,14 +255,12 @@ protected:
nsBlockFrame(); nsBlockFrame();
virtual ~nsBlockFrame(); virtual ~nsBlockFrame();
#ifdef _IMPL_NS_LAYOUT
already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext) already_AddRefed<nsStyleContext> GetFirstLetterStyle(nsPresContext* aPresContext)
{ {
return aPresContext->StyleSet()-> return aPresContext->StyleSet()->
ProbePseudoStyleFor(mContent, ProbePseudoStyleFor(mContent,
nsCSSPseudoElements::firstLetter, mStyleContext); nsCSSPseudoElements::firstLetter, mStyleContext);
} }
#endif
/* /*
* Overides member function of nsHTMLContainerFrame. Needed to handle the * Overides member function of nsHTMLContainerFrame. Needed to handle the

View File

@@ -77,10 +77,7 @@ ifdef MOZ_XUL
DIRS = tree grid DIRS = tree grid
endif endif
EXPORTS = \ EXPORTS = nsIMenuParent.h
nsBox.h \
nsIMenuParent.h \
$(NULL)
CPPSRCS = \ CPPSRCS = \
nsScrollBoxFrame.cpp \ nsScrollBoxFrame.cpp \