summaryrefslogtreecommitdiff
path: root/layout/base/nsCSSFrameConstructor.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-10 23:09:26 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-01 14:47:16 +0200
commitddaee7c1be914cc28a28cbe27e5922215b3b2e6f (patch)
treecb8930a9ba1ed0ef574b7c2be9035b1a51201902 /layout/base/nsCSSFrameConstructor.cpp
parentc030a50228349fa1b2c0b4fbc2e83752324dd4d7 (diff)
downloaduxp-ddaee7c1be914cc28a28cbe27e5922215b3b2e6f.tar.gz
Issue #1830 - Remove --disable-xul config and conditionals.
Diffstat (limited to 'layout/base/nsCSSFrameConstructor.cpp')
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp70
1 files changed, 3 insertions, 67 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index df793c67f8..5b514a330b 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -94,9 +94,8 @@
#include "nsTransitionManager.h"
#include "DetailsFrame.h"
-#ifdef MOZ_XUL
#include "nsIRootBox.h"
-#endif
+
#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
#endif
@@ -208,8 +207,6 @@ static FrameCtorDebugFlags gFlags[] = {
#define NUM_DEBUG_FLAGS (sizeof(gFlags) / sizeof(gFlags[0]))
#endif
-
-#ifdef MOZ_XUL
#include "nsMenuFrame.h"
#include "nsPopupSetFrame.h"
#include "nsTreeColFrame.h"
@@ -291,9 +288,6 @@ NS_NewTitleBarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
NS_NewResizerFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
-
-#endif
-
nsHTMLScrollFrame*
NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot);
@@ -748,10 +742,8 @@ public:
nsIPresShell *mPresShell;
nsFrameManager *mFrameManager;
-#ifdef MOZ_XUL
// Frames destined for the kPopupList.
nsAbsoluteItems mPopupItems;
-#endif
// Containing block information for out-of-flow frames.
nsAbsoluteItems mFixedItems;
@@ -967,9 +959,7 @@ nsFrameConstructorState::nsFrameConstructorState(
: mPresContext(aPresShell->GetPresContext()),
mPresShell(aPresShell),
mFrameManager(aPresShell->FrameManager()),
-#ifdef MOZ_XUL
mPopupItems(nullptr),
-#endif
mFixedItems(aFixedContainingBlock),
mAbsoluteItems(aAbsoluteContainingBlock),
mFloatedItems(aFloatContainingBlock),
@@ -990,12 +980,10 @@ nsFrameConstructorState::nsFrameConstructorState(
aPresShell->GetDocument()),
mCurrentPendingBindingInsertionPoint(nullptr)
{
-#ifdef MOZ_XUL
nsIRootBox* rootBox = nsIRootBox::GetRootBox(aPresShell);
if (rootBox) {
mPopupItems.containingBlock = rootBox->GetPopupSetFrame();
}
-#endif
MOZ_COUNT_CTOR(nsFrameConstructorState);
}
@@ -1018,9 +1006,7 @@ nsFrameConstructorState::~nsFrameConstructorState()
ProcessFrameInsertions(mFloatedItems, nsIFrame::kFloatList);
ProcessFrameInsertions(mAbsoluteItems, nsIFrame::kAbsoluteList);
ProcessFrameInsertions(mFixedItems, nsIFrame::kFixedList);
-#ifdef MOZ_XUL
ProcessFrameInsertions(mPopupItems, nsIFrame::kPopupList);
-#endif
for (int32_t i = mGeneratedTextNodesWithInitializer.Count() - 1; i >= 0; --i) {
mGeneratedTextNodesWithInitializer[i]->
DeleteProperty(nsGkAtoms::genConInitializerProperty);
@@ -1164,13 +1150,11 @@ nsFrameConstructorState::GetOutOfFlowFrameItems(nsIFrame* aNewFrame,
bool aIsOutOfFlowPopup,
nsFrameState* aPlaceholderType)
{
-#ifdef MOZ_XUL
if (MOZ_UNLIKELY(aIsOutOfFlowPopup)) {
MOZ_ASSERT(mPopupItems.containingBlock, "Must have a popup set frame!");
*aPlaceholderType = PLACEHOLDER_FOR_POPUP;
return &mPopupItems;
}
-#endif // MOZ_XUL
if (aCanBeFloated && aNewFrame->IsFloating()) {
*aPlaceholderType = PLACEHOLDER_FOR_FLOAT;
return &mFloatedItems;
@@ -1315,15 +1299,10 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems,
((&aFrameItems == &mFixedItems || \
&aFrameItems == &mTopLayerFixedItems) && \
aChildListID == nsIFrame::kFixedList)
-#ifdef MOZ_XUL
NS_PRECONDITION(NS_NONXUL_LIST_TEST ||
(&aFrameItems == &mPopupItems &&
aChildListID == nsIFrame::kPopupList),
"Unexpected aFrameItems/aChildListID combination");
-#else
- NS_PRECONDITION(NS_NONXUL_LIST_TEST,
- "Unexpected aFrameItems/aChildListID combination");
-#endif
if (aFrameItems.IsEmpty()) {
return;
@@ -2525,7 +2504,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
nsFrameConstructorSaveState absoluteSaveState;
// Check whether we need to build a XUL box or SVG root frame
-#ifdef MOZ_XUL
if (aDocElement->IsXULElement()) {
contentFrame = NS_NewDocElementBoxFrame(mPresShell, styleContext);
InitAndRestoreFrame(state, aDocElement, mDocElementContainingBlock,
@@ -2534,7 +2512,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
processChildren = true;
}
else
-#endif
if (aDocElement->IsSVGElement()) {
if (!aDocElement->IsSVGElement(nsGkAtoms::svg)) {
return nullptr;
@@ -2803,13 +2780,11 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
nsIAtom* rootPseudo;
if (!isPaginated) {
-#ifdef MOZ_XUL
if (aDocElement->IsXULElement())
{
// pass a temporary stylecontext, the correct one will be set later
rootFrame = NS_NewRootBoxFrame(mPresShell, viewportPseudoStyle);
} else
-#endif
{
// pass a temporary stylecontext, the correct one will be set later
rootFrame = NS_NewCanvasFrame(mPresShell, viewportPseudoStyle);
@@ -3972,9 +3947,8 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
nsContainerFrame* newFrameAsContainer = do_QueryFrame(newFrame);
if (newFrameAsContainer) {
-#ifdef MOZ_XUL
- // Icky XUL stuff, sadly
+ // Icky XUL stuff, sadly
if (aItem.mIsRootPopupgroup) {
NS_ASSERTION(nsIRootBox::GetRootBox(mPresShell) &&
nsIRootBox::GetRootBox(mPresShell)->GetPopupSetFrame() ==
@@ -3983,7 +3957,6 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
aState.mPopupItems.containingBlock = newFrameAsContainer;
aState.mHavePendingPopupgroup = false;
}
-#endif /* MOZ_XUL */
// Process the child content if requested
nsFrameItems childItems;
@@ -4072,7 +4045,6 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
}
}
-#ifdef MOZ_XUL
// More icky XUL stuff
if (aItem.mNameSpaceID == kNameSpaceID_XUL &&
(aItem.mTag == nsGkAtoms::treechildren || // trees always need titletips
@@ -4083,7 +4055,6 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
rootBox->AddTooltipSupport(content);
}
}
-#endif
NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) ==
((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
@@ -4251,12 +4222,9 @@ static
bool IsXULDisplayType(const nsStyleDisplay* aDisplay)
{
return (aDisplay->mDisplay == StyleDisplay::InlineBox ||
-#ifdef MOZ_XUL
aDisplay->mDisplay == StyleDisplay::InlineXulGrid ||
aDisplay->mDisplay == StyleDisplay::InlineStack ||
-#endif
aDisplay->mDisplay == StyleDisplay::Box
-#ifdef MOZ_XUL
|| aDisplay->mDisplay == StyleDisplay::XulGrid ||
aDisplay->mDisplay == StyleDisplay::Stack ||
aDisplay->mDisplay == StyleDisplay::XulGridGroup ||
@@ -4264,7 +4232,6 @@ bool IsXULDisplayType(const nsStyleDisplay* aDisplay)
aDisplay->mDisplay == StyleDisplay::Deck ||
aDisplay->mDisplay == StyleDisplay::Popup ||
aDisplay->mDisplay == StyleDisplay::Groupbox
-#endif
);
}
@@ -4314,7 +4281,6 @@ nsCSSFrameConstructor::FindXULTagData(Element* aElement,
}
static const FrameConstructionDataByTag sXULTagData[] = {
-#ifdef MOZ_XUL
SCROLLABLE_XUL_CREATE(button, NS_NewButtonBoxFrame),
SCROLLABLE_XUL_CREATE(checkbox, NS_NewButtonBoxFrame),
SCROLLABLE_XUL_CREATE(radio, NS_NewButtonBoxFrame),
@@ -4342,7 +4308,6 @@ nsCSSFrameConstructor::FindXULTagData(Element* aElement,
SIMPLE_TAG_CHAIN(listboxbody,
nsCSSFrameConstructor::FindXULListBoxBodyData),
SIMPLE_TAG_CHAIN(listitem, nsCSSFrameConstructor::FindXULListItemData),
-#endif /* MOZ_XUL */
SIMPLE_XUL_CREATE(slider, NS_NewSliderFrame),
SIMPLE_XUL_CREATE(scrollbar, NS_NewScrollbarFrame),
SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame)
@@ -4352,7 +4317,6 @@ nsCSSFrameConstructor::FindXULTagData(Element* aElement,
ArrayLength(sXULTagData));
}
-#ifdef MOZ_XUL
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindPopupGroupData(Element* aElement,
@@ -4436,8 +4400,6 @@ nsCSSFrameConstructor::FindXULListItemData(Element* aElement,
return &sListItemData;
}
-#endif /* MOZ_XUL */
-
/* static */
const nsCSSFrameConstructor::FrameConstructionData*
nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
@@ -4449,7 +4411,6 @@ nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
NS_NewBoxFrame),
SCROLLABLE_ABSPOS_CONTAINER_XUL_DISPLAY_CREATE(StyleDisplay::InlineBox,
NS_NewBoxFrame),
-#ifdef MOZ_XUL
SCROLLABLE_XUL_DISPLAY_CREATE(StyleDisplay::XulGrid, NS_NewGridBoxFrame),
SCROLLABLE_XUL_DISPLAY_CREATE(StyleDisplay::InlineXulGrid, NS_NewGridBoxFrame),
SCROLLABLE_XUL_DISPLAY_CREATE(StyleDisplay::XulGridGroup,
@@ -4463,7 +4424,6 @@ nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
FCDATA_FOR_DISPLAY(StyleDisplay::Popup,
FCDATA_DECL(FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_IS_POPUP |
FCDATA_SKIP_ABSPOS_PUSH, NS_NewMenuPopupFrame))
-#endif /* MOZ_XUL */
};
if (aDisplay->mDisplay < StyleDisplay::Box) {
@@ -5831,7 +5791,6 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
return;
}
-#ifdef MOZ_XUL
if ((data->mBits & FCDATA_IS_POPUP) &&
(!aParentFrame || // Parent is inline
aParentFrame->GetType() != nsGkAtoms::menuFrame)) {
@@ -5844,7 +5803,6 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
isPopup = true;
}
-#endif /* MOZ_XUL */
}
uint32_t bits = data->mBits;
@@ -6821,8 +6779,6 @@ IsSpecialFramesetChild(nsIContent* aContent)
static void
InvalidateCanvasIfNeeded(nsIPresShell* presShell, nsIContent* node);
-#ifdef MOZ_XUL
-
static
bool
IsXULListBox(nsIContent* aContainer)
@@ -6850,7 +6806,6 @@ MaybeGetListBoxBodyFrame(nsIContent* aContainer, nsIContent* aChild)
return nullptr;
}
-#endif
void
nsCSSFrameConstructor::AddTextItemIfNeeded(nsFrameConstructorState& aState,
@@ -7075,12 +7030,9 @@ nsCSSFrameConstructor::IssueSingleInsertNofications(nsIContent* aContainer,
child = child->GetNextSibling()) {
if ((child->GetPrimaryFrame() || GetUndisplayedContent(child) ||
GetDisplayContentsStyleFor(child))
-#ifdef MOZ_XUL
// Except listboxes suck, so do NOT skip anything here if
// we plan to notify a listbox.
- && !MaybeGetListBoxBodyFrame(aContainer, child)
-#endif
- ) {
+ && !MaybeGetListBoxBodyFrame(aContainer, child)) {
// Already have a frame or undisplayed entry for this content; a
// previous ContentInserted in this loop must have reconstructed
// its insertion parent. Skip it.
@@ -7208,7 +7160,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
#endif
-#ifdef MOZ_XUL
if (aContainer) {
int32_t namespaceID;
nsIAtom* tag =
@@ -7221,7 +7172,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
return;
}
-#endif // MOZ_XUL
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
@@ -7511,8 +7461,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
return;
}
-#ifdef MOZ_XUL
-
enum content_operation
{
CONTENT_INSERTED,
@@ -7549,7 +7497,6 @@ bool NotifyListBoxBody(nsPresContext* aPresContext,
return false;
}
-#endif // MOZ_XUL
void
nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
@@ -7632,7 +7579,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
NS_ASSERTION(isSingleInsert || aEndChild,
"range should not include all nodes after aStartChild");
-#ifdef MOZ_XUL
if (aContainer && IsXULListBox(aContainer)) {
if (isSingleInsert) {
if (NotifyListBoxBody(mPresShell->GetPresContext(), aContainer,
@@ -7651,7 +7597,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
return;
}
}
-#endif // MOZ_XUL
// If we have a null parent, then this must be the document element being
// inserted, or some other child of the document in the DOM (might be a PI,
@@ -8172,7 +8117,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
ClearDisplayContentsIn(aChild, aContainer);
}
-#ifdef MOZ_XUL
if (NotifyListBoxBody(presContext, aContainer, aChild, aOldNextSibling,
childFrame, CONTENT_REMOVED)) {
if (aFlags == REMOVE_DESTROY_FRAMES) {
@@ -8181,8 +8125,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
return;
}
-#endif // MOZ_XUL
-
// If we're removing the root, then make sure to remove things starting at
// the viewport's child instead of the primary frame (which might even be
// null if the root had an XBL binding or display:none, even though the
@@ -8774,11 +8716,9 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
"no support for fragmenting table captions yet");
newFrame = NS_NewBlockFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
-#ifdef MOZ_XUL
} else if (nsGkAtoms::XULLabelFrame == frameType) {
newFrame = NS_NewXULLabelFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
-#endif
} else if (nsGkAtoms::columnSetFrame == frameType) {
MOZ_ASSERT(!aFrame->IsTableCaption(),
"no support for fragmenting table captions yet");
@@ -9370,7 +9310,6 @@ nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(
return true;
}
-#ifdef MOZ_XUL
if (aFrame->GetType() == nsGkAtoms::popupSetFrame) {
nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell);
if (rootBox && rootBox->GetPopupSetFrame() == aFrame) {
@@ -9378,7 +9317,6 @@ nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(
return true;
}
}
-#endif
// Reconstruct if inflowFrame is parent's only child, and parent is, or has,
// a non-fluid continuation, i.e. it was split by bidi resolution
@@ -11487,7 +11425,6 @@ nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame,
nsIFrame** aNewFrame,
bool aIsAppend)
{
-#ifdef MOZ_XUL
// Construct a new frame
if (nullptr != aParentFrame) {
nsFrameItems frameItems;
@@ -11544,7 +11481,6 @@ nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame,
}
#endif
}
-#endif
}
//----------------------------------------