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 bde356f1f5
commit 1fac9c6d76
14 changed files with 49 additions and 70 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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