layout/xul/nsStackLayout.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /**
michael@0 7
michael@0 8 Eric D Vaughan
michael@0 9 A frame that can have multiple children. Only one child may be displayed at one time. So the
michael@0 10 can be flipped though like a deck of cards.
michael@0 11
michael@0 12 **/
michael@0 13
michael@0 14 #ifndef nsStackLayout_h___
michael@0 15 #define nsStackLayout_h___
michael@0 16
michael@0 17 #include "mozilla/Attributes.h"
michael@0 18 #include "nsBoxLayout.h"
michael@0 19 #include "nsCOMPtr.h"
michael@0 20 #include "nsCoord.h"
michael@0 21
michael@0 22 class nsIPresShell;
michael@0 23
michael@0 24 nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
michael@0 25
michael@0 26 class nsStackLayout : public nsBoxLayout
michael@0 27 {
michael@0 28 public:
michael@0 29
michael@0 30 friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
michael@0 31 static void Shutdown();
michael@0 32
michael@0 33 nsStackLayout();
michael@0 34
michael@0 35 NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState) MOZ_OVERRIDE;
michael@0 36
michael@0 37 virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
michael@0 38 virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
michael@0 39 virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
michael@0 40 virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
michael@0 41
michael@0 42 // get the child offsets for aChild and set them in aMargin. Returns a
michael@0 43 // bitfield mask of the SPECIFIED_LEFT, SPECIFIED_RIGHT, SPECIFIED_TOP and
michael@0 44 // SPECIFIED_BOTTOM offsets indicating which sides have been specified by
michael@0 45 // attributes.
michael@0 46 static uint8_t GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aMargin);
michael@0 47
michael@0 48 private:
michael@0 49 static nsBoxLayout* gInstance;
michael@0 50
michael@0 51 }; // class nsStackLayout
michael@0 52
michael@0 53
michael@0 54
michael@0 55 #endif
michael@0 56

mercurial