2004-03-06 07:46:11 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim:cindent:ts=2:et:sw=2:
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/.
|
2004-03-06 07:46:11 +03:00
|
|
|
*
|
|
|
|
* This Original Code has been modified by IBM Corporation. Modifications made
|
|
|
|
* by IBM described herein are Copyright (c) International Business Machines
|
|
|
|
* Corporation, 2000. Modifications to Mozilla code or documentation identified
|
|
|
|
* per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 04/20/2000 IBM Corp. OS/2 VisualAge build.
|
|
|
|
*/
|
|
|
|
|
2006-03-30 09:56:38 +04:00
|
|
|
/* part of nsFrameManager, to work around header inclusionordering */
|
|
|
|
|
2004-03-06 07:46:11 +03:00
|
|
|
#ifndef _nsFrameManagerBase_h_
|
|
|
|
#define _nsFrameManagerBase_h_
|
|
|
|
|
2014-06-12 21:09:31 +04:00
|
|
|
#include "nsDebug.h"
|
2004-03-06 07:46:11 +03:00
|
|
|
#include "pldhash.h"
|
2015-04-17 05:33:55 +03:00
|
|
|
#include "mozilla/Attributes.h"
|
2004-03-06 07:46:11 +03:00
|
|
|
|
2014-06-12 21:09:31 +04:00
|
|
|
class nsIFrame;
|
2004-03-06 07:46:11 +03:00
|
|
|
class nsIPresShell;
|
|
|
|
class nsStyleSet;
|
|
|
|
|
|
|
|
class nsFrameManagerBase
|
|
|
|
{
|
2008-12-12 11:25:16 +03:00
|
|
|
public:
|
2012-02-02 14:06:46 +04:00
|
|
|
nsFrameManagerBase()
|
2014-06-12 23:25:33 +04:00
|
|
|
: mPresShell(nullptr)
|
|
|
|
, mStyleSet(nullptr)
|
|
|
|
, mRootFrame(nullptr)
|
|
|
|
, mUndisplayedMap(nullptr)
|
2014-11-20 21:24:09 +03:00
|
|
|
, mDisplayContentsMap(nullptr)
|
2014-06-12 23:25:33 +04:00
|
|
|
, mIsDestroyingFrames(false)
|
2012-02-02 14:06:46 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsDestroyingFrames() { return mIsDestroyingFrames; }
|
2008-12-12 11:25:16 +03:00
|
|
|
|
2010-03-31 16:48:04 +04:00
|
|
|
/*
|
|
|
|
* Gets and sets the root frame (typically the viewport). The lifetime of the
|
|
|
|
* root frame is controlled by the frame manager. When the frame manager is
|
|
|
|
* destroyed, it destroys the entire frame hierarchy.
|
|
|
|
*/
|
2014-06-02 16:08:21 +04:00
|
|
|
nsIFrame* GetRootFrame() const { return mRootFrame; }
|
|
|
|
void SetRootFrame(nsIFrame* aRootFrame)
|
2010-03-31 16:48:04 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(!mRootFrame, "already have a root frame");
|
|
|
|
mRootFrame = aRootFrame;
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
static uint32_t GetGlobalGenerationNumber() { return sGlobalGenerationNumber; }
|
2012-07-04 19:42:29 +04:00
|
|
|
|
2004-03-06 07:46:11 +03:00
|
|
|
protected:
|
|
|
|
class UndisplayedMap;
|
|
|
|
|
|
|
|
// weak link, because the pres shell owns us
|
2015-04-17 05:33:55 +03:00
|
|
|
nsIPresShell* MOZ_NON_OWNING_REF mPresShell;
|
2004-03-06 07:46:11 +03:00
|
|
|
// the pres shell owns the style set
|
|
|
|
nsStyleSet* mStyleSet;
|
|
|
|
nsIFrame* mRootFrame;
|
|
|
|
PLDHashTable mPlaceholderMap;
|
|
|
|
UndisplayedMap* mUndisplayedMap;
|
2014-11-20 21:24:09 +03:00
|
|
|
UndisplayedMap* mDisplayContentsMap;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsDestroyingFrames; // The frame manager is destroying some frame(s).
|
2012-07-04 19:42:29 +04:00
|
|
|
|
|
|
|
// The frame tree generation number
|
|
|
|
// We use this to avoid unnecessary screenshotting
|
|
|
|
// on Android. Unfortunately, this is static to match
|
|
|
|
// the single consumer which is also static. Keeping
|
|
|
|
// this the same greatly simplifies lifetime issues and
|
|
|
|
// makes sure we always using the correct number.
|
|
|
|
// A per PresContext generation number is available
|
|
|
|
// via nsPresContext::GetDOMGeneration
|
2012-08-22 19:56:38 +04:00
|
|
|
static uint32_t sGlobalGenerationNumber;
|
2004-03-06 07:46:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|