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

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

mercurial