Stop using nsAreaFrame for anything other than xul:label, which is the only thing for which it does anything different from nsBlockFrame, and rename it accordingly. (Bug 471356) r+sr=roc

--HG--
rename : layout/generic/nsAreaFrame.cpp => layout/xul/base/src/nsXULLabelFrame.cpp
rename : layout/generic/nsAreaFrame.h => layout/xul/base/src/nsXULLabelFrame.h
This commit is contained in:
L. David Baron 2008-12-29 10:07:38 -05:00
Родитель f2114f015e
Коммит 7f933168f7
25 изменённых файлов: 145 добавлений и 167 удалений

Просмотреть файл

@ -1482,7 +1482,6 @@ GK_ATOM(processingInstructionTagName, "#processing-instruction")
GK_ATOM(textTagName, "#text") GK_ATOM(textTagName, "#text")
// Frame types // Frame types
GK_ATOM(areaFrame, "AreaFrame")
GK_ATOM(bcTableCellFrame, "BCTableCellFrame") // table cell in border collapsing model GK_ATOM(bcTableCellFrame, "BCTableCellFrame") // table cell in border collapsing model
GK_ATOM(blockFrame, "BlockFrame") GK_ATOM(blockFrame, "BlockFrame")
GK_ATOM(boxFrame, "BoxFrame") GK_ATOM(boxFrame, "BoxFrame")
@ -1535,6 +1534,9 @@ GK_ATOM(tableRowFrame, "TableRowFrame")
GK_ATOM(textInputFrame,"TextInputFrame") GK_ATOM(textInputFrame,"TextInputFrame")
GK_ATOM(textFrame, "TextFrame") GK_ATOM(textFrame, "TextFrame")
GK_ATOM(viewportFrame, "ViewportFrame") GK_ATOM(viewportFrame, "ViewportFrame")
#ifdef MOZ_XUL
GK_ATOM(XULLabelFrame, "XULLabelFrame")
#endif
#ifdef MOZ_SVG #ifdef MOZ_SVG
GK_ATOM(svgAFrame, "SVGAFrame") GK_ATOM(svgAFrame, "SVGAFrame")
GK_ATOM(svgClipPathFrame, "SVGClipPathFrame") GK_ATOM(svgClipPathFrame, "SVGClipPathFrame")

Просмотреть файл

@ -1342,7 +1342,7 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
} }
// If the accesskey attribute is removed, unregister it here // If the accesskey attribute is removed, unregister it here
// Also see nsAreaFrame, nsBoxFrame and nsTextBoxFrame's AttributeChanged // Also see nsXULLabelFrame, nsBoxFrame and nsTextBoxFrame's AttributeChanged
if (aName == nsGkAtoms::accesskey || aName == nsGkAtoms::control) { if (aName == nsGkAtoms::accesskey || aName == nsGkAtoms::control) {
UnregisterAccessKey(oldValue); UnregisterAccessKey(oldValue);
} }

Просмотреть файл

@ -271,6 +271,7 @@ static FrameCtorDebugFlags gFlags[] = {
#include "nsPIListBoxObject.h" #include "nsPIListBoxObject.h"
#include "nsListBoxBodyFrame.h" #include "nsListBoxBodyFrame.h"
#include "nsListItemFrame.h" #include "nsListItemFrame.h"
#include "nsXULLabelFrame.h"
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -399,7 +400,7 @@ SVG_GetFirstNonAAncestorFrame(nsIFrame *aParentFrame)
#endif #endif
static inline nsIFrame* static inline nsIFrame*
GetFieldSetAreaFrame(nsIFrame* aFieldsetFrame) GetFieldSetBlockFrame(nsIFrame* aFieldsetFrame)
{ {
// Depends on the fieldset child frame order - see ConstructFieldSetFrame() below. // Depends on the fieldset child frame order - see ConstructFieldSetFrame() below.
nsIFrame* firstChild = aFieldsetFrame->GetFirstChild(nsnull); nsIFrame* firstChild = aFieldsetFrame->GetFirstChild(nsnull);
@ -4823,16 +4824,16 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
nsCSSAnonBoxes::buttonContent, nsCSSAnonBoxes::buttonContent,
aStyleContext); aStyleContext);
nsIFrame* areaFrame = NS_NewAreaFrame(mPresShell, styleContext, nsIFrame* blockFrame = NS_NewBlockFrame(mPresShell, styleContext,
NS_BLOCK_SPACE_MGR); NS_BLOCK_SPACE_MGR);
if (NS_UNLIKELY(!areaFrame)) { if (NS_UNLIKELY(!blockFrame)) {
buttonFrame->Destroy(); buttonFrame->Destroy();
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
rv = InitAndRestoreFrame(aState, aContent, buttonFrame, nsnull, areaFrame); rv = InitAndRestoreFrame(aState, aContent, buttonFrame, nsnull, blockFrame);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
areaFrame->Destroy(); blockFrame->Destroy();
buttonFrame->Destroy(); buttonFrame->Destroy();
return rv; return rv;
} }
@ -4840,7 +4841,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
rv = aState.AddChild(buttonFrame, aFrameItems, aContent, aStyleContext, rv = aState.AddChild(buttonFrame, aFrameItems, aContent, aStyleContext,
aParentFrame); aParentFrame);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
areaFrame->Destroy(); blockFrame->Destroy();
buttonFrame->Destroy(); buttonFrame->Destroy();
return rv; return rv;
} }
@ -4853,7 +4854,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
ShouldHaveSpecialBlockStyle(aContent, aStyleContext, ShouldHaveSpecialBlockStyle(aContent, aStyleContext,
&haveFirstLetterStyle, &haveFirstLineStyle); &haveFirstLetterStyle, &haveFirstLineStyle);
nsFrameConstructorSaveState floatSaveState; nsFrameConstructorSaveState floatSaveState;
aState.PushFloatContainingBlock(areaFrame, floatSaveState, aState.PushFloatContainingBlock(blockFrame, floatSaveState,
haveFirstLetterStyle, haveFirstLetterStyle,
haveFirstLineStyle); haveFirstLineStyle);
@ -4864,18 +4865,18 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
if (aStyleDisplay->IsPositioned()) { if (aStyleDisplay->IsPositioned()) {
// The area frame becomes a container for child frames that are // The area frame becomes a container for child frames that are
// absolutely positioned // absolutely positioned
aState.PushAbsoluteContainingBlock(areaFrame, absoluteSaveState); aState.PushAbsoluteContainingBlock(blockFrame, absoluteSaveState);
} }
rv = ProcessChildren(aState, aContent, areaFrame, PR_TRUE, childItems, rv = ProcessChildren(aState, aContent, blockFrame, PR_TRUE, childItems,
buttonFrame->GetStyleDisplay()->IsBlockOutside()); buttonFrame->GetStyleDisplay()->IsBlockOutside());
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
// Set the areas frame's initial child lists // Set the areas frame's initial child lists
areaFrame->SetInitialChildList(nsnull, childItems.childList); blockFrame->SetInitialChildList(nsnull, childItems.childList);
} }
buttonFrame->SetInitialChildList(nsnull, areaFrame); buttonFrame->SetInitialChildList(nsnull, blockFrame);
nsFrameItems anonymousChildItems; nsFrameItems anonymousChildItems;
// if there are any anonymous children create frames for them // if there are any anonymous children create frames for them
@ -4883,7 +4884,8 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
PR_FALSE, anonymousChildItems); PR_FALSE, anonymousChildItems);
if (anonymousChildItems.childList) { if (anonymousChildItems.childList) {
// the anonymous content is already parented to the area frame // the anonymous content is already parented to the area frame
aState.mFrameManager->AppendFrames(areaFrame, nsnull, anonymousChildItems.childList); aState.mFrameManager->AppendFrames(blockFrame, nsnull,
anonymousChildItems.childList);
} }
// our new button frame returned is the top frame. // our new button frame returned is the top frame.
@ -5164,9 +5166,10 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
nsCSSAnonBoxes::fieldsetContent, nsCSSAnonBoxes::fieldsetContent,
aStyleContext); aStyleContext);
nsIFrame* areaFrame = NS_NewAreaFrame(mPresShell, styleContext, nsIFrame* blockFrame = NS_NewBlockFrame(mPresShell, styleContext,
NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT); NS_BLOCK_SPACE_MGR |
InitAndRestoreFrame(aState, aContent, newFrame, nsnull, areaFrame); NS_BLOCK_MARGIN_ROOT);
InitAndRestoreFrame(aState, aContent, newFrame, nsnull, blockFrame);
nsresult rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext, nsresult rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext,
aParentFrame); aParentFrame);
@ -5180,7 +5183,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
ShouldHaveSpecialBlockStyle(aContent, aStyleContext, ShouldHaveSpecialBlockStyle(aContent, aStyleContext,
&haveFirstLetterStyle, &haveFirstLineStyle); &haveFirstLetterStyle, &haveFirstLineStyle);
nsFrameConstructorSaveState floatSaveState; nsFrameConstructorSaveState floatSaveState;
aState.PushFloatContainingBlock(areaFrame, floatSaveState, aState.PushFloatContainingBlock(blockFrame, floatSaveState,
haveFirstLetterStyle, haveFirstLetterStyle,
haveFirstLineStyle); haveFirstLineStyle);
@ -5191,10 +5194,10 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
if (aStyleDisplay->IsPositioned()) { if (aStyleDisplay->IsPositioned()) {
// The area frame becomes a container for child frames that are // The area frame becomes a container for child frames that are
// absolutely positioned // absolutely positioned
aState.PushAbsoluteContainingBlock(areaFrame, absoluteSaveState); aState.PushAbsoluteContainingBlock(blockFrame, absoluteSaveState);
} }
ProcessChildren(aState, aContent, areaFrame, PR_TRUE, ProcessChildren(aState, aContent, blockFrame, PR_TRUE,
childItems, PR_TRUE); childItems, PR_TRUE);
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID); static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
@ -5214,7 +5217,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
} else { } else {
childItems.childList = legendFrame->GetNextSibling(); childItems.childList = legendFrame->GetNextSibling();
} }
legendFrame->SetNextSibling(areaFrame); legendFrame->SetNextSibling(blockFrame);
legendFrame->SetParent(newFrame); legendFrame->SetParent(newFrame);
break; break;
} }
@ -5223,10 +5226,10 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
} }
// Set the scrolled frame's initial child lists // Set the scrolled frame's initial child lists
areaFrame->SetInitialChildList(nsnull, childItems.childList); blockFrame->SetInitialChildList(nsnull, childItems.childList);
// Set the scroll frame's initial child list // Set the scroll frame's initial child list
newFrame->SetInitialChildList(nsnull, legendFrame ? legendFrame : areaFrame); newFrame->SetInitialChildList(nsnull, legendFrame ? legendFrame : blockFrame);
// our new frame returned is the top frame which is the list frame. // our new frame returned is the top frame which is the list frame.
aNewFrame = newFrame; aNewFrame = newFrame;
@ -5885,8 +5888,15 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
(! aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value))) { (! aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value))) {
// XXX we should probably be calling ConstructBlock here to handle // XXX we should probably be calling ConstructBlock here to handle
// things like columns etc // things like columns etc
newFrame = NS_NewAreaFrame(mPresShell, aStyleContext, if (aTag == nsGkAtoms::label) {
NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT); newFrame = NS_NewXULLabelFrame(mPresShell, aStyleContext,
NS_BLOCK_SPACE_MGR |
NS_BLOCK_MARGIN_ROOT);
} else {
newFrame = NS_NewBlockFrame(mPresShell, aStyleContext,
NS_BLOCK_SPACE_MGR |
NS_BLOCK_MARGIN_ROOT);
}
} }
else { else {
newFrame = NS_NewTextBoxFrame(mPresShell, aStyleContext); newFrame = NS_NewTextBoxFrame(mPresShell, aStyleContext);
@ -6170,7 +6180,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
// that's why we call different things here. // that's why we call different things here.
nsIAtom* frameType = geometricParent->GetType(); nsIAtom* frameType = geometricParent->GetType();
if ((frameType == nsGkAtoms::blockFrame) || if ((frameType == nsGkAtoms::blockFrame) ||
(frameType == nsGkAtoms::areaFrame)) { (frameType == nsGkAtoms::XULLabelFrame)) {
*/ */
// See if we need to create a view, e.g. the frame is absolutely positioned // See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE); nsHTMLContainerFrame::CreateViewForFrame(newFrame, aParentFrame, PR_FALSE);
@ -6457,8 +6467,8 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
// Initialize it // Initialize it
// pass a temporary stylecontext, the correct one will be set later // pass a temporary stylecontext, the correct one will be set later
nsIFrame* scrolledFrame = nsIFrame* scrolledFrame =
NS_NewAreaFrame(mPresShell, aStyleContext, NS_NewBlockFrame(mPresShell, aStyleContext,
NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT); NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT);
nsFrameItems blockItem; nsFrameItems blockItem;
rv = ConstructBlock(aState, rv = ConstructBlock(aState,
@ -7738,14 +7748,16 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame)
for (nsIFrame* wrappedFrame = aFrame; wrappedFrame != frame->GetParent(); for (nsIFrame* wrappedFrame = aFrame; wrappedFrame != frame->GetParent();
wrappedFrame = wrappedFrame->GetParent()) { wrappedFrame = wrappedFrame->GetParent()) {
nsIAtom* frameType = wrappedFrame->GetType(); nsIAtom* frameType = wrappedFrame->GetType();
if (nsGkAtoms::areaFrame == frameType || if (nsGkAtoms::blockFrame == frameType ||
nsGkAtoms::blockFrame == frameType || #ifdef MOZ_XUL
nsGkAtoms::XULLabelFrame == frameType ||
#endif
nsGkAtoms::positionedInlineFrame == frameType) { nsGkAtoms::positionedInlineFrame == frameType) {
containingBlock = wrappedFrame; containingBlock = wrappedFrame;
} else if (nsGkAtoms::fieldSetFrame == frameType) { } else if (nsGkAtoms::fieldSetFrame == frameType) {
// If the positioned frame is a fieldset, use the area frame inside it. // If the positioned frame is a fieldset, use the area frame inside it.
// We don't use GetContentInsertionFrame for fieldsets yet. // We don't use GetContentInsertionFrame for fieldsets yet.
containingBlock = GetFieldSetAreaFrame(wrappedFrame); containingBlock = GetFieldSetBlockFrame(wrappedFrame);
} }
} }
@ -8158,7 +8170,7 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
} }
else if (nsGkAtoms::fieldSetFrame == parentType || else if (nsGkAtoms::fieldSetFrame == parentType ||
(nsGkAtoms::fieldSetFrame == grandparentType && (nsGkAtoms::fieldSetFrame == grandparentType &&
nsGkAtoms::areaFrame == parentType)) { nsGkAtoms::blockFrame == parentType)) {
// Legends can be sibling of legends but not of other content in the fieldset // Legends can be sibling of legends but not of other content in the fieldset
nsIAtom* sibType = aSibling->GetType(); nsIAtom* sibType = aSibling->GetType();
nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(aContent)); nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(aContent));
@ -8336,7 +8348,7 @@ GetAdjustedParentFrame(nsIFrame* aParentFrame,
// parent unless the new content is a legend. // parent unless the new content is a legend.
nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(childContent)); nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(childContent));
if (!legendContent) { if (!legendContent) {
newParent = GetFieldSetAreaFrame(aParentFrame); newParent = GetFieldSetBlockFrame(aParentFrame);
} }
} }
return (newParent) ? newParent : aParentFrame; return (newParent) ? newParent : aParentFrame;
@ -10404,15 +10416,16 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
} }
} else if (nsGkAtoms::areaFrame == frameType) { #ifdef MOZ_XUL
newFrame = NS_NewAreaFrame(shell, styleContext, 0); } else if (nsGkAtoms::XULLabelFrame == frameType) {
newFrame = NS_NewXULLabelFrame(shell, styleContext, 0);
if (newFrame) { if (newFrame) {
newFrame->Init(content, aParentFrame, aFrame); newFrame->Init(content, aParentFrame, aFrame);
// XXXbz should we be passing in a non-null aContentParentFrame? // XXXbz should we be passing in a non-null aContentParentFrame?
nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE); nsHTMLContainerFrame::CreateViewForFrame(newFrame, nsnull, PR_FALSE);
} }
#endif
} else if (nsGkAtoms::columnSetFrame == frameType) { } else if (nsGkAtoms::columnSetFrame == frameType) {
newFrame = NS_NewColumnSetFrame(shell, styleContext, 0); newFrame = NS_NewColumnSetFrame(shell, styleContext, 0);
@ -10498,8 +10511,8 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
// Create a continuing area frame // Create a continuing area frame
nsIFrame* continuingAreaFrame; nsIFrame* continuingAreaFrame;
nsIFrame* areaFrame = aFrame->GetFirstChild(nsnull); nsIFrame* blockFrame = aFrame->GetFirstChild(nsnull);
rv = CreateContinuingFrame(aPresContext, areaFrame, newFrame, rv = CreateContinuingFrame(aPresContext, blockFrame, newFrame,
&continuingAreaFrame); &continuingAreaFrame);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
newFrame->Destroy(); newFrame->Destroy();
@ -10570,8 +10583,8 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
// Create a continuing area frame // Create a continuing area frame
// XXXbz we really shouldn't have to do this by hand! // XXXbz we really shouldn't have to do this by hand!
nsIFrame* continuingAreaFrame; nsIFrame* continuingAreaFrame;
nsIFrame* areaFrame = GetFieldSetAreaFrame(aFrame); nsIFrame* blockFrame = GetFieldSetBlockFrame(aFrame);
rv = CreateContinuingFrame(aPresContext, areaFrame, newFrame, rv = CreateContinuingFrame(aPresContext, blockFrame, newFrame,
&continuingAreaFrame); &continuingAreaFrame);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
newFrame->Destroy(); newFrame->Destroy();

Просмотреть файл

@ -264,7 +264,7 @@ static PRInt32 gReflowInx = -1;
//------------------------------------------------------ //------------------------------------------------------
nsComboboxControlFrame::nsComboboxControlFrame(nsStyleContext* aContext) nsComboboxControlFrame::nsComboboxControlFrame(nsStyleContext* aContext)
: nsAreaFrame(aContext), : nsBlockFrame(aContext),
mDisplayWidth(0) mDisplayWidth(0)
{ {
mListControlFrame = nsnull; mListControlFrame = nsnull;
@ -316,7 +316,7 @@ nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_OK; return NS_OK;
} }
return nsAreaFrame::QueryInterface(aIID, aInstancePtr); return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
} }
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
@ -689,7 +689,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth; mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth;
nsresult rv = nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
aStatus); aStatus);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -968,7 +968,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
// nsFrame::HandleEvent so that selection takes place when appropriate. // nsFrame::HandleEvent so that selection takes place when appropriate.
const nsStyleUserInterface* uiStyle = GetStyleUserInterface(); const nsStyleUserInterface* uiStyle = GetStyleUserInterface();
if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED) if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED)
return nsAreaFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return nsBlockFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
return NS_OK; return NS_OK;
} }
@ -1245,7 +1245,7 @@ nsComboboxControlFrame::Destroy()
mPopupFrames.DestroyFrames(); mPopupFrames.DestroyFrames();
nsContentUtils::DestroyAnonymousContent(&mDisplayContent); nsContentUtils::DestroyAnonymousContent(&mDisplayContent);
nsContentUtils::DestroyAnonymousContent(&mButtonContent); nsContentUtils::DestroyAnonymousContent(&mButtonContent);
nsAreaFrame::Destroy(); nsBlockFrame::Destroy();
} }
@ -1255,7 +1255,7 @@ nsComboboxControlFrame::GetFirstChild(nsIAtom* aListName) const
if (nsGkAtoms::selectPopupList == aListName) { if (nsGkAtoms::selectPopupList == aListName) {
return mPopupFrames.FirstChild(); return mPopupFrames.FirstChild();
} }
return nsAreaFrame::GetFirstChild(aListName); return nsBlockFrame::GetFirstChild(aListName);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -1266,7 +1266,7 @@ nsComboboxControlFrame::SetInitialChildList(nsIAtom* aListName,
if (nsGkAtoms::selectPopupList == aListName) { if (nsGkAtoms::selectPopupList == aListName) {
mPopupFrames.SetFrames(aChildList); mPopupFrames.SetFrames(aChildList);
} else { } else {
rv = nsAreaFrame::SetInitialChildList(aListName, aChildList); rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
for (nsIFrame * child = aChildList; child; for (nsIFrame * child = aChildList; child;
child = child->GetNextSibling()) { child = child->GetNextSibling()) {
@ -1291,7 +1291,7 @@ nsComboboxControlFrame::GetAdditionalChildListName(PRInt32 aIndex) const
// of the combox's children because it would take up space, when it is suppose to // of the combox's children because it would take up space, when it is suppose to
// be floating above the display. // be floating above the display.
if (aIndex < NS_BLOCK_LIST_COUNT) { if (aIndex < NS_BLOCK_LIST_COUNT) {
return nsAreaFrame::GetAdditionalChildListName(aIndex); return nsBlockFrame::GetAdditionalChildListName(aIndex);
} }
if (NS_COMBO_FRAME_POPUP_LIST_INDEX == aIndex) { if (NS_COMBO_FRAME_POPUP_LIST_INDEX == aIndex) {
@ -1380,7 +1380,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} else { } else {
// REVIEW: Our in-flow child frames are inline-level so they will paint in our // REVIEW: Our in-flow child frames are inline-level so they will paint in our
// content list, so we don't need to mess with layers. // content list, so we don't need to mess with layers.
nsresult rv = nsAreaFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
} }

Просмотреть файл

@ -55,7 +55,7 @@
//Mark used to indicate when onchange has been fired for current combobox item //Mark used to indicate when onchange has been fired for current combobox item
#define NS_SKIP_NOTIFY_INDEX -2 #define NS_SKIP_NOTIFY_INDEX -2
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsIComboboxControlFrame.h" #include "nsIComboboxControlFrame.h"
#include "nsIAnonymousContentCreator.h" #include "nsIAnonymousContentCreator.h"
@ -80,7 +80,7 @@ class nsComboboxDisplayFrame;
*/ */
#define NS_COMBO_LIST_COUNT (NS_BLOCK_LIST_COUNT + 1) #define NS_COMBO_LIST_COUNT (NS_BLOCK_LIST_COUNT + 1)
class nsComboboxControlFrame : public nsAreaFrame, class nsComboboxControlFrame : public nsBlockFrame,
public nsIFormControlFrame, public nsIFormControlFrame,
public nsIComboboxControlFrame, public nsIComboboxControlFrame,
public nsIAnonymousContentCreator, public nsIAnonymousContentCreator,
@ -133,7 +133,7 @@ public:
virtual PRBool IsFrameOfType(PRUint32 aFlags) const virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{ {
return nsAreaFrame::IsFrameOfType(aFlags & return nsBlockFrame::IsFrameOfType(aFlags &
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
} }

Просмотреть файл

@ -88,7 +88,7 @@ NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
} }
nsFileControlFrame::nsFileControlFrame(nsStyleContext* aContext): nsFileControlFrame::nsFileControlFrame(nsStyleContext* aContext):
nsAreaFrame(aContext), nsBlockFrame(aContext),
mTextFrame(nsnull), mTextFrame(nsnull),
mCachedState(nsnull) mCachedState(nsnull)
{ {
@ -107,7 +107,7 @@ nsFileControlFrame::Init(nsIContent* aContent,
nsIFrame* aParent, nsIFrame* aParent,
nsIFrame* aPrevInFlow) nsIFrame* aPrevInFlow)
{ {
nsresult rv = nsAreaFrame::Init(aContent, aParent, aPrevInFlow); nsresult rv = nsBlockFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mMouseListener = new MouseListener(this); mMouseListener = new MouseListener(this);
@ -143,7 +143,7 @@ nsFileControlFrame::Destroy()
} }
mMouseListener->ForgetFrame(); mMouseListener->ForgetFrame();
nsAreaFrame::Destroy(); nsBlockFrame::Destroy();
} }
nsresult nsresult
@ -243,7 +243,7 @@ nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_OK; return NS_OK;
} }
return nsAreaFrame::QueryInterface(aIID, aInstancePtr); return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
} }
void void
@ -421,7 +421,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsPresContext* aPresContext,
} }
// The Areaframe takes care of all our reflow // The Areaframe takes care of all our reflow
return nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
aStatus); aStatus);
} }
@ -430,7 +430,7 @@ NS_IMETHODIMP
nsFileControlFrame::SetInitialChildList(nsIAtom* aListName, nsFileControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList) nsIFrame* aChildList)
{ {
nsAreaFrame::SetInitialChildList(aListName, aChildList); nsBlockFrame::SetInitialChildList(aListName, aChildList);
// given that the CSS frame constructor created all our frames. We need to find the text field // given that the CSS frame constructor created all our frames. We need to find the text field
// so we can get info from it. // so we can get info from it.
@ -514,7 +514,7 @@ nsFileControlFrame::AttributeChanged(PRInt32 aNameSpaceID,
} }
} }
return nsAreaFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType); return nsBlockFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
} }
PRBool PRBool
@ -578,7 +578,7 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// styles in forms.css) -- doing it just makes us look ugly in some cases and // styles in forms.css) -- doing it just makes us look ugly in some cases and
// has no effect in others. // has no effect in others.
nsDisplayListCollection tempList; nsDisplayListCollection tempList;
nsresult rv = nsAreaFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList); nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, tempList);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;

Просмотреть файл

@ -38,7 +38,7 @@
#ifndef nsFileControlFrame_h___ #ifndef nsFileControlFrame_h___
#define nsFileControlFrame_h___ #define nsFileControlFrame_h___
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsIDOMMouseListener.h" #include "nsIDOMMouseListener.h"
#include "nsIAnonymousContentCreator.h" #include "nsIAnonymousContentCreator.h"
@ -47,7 +47,7 @@
#include "nsTextControlFrame.h" #include "nsTextControlFrame.h"
typedef nsTextControlFrame nsNewFrame; typedef nsTextControlFrame nsNewFrame;
class nsFileControlFrame : public nsAreaFrame, class nsFileControlFrame : public nsBlockFrame,
public nsIFormControlFrame, public nsIFormControlFrame,
public nsIAnonymousContentCreator public nsIAnonymousContentCreator
{ {
@ -128,7 +128,7 @@ protected:
virtual PRBool IsFrameOfType(PRUint32 aFlags) const virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{ {
return nsAreaFrame::IsFrameOfType(aFlags & return nsBlockFrame::IsFrameOfType(aFlags &
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
} }

Просмотреть файл

@ -85,7 +85,7 @@ NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
} }
nsIsIndexFrame::nsIsIndexFrame(nsStyleContext* aContext) : nsIsIndexFrame::nsIsIndexFrame(nsStyleContext* aContext) :
nsAreaFrame(aContext) nsBlockFrame(aContext)
{ {
SetFlags(NS_BLOCK_SPACE_MGR); SetFlags(NS_BLOCK_SPACE_MGR);
} }
@ -105,10 +105,10 @@ nsIsIndexFrame::Destroy()
nsContentUtils::DestroyAnonymousContent(&mTextContent); nsContentUtils::DestroyAnonymousContent(&mTextContent);
nsContentUtils::DestroyAnonymousContent(&mPreHr); nsContentUtils::DestroyAnonymousContent(&mPreHr);
nsContentUtils::DestroyAnonymousContent(&mPostHr); nsContentUtils::DestroyAnonymousContent(&mPostHr);
nsAreaFrame::Destroy(); nsBlockFrame::Destroy();
} }
// REVIEW: We don't need to override BuildDisplayList, nsAreaFrame will honour // REVIEW: We don't need to override BuildDisplayList, nsBlockFrame will honour
// our visibility setting // our visibility setting
nsresult nsresult
@ -256,7 +256,7 @@ nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_OK; return NS_OK;
} }
return nsAreaFrame::QueryInterface(aIID, aInstancePtr); return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
} }
nscoord nscoord
@ -266,7 +266,7 @@ nsIsIndexFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
DISPLAY_MIN_WIDTH(this, result); DISPLAY_MIN_WIDTH(this, result);
// Our min width is our pref width; the rest of our reflow is // Our min width is our pref width; the rest of our reflow is
// happily handled by nsAreaFrame // happily handled by nsBlockFrame
result = GetPrefWidth(aRenderingContext); result = GetPrefWidth(aRenderingContext);
return result; return result;
} }
@ -286,7 +286,7 @@ nsIsIndexFrame::AttributeChanged(PRInt32 aNameSpaceID,
if (nsGkAtoms::prompt == aAttribute) { if (nsGkAtoms::prompt == aAttribute) {
rv = UpdatePromptLabel(PR_TRUE); rv = UpdatePromptLabel(PR_TRUE);
} else { } else {
rv = nsAreaFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType); rv = nsBlockFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
} }
return rv; return rv;
} }

Просмотреть файл

@ -38,7 +38,7 @@
#ifndef nsIsIndexFrame_h___ #ifndef nsIsIndexFrame_h___
#define nsIsIndexFrame_h___ #define nsIsIndexFrame_h___
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsIAnonymousContentCreator.h" #include "nsIAnonymousContentCreator.h"
#include "nsIStatefulFrame.h" #include "nsIStatefulFrame.h"
@ -48,7 +48,7 @@
#include "nsTextControlFrame.h" #include "nsTextControlFrame.h"
typedef nsTextControlFrame nsNewFrame; typedef nsTextControlFrame nsNewFrame;
class nsIsIndexFrame : public nsAreaFrame, class nsIsIndexFrame : public nsBlockFrame,
public nsIAnonymousContentCreator, public nsIAnonymousContentCreator,
public nsIDOMKeyListener, public nsIDOMKeyListener,
public nsIStatefulFrame public nsIStatefulFrame

Просмотреть файл

@ -74,7 +74,7 @@ void
nsLegendFrame::Destroy() nsLegendFrame::Destroy()
{ {
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), PR_FALSE); nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), PR_FALSE);
nsAreaFrame::Destroy(); nsBlockFrame::Destroy();
} }
// Frames are not refcounted, no need to AddRef // Frames are not refcounted, no need to AddRef
@ -88,7 +88,7 @@ nsLegendFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_OK; return NS_OK;
} }
return nsAreaFrame::QueryInterface(aIID, aInstancePtr); return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -102,10 +102,10 @@ nsLegendFrame::Reflow(nsPresContext* aPresContext,
if (mState & NS_FRAME_FIRST_REFLOW) { if (mState & NS_FRAME_FIRST_REFLOW) {
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), PR_TRUE); nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), PR_TRUE);
} }
return nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); return nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
} }
// REVIEW: We don't need to override BuildDisplayList, nsAreaFrame will honour // REVIEW: We don't need to override BuildDisplayList, nsBlockFrame will honour
// our visibility setting // our visibility setting
PRInt32 nsLegendFrame::GetAlign() PRInt32 nsLegendFrame::GetAlign()
{ {

Просмотреть файл

@ -38,7 +38,7 @@
#ifndef nsLegendFrame_h___ #ifndef nsLegendFrame_h___
#define nsLegendFrame_h___ #define nsLegendFrame_h___
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
@ -52,9 +52,9 @@ struct nsRect;
#define NS_LEGEND_FRAME_CID \ #define NS_LEGEND_FRAME_CID \
{ 0x73805d40, 0x5a24, 0x11d2, { 0x80, 0x46, 0x0, 0x60, 0x8, 0x15, 0xa7, 0x91 } } { 0x73805d40, 0x5a24, 0x11d2, { 0x80, 0x46, 0x0, 0x60, 0x8, 0x15, 0xa7, 0x91 } }
class nsLegendFrame : public nsAreaFrame { class nsLegendFrame : public nsBlockFrame {
public: public:
nsLegendFrame(nsStyleContext* aContext) : nsAreaFrame(aContext) {} nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

Просмотреть файл

@ -201,7 +201,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) const nsDisplayListSet& aLists)
{ {
nsresult rv = nsAreaFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsListControlFrame* listFrame = GetEnclosingListFrame(this); nsListControlFrame* listFrame = GetEnclosingListFrame(this);
@ -234,7 +234,7 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
nscoord oldHeight; nscoord oldHeight;
if (isInDropdownMode) { if (isInDropdownMode) {
// Store the height now in case it changes during // Store the height now in case it changes during
// nsAreaFrame::Reflow for some odd reason. // nsBlockFrame::Reflow for some odd reason.
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) { if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
oldHeight = GetSize().height; oldHeight = GetSize().height;
} else { } else {
@ -242,7 +242,7 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
} }
} }
nsresult rv = nsAreaFrame::Reflow(aPresContext, aDesiredSize, nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize,
aReflowState, aStatus); aReflowState, aStatus);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -37,16 +37,10 @@
#ifndef nsSelectsAreaFrame_h___ #ifndef nsSelectsAreaFrame_h___
#define nsSelectsAreaFrame_h___ #define nsSelectsAreaFrame_h___
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
class nsIContent; class nsIContent;
/** class nsSelectsAreaFrame : public nsBlockFrame
* The area frame has an additional named child list:
* - "Absolute-list" which contains the absolutely positioned frames
*
* @see nsGkAtoms::absoluteList
*/
class nsSelectsAreaFrame : public nsAreaFrame
{ {
public: public:
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32 aFlags); friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, PRUint32 aFlags);
@ -71,7 +65,7 @@ public:
protected: protected:
nsSelectsAreaFrame(nsStyleContext* aContext) : nsSelectsAreaFrame(nsStyleContext* aContext) :
nsAreaFrame(aContext), nsBlockFrame(aContext),
mHeightOfARow(0) mHeightOfARow(0)
{} {}

Просмотреть файл

@ -39,7 +39,7 @@
#define nsTextControlFrame_h___ #define nsTextControlFrame_h___
#include "nsStackFrame.h" #include "nsStackFrame.h"
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsIFormControlFrame.h" #include "nsIFormControlFrame.h"
#include "nsIDOMMouseListener.h" #include "nsIDOMMouseListener.h"
#include "nsIAnonymousContentCreator.h" #include "nsIAnonymousContentCreator.h"

Просмотреть файл

@ -112,7 +112,6 @@ endif
CPPSRCS = \ CPPSRCS = \
nsAbsoluteContainingBlock.cpp \ nsAbsoluteContainingBlock.cpp \
nsAreaFrame.cpp \
nsBRFrame.cpp \ nsBRFrame.cpp \
nsBlockBandData.cpp \ nsBlockBandData.cpp \
nsBlockFrame.cpp \ nsBlockFrame.cpp \

Просмотреть файл

@ -7325,7 +7325,6 @@ DR_FrameTypeInfo* DR_State::GetFrameTypeInfo(char* aFrameName)
void DR_State::InitFrameTypeTable() void DR_State::InitFrameTypeTable()
{ {
AddFrameTypeInfo(nsGkAtoms::areaFrame, "area", "area");
AddFrameTypeInfo(nsGkAtoms::blockFrame, "block", "block"); AddFrameTypeInfo(nsGkAtoms::blockFrame, "block", "block");
AddFrameTypeInfo(nsGkAtoms::brFrame, "br", "br"); AddFrameTypeInfo(nsGkAtoms::brFrame, "br", "br");
AddFrameTypeInfo(nsGkAtoms::bulletFrame, "bullet", "bullet"); AddFrameTypeInfo(nsGkAtoms::bulletFrame, "bullet", "bullet");
@ -7357,6 +7356,9 @@ void DR_State::InitFrameTypeTable()
AddFrameTypeInfo(nsGkAtoms::textInputFrame, "textCtl", "textInput"); AddFrameTypeInfo(nsGkAtoms::textInputFrame, "textCtl", "textInput");
AddFrameTypeInfo(nsGkAtoms::textFrame, "text", "text"); AddFrameTypeInfo(nsGkAtoms::textFrame, "text", "text");
AddFrameTypeInfo(nsGkAtoms::viewportFrame, "VP", "viewport"); AddFrameTypeInfo(nsGkAtoms::viewportFrame, "VP", "viewport");
#ifdef MOZ_XUL
AddFrameTypeInfo(nsGkAtoms::XULLabelFrame, "XULLabel", "XULLabel");
#endif
AddFrameTypeInfo(nsnull, "unknown", "unknown"); AddFrameTypeInfo(nsnull, "unknown", "unknown");
} }

Просмотреть файл

@ -82,9 +82,6 @@ class nsTableColFrame;
// Factory methods for creating html layout objects // Factory methods for creating html layout objects
// These are variations on AreaFrame with slightly different layout
// policies.
// Create a frame that supports "display: block" layout behavior // Create a frame that supports "display: block" layout behavior
nsIFrame* nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0); NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0);
@ -103,10 +100,6 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
nsIFrame* nsIFrame*
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags); NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// Create a basic area frame.
nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// These AreaFrame's shrink wrap around their contents // These AreaFrame's shrink wrap around their contents
inline nsIFrame* inline nsIFrame*
NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {

Просмотреть файл

@ -331,7 +331,9 @@ IsQuirkContainingBlockHeight(const nsHTMLReflowState* rs)
{ {
nsIAtom* frameType = rs->frame->GetType(); nsIAtom* frameType = rs->frame->GetType();
if (nsGkAtoms::blockFrame == frameType || if (nsGkAtoms::blockFrame == frameType ||
nsGkAtoms::areaFrame == frameType || #ifdef MOZ_XUL
nsGkAtoms::XULLabelFrame == frameType ||
#endif
nsGkAtoms::scrollFrame == frameType) { nsGkAtoms::scrollFrame == frameType) {
// Note: This next condition could change due to a style change, // Note: This next condition could change due to a style change,
// but that would cause a style reflow anyway, which means we're ok. // but that would cause a style reflow anyway, which means we're ok.
@ -1434,7 +1436,9 @@ CalcQuirkContainingBlockHeight(const nsHTMLReflowState* aCBReflowState)
// if the ancestor is auto height then skip it and continue up if it // if the ancestor is auto height then skip it and continue up if it
// is the first block/area frame and possibly the body/html // is the first block/area frame and possibly the body/html
if (nsGkAtoms::blockFrame == frameType || if (nsGkAtoms::blockFrame == frameType ||
nsGkAtoms::areaFrame == frameType || #ifdef MOZ_XUL
nsGkAtoms::XULLabelFrame == frameType ||
#endif
nsGkAtoms::scrollFrame == frameType) { nsGkAtoms::scrollFrame == frameType) {
secondAncestorRS = firstAncestorRS; secondAncestorRS = firstAncestorRS;

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsHTMLParts.h" #include "nsHTMLParts.h"
#include "nsFrame.h" #include "nsFrame.h"
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsLineLayout.h" #include "nsLineLayout.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"

Просмотреть файл

@ -38,7 +38,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsFrame.h" #include "nsFrame.h"
#include "nsAreaFrame.h" #include "nsBlockFrame.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
#include "nsStyleConsts.h" #include "nsStyleConsts.h"

Просмотреть файл

@ -123,6 +123,7 @@ CPPSRCS += \
nsListBoxBodyFrame.cpp \ nsListBoxBodyFrame.cpp \
nsListItemFrame.cpp \ nsListItemFrame.cpp \
nsListBoxLayout.cpp \ nsListBoxLayout.cpp \
nsXULLabelFrame.cpp \
nsXULPopupManager.cpp \ nsXULPopupManager.cpp \
$(NULL) $(NULL)

Просмотреть файл

@ -1865,7 +1865,7 @@ nsBoxFrame::CreateViewForFrame(nsPresContext* aPresContext,
} }
// If you make changes to this function, check its counterparts // If you make changes to this function, check its counterparts
// in nsTextBoxFrame and nsAreaFrame // in nsTextBoxFrame and nsXULLabelFrame
nsresult nsresult
nsBoxFrame::RegUnregAccessKey(PRBool aDoReg) nsBoxFrame::RegUnregAccessKey(PRBool aDoReg)
{ {

Просмотреть файл

@ -1100,7 +1100,7 @@ nsTextBoxFrame::GetFrameName(nsAString& aResult) const
#endif #endif
// If you make changes to this function, check its counterparts // If you make changes to this function, check its counterparts
// in nsBoxFrame and nsAreaFrame // in nsBoxFrame and nsXULLabelFrame
nsresult nsresult
nsTextBoxFrame::RegUnregAccessKey(PRBool aDoReg) nsTextBoxFrame::RegUnregAccessKey(PRBool aDoReg)
{ {

Просмотреть файл

@ -35,29 +35,17 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
/* derived class of nsBlockFrame; distinction barely relevant anymore */ /* derived class of nsBlockFrame used for xul:label elements */
#include "nsAreaFrame.h" #include "nsXULLabelFrame.h"
#include "nsBlockBandData.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsINodeInfo.h"
#include "nsGkAtoms.h"
#include "nsHTMLParts.h" #include "nsHTMLParts.h"
#ifdef MOZ_XUL
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsIEventStateManager.h" #include "nsIEventStateManager.h"
#endif
#undef NOISY_MAX_ELEMENT_SIZE
#undef NOISY_FINAL_SIZE
nsIFrame* nsIFrame*
NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags) NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
{ {
nsAreaFrame* it = new (aPresShell) nsAreaFrame(aContext); nsXULLabelFrame* it = new (aPresShell) nsXULLabelFrame(aContext);
if (it != nsnull) if (it != nsnull)
it->SetFlags(aFlags); it->SetFlags(aFlags);
@ -65,21 +53,15 @@ NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFl
return it; return it;
} }
#ifdef MOZ_XUL
// If you make changes to this function, check its counterparts // If you make changes to this function, check its counterparts
// in nsBoxFrame and nsTextBoxFrame // in nsBoxFrame and nsTextBoxFrame
nsresult nsresult
nsAreaFrame::RegUnregAccessKey(PRBool aDoReg) nsXULLabelFrame::RegUnregAccessKey(PRBool aDoReg)
{ {
// if we have no content, we can't do anything // if we have no content, we can't do anything
if (!mContent) if (!mContent)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
// only support accesskeys for the following elements
if (!mContent->NodeInfo()->Equals(nsGkAtoms::label, kNameSpaceID_XUL))
return NS_OK;
// To filter out <label>s without a control attribute. // To filter out <label>s without a control attribute.
// XXXjag a side-effect is that we filter out anonymous <label>s // XXXjag a side-effect is that we filter out anonymous <label>s
// in e.g. <menu>, <menuitem>, <button>. These <label>s inherit // in e.g. <menu>, <menuitem>, <button>. These <label>s inherit
@ -107,16 +89,14 @@ nsAreaFrame::RegUnregAccessKey(PRBool aDoReg)
return rv; return rv;
} }
#endif
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// nsIFrame // nsIFrame
#ifdef MOZ_XUL
NS_IMETHODIMP NS_IMETHODIMP
nsAreaFrame::Init(nsIContent* aContent, nsXULLabelFrame::Init(nsIContent* aContent,
nsIFrame* aParent, nsIFrame* aParent,
nsIFrame* aPrevInFlow) nsIFrame* aPrevInFlow)
{ {
nsresult rv = nsBlockFrame::Init(aContent, aParent, aPrevInFlow); nsresult rv = nsBlockFrame::Init(aContent, aParent, aPrevInFlow);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
@ -127,7 +107,7 @@ nsAreaFrame::Init(nsIContent* aContent,
} }
void void
nsAreaFrame::Destroy() nsXULLabelFrame::Destroy()
{ {
// unregister access key // unregister access key
RegUnregAccessKey(PR_FALSE); RegUnregAccessKey(PR_FALSE);
@ -135,9 +115,9 @@ nsAreaFrame::Destroy()
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAreaFrame::AttributeChanged(PRInt32 aNameSpaceID, nsXULLabelFrame::AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,
PRInt32 aModType) PRInt32 aModType)
{ {
nsresult rv = nsBlockFrame::AttributeChanged(aNameSpaceID, nsresult rv = nsBlockFrame::AttributeChanged(aNameSpaceID,
aAttribute, aModType); aAttribute, aModType);
@ -149,12 +129,11 @@ nsAreaFrame::AttributeChanged(PRInt32 aNameSpaceID,
return rv; return rv;
} }
#endif
nsIAtom* nsIAtom*
nsAreaFrame::GetType() const nsXULLabelFrame::GetType() const
{ {
return nsGkAtoms::areaFrame; return nsGkAtoms::XULLabelFrame;
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -162,8 +141,8 @@ nsAreaFrame::GetType() const
#ifdef NS_DEBUG #ifdef NS_DEBUG
NS_IMETHODIMP NS_IMETHODIMP
nsAreaFrame::GetFrameName(nsAString& aResult) const nsXULLabelFrame::GetFrameName(nsAString& aResult) const
{ {
return MakeFrameName(NS_LITERAL_STRING("Area"), aResult); return MakeFrameName(NS_LITERAL_STRING("XULLabel"), aResult);
} }
#endif #endif

Просмотреть файл

@ -35,32 +35,23 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
/* derived class of nsBlockFrame; distinction barely relevant anymore */ /* derived class of nsBlockFrame used for xul:label elements */
#ifndef nsAreaFrame_h___ #ifndef nsXULLabelFrame_h_
#define nsAreaFrame_h___ #define nsXULLabelFrame_h_
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "nsAbsoluteContainingBlock.h"
struct nsStyleDisplay; #ifndef MOZ_XUL
struct nsStylePosition; #error "This file should not be included
#endif
class nsXULLabelFrame : public nsBlockFrame
/**
* The area frame has an additional named child list:
* - "Absolute-list" which contains the absolutely positioned frames
*
* @see nsGkAtoms::absoluteList
*/
class nsAreaFrame : public nsBlockFrame
{ {
public: public:
friend nsIFrame* NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext *aContext, PRUint32 aFlags); friend nsIFrame* NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext *aContext, PRUint32 aFlags);
// nsIFrame // nsIFrame
#ifdef MOZ_XUL
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent, nsIFrame* aParent,
nsIFrame* aPrevInFlow); nsIFrame* aPrevInFlow);
@ -70,12 +61,11 @@ public:
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,
PRInt32 aModType); PRInt32 aModType);
#endif
/** /**
* Get the "type" of the frame * Get the "type" of the frame
* *
* @see nsGkAtoms::areaFrame * @see nsGkAtoms::XULLabelFrame
*/ */
virtual nsIAtom* GetType() const; virtual nsIAtom* GetType() const;
@ -84,11 +74,12 @@ public:
#endif #endif
protected: protected:
nsAreaFrame(nsStyleContext *aContext) : nsBlockFrame(aContext) {} nsXULLabelFrame(nsStyleContext *aContext) : nsBlockFrame(aContext) {}
#ifdef MOZ_XUL
nsresult RegUnregAccessKey(PRBool aDoReg); nsresult RegUnregAccessKey(PRBool aDoReg);
#endif
}; };
#endif /* nsAreaFrame_h___ */ nsIFrame*
NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
#endif /* !defined(nsXULLabelFrame_h_) */