diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/xul/nsStackFrame.cpp | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/xul/nsStackFrame.cpp')
-rw-r--r-- | layout/xul/nsStackFrame.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/layout/xul/nsStackFrame.cpp b/layout/xul/nsStackFrame.cpp new file mode 100644 index 000000000..437d558f9 --- /dev/null +++ b/layout/xul/nsStackFrame.cpp @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// +// Eric Vaughan +// Netscape Communications +// +// See documentation in associated header file +// + +#include "nsStackFrame.h" +#include "nsStyleContext.h" +#include "nsIContent.h" +#include "nsCOMPtr.h" +#include "nsHTMLParts.h" +#include "nsIPresShell.h" +#include "nsCSSRendering.h" +#include "nsBoxLayoutState.h" +#include "nsStackLayout.h" +#include "nsDisplayList.h" + +nsIFrame* +NS_NewStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) +{ + return new (aPresShell) nsStackFrame(aContext); +} + +NS_IMPL_FRAMEARENA_HELPERS(nsStackFrame) + +nsStackFrame::nsStackFrame(nsStyleContext* aContext): + nsBoxFrame(aContext) +{ + nsCOMPtr<nsBoxLayout> layout; + NS_NewStackLayout(layout); + SetXULLayoutManager(layout); +} + +// REVIEW: The old code put everything in the background layer. To be more +// consistent with the way other frames work, I'm putting everything in the +// Content() (i.e., foreground) layer (see nsFrame::BuildDisplayListForChild, +// the case for stacking context but non-positioned, non-floating frames). +// This could easily be changed back by hacking nsBoxFrame::BuildDisplayListInternal +// a bit more. +void +nsStackFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + // BuildDisplayListForChild puts stacking contexts into the PositionedDescendants + // list. So we need to map that list to aLists.Content(). This is an easy way to + // do that. + nsDisplayList* content = aLists.Content(); + nsDisplayListSet kidLists(content, content, content, content, content, content); + nsIFrame* kid = mFrames.FirstChild(); + while (kid) { + // Force each child into its own true stacking context. + BuildDisplayListForChild(aBuilder, kid, aDirtyRect, kidLists, + DISPLAY_CHILD_FORCE_STACKING_CONTEXT); + kid = kid->GetNextSibling(); + } +} |