layout/base/nsFrameManagerBase.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim:cindent:ts=2:et:sw=2:
michael@0 3 *
michael@0 4 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 7 *
michael@0 8 * This Original Code has been modified by IBM Corporation. Modifications made
michael@0 9 * by IBM described herein are Copyright (c) International Business Machines
michael@0 10 * Corporation, 2000. Modifications to Mozilla code or documentation identified
michael@0 11 * per MPL Section 3.3
michael@0 12 *
michael@0 13 * Date Modified by Description of modification
michael@0 14 * 04/20/2000 IBM Corp. OS/2 VisualAge build.
michael@0 15 */
michael@0 16
michael@0 17 /* part of nsFrameManager, to work around header inclusionordering */
michael@0 18
michael@0 19 #ifndef _nsFrameManagerBase_h_
michael@0 20 #define _nsFrameManagerBase_h_
michael@0 21
michael@0 22 #include "pldhash.h"
michael@0 23
michael@0 24 class nsIPresShell;
michael@0 25 class nsStyleSet;
michael@0 26 class nsIContent;
michael@0 27 class nsPlaceholderFrame;
michael@0 28 class nsIFrame;
michael@0 29 class nsStyleContext;
michael@0 30 class nsIAtom;
michael@0 31 class nsStyleChangeList;
michael@0 32 class nsILayoutHistoryState;
michael@0 33
michael@0 34 class nsFrameManagerBase
michael@0 35 {
michael@0 36 public:
michael@0 37 nsFrameManagerBase()
michael@0 38 {
michael@0 39 memset(this, '\0', sizeof(nsFrameManagerBase));
michael@0 40 }
michael@0 41
michael@0 42 bool IsDestroyingFrames() { return mIsDestroyingFrames; }
michael@0 43
michael@0 44 /*
michael@0 45 * Gets and sets the root frame (typically the viewport). The lifetime of the
michael@0 46 * root frame is controlled by the frame manager. When the frame manager is
michael@0 47 * destroyed, it destroys the entire frame hierarchy.
michael@0 48 */
michael@0 49 NS_HIDDEN_(nsIFrame*) GetRootFrame() const { return mRootFrame; }
michael@0 50 NS_HIDDEN_(void) SetRootFrame(nsIFrame* aRootFrame)
michael@0 51 {
michael@0 52 NS_ASSERTION(!mRootFrame, "already have a root frame");
michael@0 53 mRootFrame = aRootFrame;
michael@0 54 }
michael@0 55
michael@0 56 static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; }
michael@0 57
michael@0 58 protected:
michael@0 59 class UndisplayedMap;
michael@0 60
michael@0 61 // weak link, because the pres shell owns us
michael@0 62 nsIPresShell* mPresShell;
michael@0 63 // the pres shell owns the style set
michael@0 64 nsStyleSet* mStyleSet;
michael@0 65 nsIFrame* mRootFrame;
michael@0 66 PLDHashTable mPlaceholderMap;
michael@0 67 UndisplayedMap* mUndisplayedMap;
michael@0 68 bool mIsDestroyingFrames; // The frame manager is destroying some frame(s).
michael@0 69
michael@0 70 // The frame tree generation number
michael@0 71 // We use this to avoid unnecessary screenshotting
michael@0 72 // on Android. Unfortunately, this is static to match
michael@0 73 // the single consumer which is also static. Keeping
michael@0 74 // this the same greatly simplifies lifetime issues and
michael@0 75 // makes sure we always using the correct number.
michael@0 76 // A per PresContext generation number is available
michael@0 77 // via nsPresContext::GetDOMGeneration
michael@0 78 static uint32_t sGlobalGenerationNumber;
michael@0 79 };
michael@0 80
michael@0 81 #endif

mercurial