1998-04-13 20:24:54 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2004-04-18 14:30:37 +00:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
2001-04-18 06:06:31 +00:00
|
|
|
* Contributor(s):
|
|
|
|
* Steve Clark <buster@netscape.com>
|
|
|
|
* Dan Rosen <dr@netscape.com>
|
2000-05-15 03:36:34 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK *****
|
2000-05-15 03:36:34 +00: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
|
|
|
|
* 05/03/2000 IBM Corp. Observer related defines for reflow
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
2006-03-30 05:56:38 +00:00
|
|
|
|
|
|
|
/* a presentation of a document, part 2 */
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsIPresShell_h___
|
|
|
|
#define nsIPresShell_h___
|
|
|
|
|
1998-06-03 15:41:39 +00:00
|
|
|
#include "nsISupports.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
#include "nsCoord.h"
|
2006-01-26 02:29:17 +00:00
|
|
|
#include "nsRect.h"
|
|
|
|
#include "nsColor.h"
|
2001-07-16 02:40:48 +00:00
|
|
|
#include "nsEvent.h"
|
2002-06-25 21:16:17 +00:00
|
|
|
#include "nsCompatibility.h"
|
2004-03-06 04:46:11 +00:00
|
|
|
#include "nsFrameManagerBase.h"
|
2004-05-27 22:08:42 +00:00
|
|
|
#include "mozFlushType.h"
|
2005-08-22 01:55:34 +00:00
|
|
|
#include "nsWeakReference.h"
|
2004-01-07 22:30:53 +00:00
|
|
|
#include <stdio.h> // for FILE definition
|
2000-04-27 07:37:12 +00:00
|
|
|
|
2001-12-17 22:39:59 +00:00
|
|
|
class nsIAtom;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIContent;
|
2000-03-23 00:34:54 +00:00
|
|
|
class nsIContentIterator;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIDocument;
|
1998-06-03 15:41:39 +00:00
|
|
|
class nsIDocumentObserver;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIFrame;
|
2004-07-31 23:15:21 +00:00
|
|
|
class nsPresContext;
|
2004-01-07 22:30:53 +00:00
|
|
|
class nsStyleSet;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIViewManager;
|
1998-06-25 04:24:45 +00:00
|
|
|
class nsIDeviceContext;
|
1998-10-02 01:12:39 +00:00
|
|
|
class nsIRenderingContext;
|
1998-12-07 03:43:02 +00:00
|
|
|
class nsIPageSequenceFrame;
|
1999-01-23 07:00:39 +00:00
|
|
|
class nsString;
|
2002-02-19 22:49:12 +00:00
|
|
|
class nsAString;
|
2008-07-16 10:52:01 +00:00
|
|
|
class nsCaret;
|
2003-02-22 00:32:13 +00:00
|
|
|
class nsStyleContext;
|
2006-04-26 02:01:07 +00:00
|
|
|
class nsFrameSelection;
|
2004-02-23 21:29:06 +00:00
|
|
|
class nsFrameManager;
|
1999-08-30 22:38:58 +00:00
|
|
|
class nsILayoutHistoryState;
|
2000-07-13 23:00:59 +00:00
|
|
|
class nsIReflowCallback;
|
2007-10-15 03:42:27 +00:00
|
|
|
class nsISupportsArray;
|
2001-07-16 02:40:48 +00:00
|
|
|
class nsIDOMNode;
|
2007-03-20 12:14:52 +00:00
|
|
|
class nsIRegion;
|
2004-01-07 22:30:53 +00:00
|
|
|
class nsIStyleFrameConstruction;
|
|
|
|
class nsIStyleSheet;
|
2004-01-21 23:05:10 +00:00
|
|
|
class nsCSSFrameConstructor;
|
2005-08-29 15:19:13 +00:00
|
|
|
class nsISelection;
|
2006-03-22 18:36:36 +00:00
|
|
|
template<class E> class nsCOMArray;
|
2006-07-12 07:41:11 +00:00
|
|
|
class nsWeakFrame;
|
2007-02-18 10:43:12 +00:00
|
|
|
class nsIScrollableFrame;
|
2007-03-20 12:14:52 +00:00
|
|
|
class gfxASurface;
|
2007-05-23 00:11:05 +00:00
|
|
|
class gfxContext;
|
2009-03-03 20:11:14 +00:00
|
|
|
class nsPIDOMEventTarget;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
typedef short SelectionType;
|
2007-05-06 19:16:51 +00:00
|
|
|
typedef PRUint32 nsFrameState;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2009-03-03 20:20:11 +00:00
|
|
|
// fa7f090d-b19a-4ef8-9552-82992a3b4a83
|
2009-03-03 20:11:14 +00:00
|
|
|
#define NS_IPRESSHELL_IID \
|
2009-03-03 20:20:11 +00:00
|
|
|
{ 0xfa7f090d, 0xb19a, 0x4ef8, \
|
|
|
|
{ 0x95, 0x52, 0x82, 0x99, 0x2a, 0x3b, 0x4a, 0x83 } }
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2007-03-07 19:08:36 +00:00
|
|
|
// Constants for ScrollContentIntoView() function
|
1999-07-19 18:38:02 +00:00
|
|
|
#define NS_PRESSHELL_SCROLL_TOP 0
|
|
|
|
#define NS_PRESSHELL_SCROLL_BOTTOM 100
|
|
|
|
#define NS_PRESSHELL_SCROLL_LEFT 0
|
|
|
|
#define NS_PRESSHELL_SCROLL_RIGHT 100
|
|
|
|
#define NS_PRESSHELL_SCROLL_CENTER 50
|
|
|
|
#define NS_PRESSHELL_SCROLL_ANYWHERE -1
|
2000-01-25 14:31:41 +00:00
|
|
|
#define NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE -2
|
1999-02-18 22:51:46 +00:00
|
|
|
|
2000-03-22 23:19:10 +00:00
|
|
|
// debug VerifyReflow flags
|
|
|
|
#define VERIFY_REFLOW_ON 0x01
|
|
|
|
#define VERIFY_REFLOW_NOISY 0x02
|
|
|
|
#define VERIFY_REFLOW_ALL 0x04
|
|
|
|
#define VERIFY_REFLOW_DUMP_COMMANDS 0x08
|
|
|
|
#define VERIFY_REFLOW_NOISY_RC 0x10
|
|
|
|
#define VERIFY_REFLOW_REALLY_NOISY_RC 0x20
|
2009-01-04 19:52:38 +00:00
|
|
|
#define VERIFY_REFLOW_DURING_RESIZE_REFLOW 0x40
|
2000-03-22 23:19:10 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* Presentation shell interface. Presentation shells are the
|
|
|
|
* controlling point for managing the presentation of a document. The
|
|
|
|
* presentation shell holds a live reference to the document, the
|
|
|
|
* presentation context, the style manager, the style set and the root
|
|
|
|
* frame. <p>
|
|
|
|
*
|
|
|
|
* When this object is Release'd, it will release the document, the
|
|
|
|
* presentation context, the style manager, the style set and the root
|
|
|
|
* frame.
|
|
|
|
*/
|
2004-08-29 04:18:27 +00:00
|
|
|
|
|
|
|
// hack to make egcs / gcc 2.95.2 happy
|
|
|
|
class nsIPresShell_base : public nsISupports
|
|
|
|
{
|
1998-04-13 20:24:54 +00:00
|
|
|
public:
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRESSHELL_IID)
|
2004-08-29 04:18:27 +00:00
|
|
|
};
|
1999-03-03 01:51:21 +00:00
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPresShell_base, NS_IPRESSHELL_IID)
|
|
|
|
|
2004-08-29 04:18:27 +00:00
|
|
|
class nsIPresShell : public nsIPresShell_base
|
|
|
|
{
|
|
|
|
public:
|
1998-06-03 15:41:39 +00:00
|
|
|
NS_IMETHOD Init(nsIDocument* aDocument,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
1998-06-03 15:41:39 +00:00
|
|
|
nsIViewManager* aViewManager,
|
2004-01-07 22:30:53 +00:00
|
|
|
nsStyleSet* aStyleSet,
|
2002-06-25 21:16:17 +00:00
|
|
|
nsCompatibility aCompatMode) = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2001-08-01 03:15:50 +00:00
|
|
|
/**
|
|
|
|
* All callers are responsible for calling |Destroy| after calling
|
|
|
|
* |EndObservingDocument|. It needs to be separate only because form
|
|
|
|
* controls incorrectly store their data in the frames rather than the
|
|
|
|
* content model and printing calls |EndObservingDocument| multiple
|
|
|
|
* times to make form controls behave nicely when printed.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Destroy() = 0;
|
2008-10-01 00:51:05 +00:00
|
|
|
|
|
|
|
PRBool IsDestroying() { return mIsDestroying; }
|
2001-08-01 03:15:50 +00:00
|
|
|
|
1999-12-04 23:49:50 +00:00
|
|
|
// All frames owned by the shell are allocated from an arena. They are also recycled
|
|
|
|
// using free lists (separate free lists being maintained for each size_t).
|
|
|
|
// Methods for recycling frames.
|
2004-04-13 00:28:44 +00:00
|
|
|
virtual void* AllocateFrame(size_t aSize) = 0;
|
|
|
|
virtual void FreeFrame(size_t aSize, void* aFreeChunk) = 0;
|
2000-03-31 07:02:06 +00:00
|
|
|
|
2007-01-17 23:53:47 +00:00
|
|
|
/**
|
|
|
|
* Stack memory allocation:
|
|
|
|
*
|
|
|
|
* Callers who wish to allocate memory whose lifetime corresponds to
|
|
|
|
* the lifetime of a stack-allocated object can use this API. The
|
|
|
|
* caller must use a pair of calls to PushStackMemory and
|
|
|
|
* PopStackMemory, such that all stack object lifetimes are either
|
|
|
|
* entirely between the calls or containing both calls.
|
|
|
|
*
|
|
|
|
* Then, between the calls, the caller can call AllocateStackMemory to
|
|
|
|
* allocate memory from an arena pool that will be freed by the call
|
|
|
|
* to PopStackMemory.
|
|
|
|
*
|
|
|
|
* The allocations cannot be for more than 4044 bytes.
|
|
|
|
*/
|
|
|
|
virtual void PushStackMemory() = 0;
|
|
|
|
virtual void PopStackMemory() = 0;
|
|
|
|
virtual void* AllocateStackMemory(size_t aSize) = 0;
|
1999-12-04 23:49:50 +00:00
|
|
|
|
2003-06-19 18:16:53 +00:00
|
|
|
nsIDocument* GetDocument() { return mDocument; }
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* GetPresContext() { return mPresContext; }
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2003-06-19 18:16:53 +00:00
|
|
|
nsIViewManager* GetViewManager() { return mViewManager; }
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2004-01-07 22:30:53 +00:00
|
|
|
#ifdef _IMPL_NS_LAYOUT
|
|
|
|
nsStyleSet* StyleSet() { return mStyleSet; }
|
|
|
|
|
2004-01-21 23:05:10 +00:00
|
|
|
nsCSSFrameConstructor* FrameConstructor()
|
2004-01-07 22:30:53 +00:00
|
|
|
{
|
|
|
|
return mFrameConstructor;
|
|
|
|
}
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2004-03-06 04:46:11 +00:00
|
|
|
nsFrameManager* FrameManager() const {
|
2007-07-08 07:08:04 +00:00
|
|
|
return reinterpret_cast<nsFrameManager*>
|
|
|
|
(&const_cast<nsIPresShell*>(this)->mFrameManager);
|
2004-03-06 04:46:11 +00:00
|
|
|
}
|
2004-02-23 21:29:06 +00:00
|
|
|
|
|
|
|
#endif
|
2003-07-12 00:48:16 +00:00
|
|
|
|
2004-08-05 11:38:42 +00:00
|
|
|
/* Enable/disable author style level. Disabling author style disables the entire
|
|
|
|
* author level of the cascade, including the HTML preshint level.
|
|
|
|
*/
|
2004-08-29 03:08:44 +00:00
|
|
|
// XXX these could easily be inlined, but there is a circular #include
|
|
|
|
// problem with nsStyleSet.
|
|
|
|
NS_HIDDEN_(void) SetAuthorStyleDisabled(PRBool aDisabled);
|
|
|
|
NS_HIDDEN_(PRBool) GetAuthorStyleDisabled();
|
2004-08-05 11:38:42 +00:00
|
|
|
|
2001-12-17 22:51:39 +00:00
|
|
|
/*
|
|
|
|
* Called when stylesheets are added/removed/enabled/disabled to rebuild
|
|
|
|
* all style data for a given pres shell without necessarily reconstructing
|
2005-11-06 18:01:17 +00:00
|
|
|
* all of the frames. This will not reconstruct style synchronously; if
|
|
|
|
* you need to do that, call FlushPendingNotifications to flush out style
|
|
|
|
* reresolves.
|
|
|
|
* // XXXbz why do we have this on the interface anyway? The only consumer
|
|
|
|
* is calling AddOverrideStyleSheet/RemoveOverrideStyleSheet, and I think
|
|
|
|
* those should just handle reconstructing style data...
|
2001-12-17 22:51:39 +00:00
|
|
|
*/
|
2004-08-29 03:08:44 +00:00
|
|
|
virtual NS_HIDDEN_(void) ReconstructStyleDataExternal();
|
|
|
|
NS_HIDDEN_(void) ReconstructStyleDataInternal();
|
|
|
|
#ifdef _IMPL_NS_LAYOUT
|
|
|
|
void ReconstructStyleData() { ReconstructStyleDataInternal(); }
|
|
|
|
#else
|
|
|
|
void ReconstructStyleData() { ReconstructStyleDataExternal(); }
|
|
|
|
#endif
|
2001-12-17 22:51:39 +00:00
|
|
|
|
2000-10-11 08:33:01 +00:00
|
|
|
/** Setup all style rules required to implement preferences
|
|
|
|
* - used for background/text/link colors and link underlining
|
|
|
|
* may be extended for any prefs that are implemented via style rules
|
|
|
|
* - aForceReflow argument is used to force a full reframe to make the rules show
|
|
|
|
* (only used when the current page needs to reflect changed pref rules)
|
|
|
|
*
|
|
|
|
* - initially created for bugs 31816, 20760, 22963
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetPreferenceStyleRules(PRBool aForceReflow) = 0;
|
|
|
|
|
1999-07-18 02:27:19 +00:00
|
|
|
/**
|
2004-08-29 03:08:44 +00:00
|
|
|
* FrameSelection will return the Frame based selection API.
|
|
|
|
* You cannot go back and forth anymore with QI between nsIDOM sel and
|
|
|
|
* nsIFrame sel.
|
1999-07-18 02:27:19 +00:00
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
already_AddRefed<nsFrameSelection> FrameSelection();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ConstFrameSelection returns an object which methods are safe to use for
|
|
|
|
* example in nsIFrame code.
|
|
|
|
*/
|
|
|
|
const nsFrameSelection* ConstFrameSelection() { return mSelection; }
|
1998-05-09 03:21:34 +00:00
|
|
|
|
2007-05-14 03:52:48 +00:00
|
|
|
// Make shell be a document observer. If called after Destroy() has
|
|
|
|
// been called on the shell, this will be ignored.
|
1998-12-29 04:56:31 +00:00
|
|
|
NS_IMETHOD BeginObservingDocument() = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
// Make shell stop being a document observer
|
1998-12-29 04:56:31 +00:00
|
|
|
NS_IMETHOD EndObservingDocument() = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2002-09-06 05:44:31 +00:00
|
|
|
/**
|
2008-12-29 15:07:36 +00:00
|
|
|
* Return whether InitialReflow() was previously called.
|
2002-09-06 05:44:31 +00:00
|
|
|
*/
|
2008-12-29 15:07:36 +00:00
|
|
|
PRBool DidInitialReflow() const { return mDidInitialReflow; }
|
2002-09-06 05:44:31 +00:00
|
|
|
|
1998-09-10 19:32:14 +00:00
|
|
|
/**
|
|
|
|
* Perform the initial reflow. Constructs the frame for the root content
|
|
|
|
* object and then reflows the frame model into the specified width and
|
|
|
|
* height.
|
|
|
|
*
|
2007-05-14 03:52:48 +00:00
|
|
|
* The coordinates for aWidth and aHeight must be in standard nscoords.
|
|
|
|
*
|
|
|
|
* Callers of this method must hold a reference to this shell that
|
|
|
|
* is guaranteed to survive through arbitrary script execution.
|
|
|
|
* Calling InitialReflow can execute arbitrary script.
|
1998-09-10 19:32:14 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD InitialReflow(nscoord aWidth, nscoord aHeight) = 0;
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
|
|
|
* Reflow the frame model into a new width and height. The
|
|
|
|
* coordinates for aWidth and aHeight must be in standard nscoord's.
|
|
|
|
*/
|
1998-08-28 02:49:49 +00:00
|
|
|
NS_IMETHOD ResizeReflow(nscoord aWidth, nscoord aHeight) = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-11-06 16:16:01 +00:00
|
|
|
/**
|
|
|
|
* Reflow the frame model with a reflow reason of eReflowReason_StyleChange
|
|
|
|
*/
|
|
|
|
NS_IMETHOD StyleChangeReflow() = 0;
|
|
|
|
|
2004-09-02 03:08:51 +00:00
|
|
|
/**
|
|
|
|
* This calls through to the frame manager to get the root frame.
|
|
|
|
* Callers inside of gklayout should use FrameManager()->GetRootFrame()
|
|
|
|
* instead, as it's more efficient.
|
|
|
|
*/
|
|
|
|
virtual NS_HIDDEN_(nsIFrame*) GetRootFrame() const;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2006-02-01 19:55:35 +00:00
|
|
|
/*
|
|
|
|
* Get root scroll frame from FrameManager()->GetRootFrame().
|
|
|
|
*/
|
|
|
|
nsIFrame* GetRootScrollFrame() const;
|
|
|
|
|
2007-02-18 10:43:12 +00:00
|
|
|
/*
|
|
|
|
* The same as GetRootScrollFrame, but returns an nsIScrollableFrame
|
|
|
|
*/
|
|
|
|
nsIScrollableFrame* GetRootScrollFrameAsScrollable() const;
|
|
|
|
|
1998-12-07 03:43:02 +00:00
|
|
|
/**
|
|
|
|
* Returns the page sequence frame associated with the frame hierarchy.
|
|
|
|
* Returns NULL if not a paginated view.
|
|
|
|
*/
|
1999-02-12 17:45:58 +00:00
|
|
|
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const = 0;
|
1998-12-07 03:43:02 +00:00
|
|
|
|
1998-12-29 04:45:18 +00:00
|
|
|
/**
|
1999-08-05 03:09:22 +00:00
|
|
|
* Gets the primary frame associated with the content object. This is a
|
|
|
|
* helper function that just forwards the request to the frame manager.
|
1998-12-29 04:45:18 +00:00
|
|
|
*
|
|
|
|
* The primary frame is the frame that is most closely associated with the
|
|
|
|
* content. A frame is more closely associated with the content that another
|
|
|
|
* frame if the one frame contains directly or indirectly the other frame (e.g.,
|
|
|
|
* when a frame is scrolled there is a scroll frame that contains the frame
|
|
|
|
* being scrolled). The primary frame is always the first-in-flow.
|
|
|
|
*
|
|
|
|
* In the case of absolutely positioned elements and floated elements,
|
2008-01-30 04:17:57 +00:00
|
|
|
* the primary frame is the placeholder frame.
|
1998-12-29 04:45:18 +00:00
|
|
|
*/
|
2005-08-22 22:24:29 +00:00
|
|
|
virtual NS_HIDDEN_(nsIFrame*) GetPrimaryFrameFor(nsIContent* aContent) const = 0;
|
1999-02-10 23:21:22 +00:00
|
|
|
|
2008-01-30 04:17:57 +00:00
|
|
|
/**
|
|
|
|
* Gets the real primary frame associated with the content object.
|
|
|
|
*
|
|
|
|
* In the case of absolutely positioned elements and floated elements,
|
|
|
|
* the real primary frame is the frame that is out of the flow and not the
|
|
|
|
* placeholder frame.
|
|
|
|
*/
|
|
|
|
virtual NS_HIDDEN_(nsIFrame*) GetRealPrimaryFrameFor(nsIContent* aContent) const = 0;
|
|
|
|
|
1998-12-29 03:38:16 +00:00
|
|
|
/**
|
1999-08-05 03:09:22 +00:00
|
|
|
* Gets the placeholder frame associated with the specified frame. This is
|
|
|
|
* a helper frame that forwards the request to the frame manager.
|
1998-12-29 03:38:16 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
1999-02-12 17:45:58 +00:00
|
|
|
nsIFrame** aPlaceholderFrame) const = 0;
|
1998-12-29 03:38:16 +00:00
|
|
|
|
1999-07-16 23:25:15 +00:00
|
|
|
/**
|
2007-05-06 19:16:51 +00:00
|
|
|
* Tell the pres shell that a frame needs to be marked dirty and needs
|
|
|
|
* Reflow. It's OK if this is an ancestor of the frame needing reflow as
|
|
|
|
* long as the ancestor chain between them doesn't cross a reflow root. The
|
2007-05-07 02:58:07 +00:00
|
|
|
* bit to add should be either NS_FRAME_IS_DIRTY or
|
2007-05-06 22:50:21 +00:00
|
|
|
* NS_FRAME_HAS_DIRTY_CHILDREN (but not both!).
|
1999-07-16 23:25:15 +00:00
|
|
|
*/
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
enum IntrinsicDirty {
|
|
|
|
// XXXldb eResize should be renamed
|
|
|
|
eResize, // don't mark any intrinsic widths dirty
|
|
|
|
eTreeChange, // mark intrinsic widths dirty on aFrame and its ancestors
|
|
|
|
eStyleChange // Do eTreeChange, plus all of aFrame's descendants
|
|
|
|
};
|
|
|
|
NS_IMETHOD FrameNeedsReflow(nsIFrame *aFrame,
|
2007-05-06 19:16:51 +00:00
|
|
|
IntrinsicDirty aIntrinsicDirty,
|
2007-05-06 22:50:21 +00:00
|
|
|
nsFrameState aBitToAdd) = 0;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
|
|
|
NS_IMETHOD CancelAllPendingReflows() = 0;
|
2000-04-17 07:13:57 +00:00
|
|
|
|
2002-10-22 06:07:52 +00:00
|
|
|
/**
|
|
|
|
* Recreates the frames for a node
|
|
|
|
*/
|
|
|
|
NS_IMETHOD RecreateFramesFor(nsIContent* aContent) = 0;
|
2000-10-17 05:07:39 +00:00
|
|
|
|
2008-06-25 22:41:04 +00:00
|
|
|
void PostRecreateFramesFor(nsIContent* aContent);
|
|
|
|
|
2000-10-17 05:07:39 +00:00
|
|
|
/**
|
|
|
|
* Determine if it is safe to flush all pending notifications
|
|
|
|
* @param aIsSafeToFlush PR_TRUE if it is safe, PR_FALSE otherwise.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsSafeToFlush(PRBool& aIsSafeToFlush) = 0;
|
|
|
|
|
2000-04-17 07:13:57 +00:00
|
|
|
/**
|
2004-05-27 22:08:42 +00:00
|
|
|
* Flush pending notifications of the type specified. This method
|
|
|
|
* will not affect the content model; it'll just affect style and
|
|
|
|
* frames. Callers that actually want up-to-date presentation (other
|
|
|
|
* than the document itself) should probably be calling
|
|
|
|
* nsIDocument::FlushPendingNotifications.
|
|
|
|
*
|
|
|
|
* @param aType the type of notifications to flush
|
2000-04-17 07:13:57 +00:00
|
|
|
*/
|
2004-05-27 22:08:42 +00:00
|
|
|
NS_IMETHOD FlushPendingNotifications(mozFlushType aType) = 0;
|
2000-04-17 07:13:57 +00:00
|
|
|
|
2007-03-05 21:55:23 +00:00
|
|
|
/**
|
|
|
|
* Callbacks will be called even if reflow itself fails for
|
|
|
|
* some reason.
|
|
|
|
*/
|
2000-07-13 23:00:59 +00:00
|
|
|
NS_IMETHOD PostReflowCallback(nsIReflowCallback* aCallback) = 0;
|
2000-10-07 00:49:08 +00:00
|
|
|
NS_IMETHOD CancelReflowCallback(nsIReflowCallback* aCallback) = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1999-02-12 17:45:58 +00:00
|
|
|
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame) = 0;
|
|
|
|
|
1998-10-02 01:12:39 +00:00
|
|
|
/**
|
1999-07-16 23:25:15 +00:00
|
|
|
* Given a frame, create a rendering context suitable for use with
|
1998-10-02 01:12:39 +00:00
|
|
|
* the frame.
|
|
|
|
*/
|
1999-02-12 17:45:58 +00:00
|
|
|
NS_IMETHOD CreateRenderingContext(nsIFrame *aFrame,
|
|
|
|
nsIRenderingContext** aContext) = 0;
|
1998-10-02 01:12:39 +00:00
|
|
|
|
1999-02-12 05:39:33 +00:00
|
|
|
/**
|
2003-01-13 23:10:53 +00:00
|
|
|
* Informs the pres shell that the document is now at the anchor with
|
|
|
|
* the given name. If |aScroll| is true, scrolls the view of the
|
|
|
|
* document so that the anchor with the specified name is displayed at
|
|
|
|
* the top of the window. If |aAnchorName| is empty, then this informs
|
|
|
|
* the pres shell that there is no current target, and |aScroll| must
|
|
|
|
* be false.
|
1999-02-12 05:39:33 +00:00
|
|
|
*/
|
2003-01-13 23:10:53 +00:00
|
|
|
NS_IMETHOD GoToAnchor(const nsAString& aAnchorName, PRBool aScroll) = 0;
|
1999-02-12 05:39:33 +00:00
|
|
|
|
2008-02-27 10:01:17 +00:00
|
|
|
/**
|
|
|
|
* Tells the presshell to scroll again to the last anchor scrolled to by
|
|
|
|
* GoToAnchor, if any. This scroll only happens if the scroll
|
|
|
|
* position has not changed since the last GoToAnchor. This is called
|
|
|
|
* by nsDocumentViewer::LoadComplete. This clears the last anchor
|
|
|
|
* scrolled to by GoToAnchor (we don't want to keep it alive if it's
|
|
|
|
* removed from the DOM), so don't call this more than once.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD ScrollToAnchor() = 0;
|
|
|
|
|
1999-02-18 22:51:46 +00:00
|
|
|
/**
|
2007-03-07 19:08:36 +00:00
|
|
|
* Scrolls the view of the document so that the primary frame of the content
|
|
|
|
* is displayed at the top of the window. Layout is flushed before scrolling.
|
1999-07-19 18:38:02 +00:00
|
|
|
*
|
2007-03-07 19:08:36 +00:00
|
|
|
* @param aContent The content object of which primary frame should be
|
|
|
|
* scrolled into view.
|
1999-07-19 18:38:02 +00:00
|
|
|
* @param aVPercent How to align the frame vertically. A value of 0
|
2007-03-07 19:08:36 +00:00
|
|
|
* (NS_PRESSHELL_SCROLL_TOP) means the frame's upper edge is
|
|
|
|
* aligned with the top edge of the visible area. A value of
|
|
|
|
* 100 (NS_PRESSHELL_SCROLL_BOTTOM) means the frame's bottom
|
|
|
|
* edge is aligned with the bottom edge of the visible area.
|
|
|
|
* For values in between, the point "aVPercent" down the frame
|
|
|
|
* is placed at the point "aVPercent" down the visible area. A
|
|
|
|
* value of 50 (NS_PRESSHELL_SCROLL_CENTER) centers the frame
|
|
|
|
* vertically. A value of NS_PRESSHELL_SCROLL_ANYWHERE means move
|
|
|
|
* the frame the minimum amount necessary in order for the entire
|
|
|
|
* frame to be visible vertically (if possible)
|
1999-07-19 18:38:02 +00:00
|
|
|
* @param aHPercent How to align the frame horizontally. A value of 0
|
2007-03-07 19:08:36 +00:00
|
|
|
* (NS_PRESSHELL_SCROLL_LEFT) means the frame's left edge is
|
|
|
|
* aligned with the left edge of the visible area. A value of
|
|
|
|
* 100 (NS_PRESSHELL_SCROLL_RIGHT) means the frame's right
|
|
|
|
* edge is aligned with the right edge of the visible area.
|
|
|
|
* For values in between, the point "aVPercent" across the frame
|
|
|
|
* is placed at the point "aVPercent" across the visible area.
|
|
|
|
* A value of 50 (NS_PRESSHELL_SCROLL_CENTER) centers the frame
|
|
|
|
* horizontally . A value of NS_PRESSHELL_SCROLL_ANYWHERE means move
|
|
|
|
* the frame the minimum amount necessary in order for the entire
|
|
|
|
* frame to be visible horizontally (if possible)
|
2007-03-06 09:53:56 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD ScrollContentIntoView(nsIContent* aContent,
|
|
|
|
PRIntn aVPercent,
|
|
|
|
PRIntn aHPercent) const = 0;
|
|
|
|
|
2001-12-01 00:22:00 +00:00
|
|
|
/**
|
|
|
|
* Suppress notification of the frame manager that frames are
|
|
|
|
* being destroyed.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD SetIgnoreFrameDestruction(PRBool aIgnore) = 0;
|
|
|
|
|
1999-07-16 23:25:15 +00:00
|
|
|
/**
|
|
|
|
* Notification sent by a frame informing the pres shell that it is about to
|
|
|
|
* be destroyed.
|
|
|
|
* This allows any outstanding references to the frame to be cleaned up
|
|
|
|
*/
|
|
|
|
NS_IMETHOD NotifyDestroyingFrame(nsIFrame* aFrame) = 0;
|
|
|
|
|
1999-03-01 19:21:01 +00:00
|
|
|
/**
|
1999-04-22 07:03:14 +00:00
|
|
|
* Notify the Clipboard that we have something to copy.
|
1999-03-01 19:21:01 +00:00
|
|
|
*/
|
1999-04-07 03:56:07 +00:00
|
|
|
NS_IMETHOD DoCopy() = 0;
|
1999-03-01 19:21:01 +00:00
|
|
|
|
2005-08-29 15:19:13 +00:00
|
|
|
/**
|
|
|
|
* Get the selection of the focussed element (either the page selection,
|
|
|
|
* or the selection for a text field).
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetSelectionForCopy(nsISelection** outSelection) = 0;
|
|
|
|
|
2001-04-18 06:06:31 +00:00
|
|
|
/**
|
2002-08-01 21:36:02 +00:00
|
|
|
* Get link location.
|
2001-04-18 06:06:31 +00:00
|
|
|
*/
|
2002-08-01 21:36:02 +00:00
|
|
|
NS_IMETHOD GetLinkLocation(nsIDOMNode* aNode, nsAString& aLocation) = 0;
|
2001-04-18 06:06:31 +00:00
|
|
|
|
2003-04-22 18:11:12 +00:00
|
|
|
/**
|
|
|
|
* Get the doc or the selection as text or html.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD DoGetContents(const nsACString& aMimeType, PRUint32 aFlags, PRBool aSelectionOnly, nsAString& outValue) = 0;
|
|
|
|
|
1999-02-13 04:45:44 +00:00
|
|
|
/**
|
|
|
|
* Get the caret, if it exists. AddRefs it.
|
|
|
|
*/
|
2008-07-16 10:52:01 +00:00
|
|
|
NS_IMETHOD GetCaret(nsCaret **aOutCaret) = 0;
|
1999-08-04 20:46:16 +00:00
|
|
|
|
2006-11-07 01:35:36 +00:00
|
|
|
/**
|
|
|
|
* Invalidate the caret's current position if it's outside of its frame's
|
|
|
|
* boundaries. This function is useful if you're batching selection
|
|
|
|
* notifications and might remove the caret's frame out from under it.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD_(void) MaybeInvalidateCaretPosition() = 0;
|
|
|
|
|
2006-04-17 23:16:46 +00:00
|
|
|
/**
|
2007-09-22 21:06:58 +00:00
|
|
|
* Set the current caret to a new caret. To undo this, call RestoreCaret.
|
2006-04-17 23:16:46 +00:00
|
|
|
*/
|
2008-07-16 10:52:01 +00:00
|
|
|
virtual void SetCaret(nsCaret *aNewCaret) = 0;
|
2007-09-22 21:06:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Restore the caret to the original caret that this pres shell was created
|
|
|
|
* with.
|
|
|
|
*/
|
|
|
|
virtual void RestoreCaret() = 0;
|
2006-04-17 23:16:46 +00:00
|
|
|
|
1999-08-04 20:46:16 +00:00
|
|
|
/**
|
|
|
|
* Should the images have borders etc. Actual visual effects are determined
|
|
|
|
* by the frames. Visual effects may not effect layout, only display.
|
|
|
|
* Takes effect on next repaint, does not force a repaint itself.
|
|
|
|
*
|
|
|
|
* @param aEnabled if PR_TRUE, visual selection effects are enabled
|
|
|
|
* if PR_FALSE visual selection effects are disabled
|
|
|
|
* @return always NS_OK
|
|
|
|
*/
|
2001-12-18 01:29:49 +00:00
|
|
|
NS_IMETHOD SetSelectionFlags(PRInt16 aInEnable) = 0;
|
1999-08-04 20:46:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the current state of non text selection effects
|
|
|
|
* @param aEnabled [OUT] set to the current state of non text selection,
|
|
|
|
* as set by SetDisplayNonTextSelection
|
|
|
|
* @return if aOutEnabled==null, returns NS_ERROR_INVALID_ARG
|
|
|
|
* else NS_OK
|
|
|
|
*/
|
2001-12-18 01:29:49 +00:00
|
|
|
NS_IMETHOD GetSelectionFlags(PRInt16 *aOutEnabled) = 0;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
virtual nsISelection* GetCurrentSelection(SelectionType aType) = 0;
|
1999-05-17 00:21:18 +00:00
|
|
|
|
2000-04-24 04:41:27 +00:00
|
|
|
/**
|
|
|
|
* Interface to dispatch events via the presshell
|
2007-03-26 05:38:22 +00:00
|
|
|
* @note The caller must have a strong reference to the PresShell.
|
2000-04-24 04:41:27 +00:00
|
|
|
*/
|
2006-03-07 17:08:51 +00:00
|
|
|
NS_IMETHOD HandleEventWithTarget(nsEvent* aEvent,
|
|
|
|
nsIFrame* aFrame,
|
2000-09-20 07:20:23 +00:00
|
|
|
nsIContent* aContent,
|
2000-04-24 04:41:27 +00:00
|
|
|
nsEventStatus* aStatus) = 0;
|
|
|
|
|
2000-06-29 02:02:43 +00:00
|
|
|
/**
|
|
|
|
* Dispatch event to content only (NOT full processing)
|
2007-03-26 05:38:22 +00:00
|
|
|
* @note The caller must have a strong reference to the PresShell.
|
2000-06-29 02:02:43 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD HandleDOMEventWithTarget(nsIContent* aTargetContent,
|
2006-03-07 17:08:51 +00:00
|
|
|
nsEvent* aEvent,
|
|
|
|
nsEventStatus* aStatus) = 0;
|
2000-06-29 02:02:43 +00:00
|
|
|
|
2000-06-24 03:58:13 +00:00
|
|
|
/**
|
|
|
|
* Gets the current target event frame from the PresShell
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetEventTargetFrame(nsIFrame** aFrame) = 0;
|
|
|
|
|
2003-02-14 21:43:06 +00:00
|
|
|
/**
|
|
|
|
* Gets the current target event frame from the PresShell
|
|
|
|
*/
|
|
|
|
NS_IMETHOD GetEventTargetContent(nsEvent* aEvent, nsIContent** aContent) = 0;
|
|
|
|
|
1999-08-30 22:38:58 +00:00
|
|
|
/**
|
1999-08-31 14:35:50 +00:00
|
|
|
* Get and set the history state for the current document
|
1999-08-30 22:38:58 +00:00
|
|
|
*/
|
1999-12-06 07:44:18 +00:00
|
|
|
|
2000-06-15 00:35:46 +00:00
|
|
|
NS_IMETHOD CaptureHistoryState(nsILayoutHistoryState** aLayoutHistoryState, PRBool aLeavingPage = PR_FALSE) = 0;
|
1998-07-13 19:49:20 +00:00
|
|
|
|
2000-02-09 15:48:01 +00:00
|
|
|
/**
|
|
|
|
* Determine if reflow is currently locked
|
|
|
|
* @param aIsReflowLocked returns PR_TRUE if reflow is locked, PR_FALSE otherwise
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsReflowLocked(PRBool* aIsLocked) = 0;
|
|
|
|
|
2001-04-25 19:52:49 +00:00
|
|
|
/**
|
|
|
|
* Called to find out if painting is suppressed for this presshell. If it is suppressd,
|
|
|
|
* we don't allow the painting of any layer but the background, and we don't
|
|
|
|
* recur into our children.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD IsPaintingSuppressed(PRBool* aResult)=0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unsuppress painting.
|
|
|
|
*/
|
2001-05-01 22:54:11 +00:00
|
|
|
NS_IMETHOD UnsuppressPainting() = 0;
|
2001-04-25 19:52:49 +00:00
|
|
|
|
2002-09-21 01:03:38 +00:00
|
|
|
/**
|
|
|
|
* Called to disable nsITheme support in a specific presshell.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD DisableThemeSupport() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether theme support is enabled.
|
|
|
|
*/
|
|
|
|
virtual PRBool IsThemeSupportEnabled() = 0;
|
|
|
|
|
2004-01-07 22:30:53 +00:00
|
|
|
/**
|
|
|
|
* Get the set of agent style sheets for this presentation
|
|
|
|
*/
|
|
|
|
virtual nsresult GetAgentStyleSheets(nsCOMArray<nsIStyleSheet>& aSheets) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replace the set of agent style sheets
|
|
|
|
*/
|
|
|
|
virtual nsresult SetAgentStyleSheets(const nsCOMArray<nsIStyleSheet>& aSheets) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an override style sheet for this presentation
|
|
|
|
*/
|
|
|
|
virtual nsresult AddOverrideStyleSheet(nsIStyleSheet *aSheet) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an override style sheet
|
|
|
|
*/
|
|
|
|
virtual nsresult RemoveOverrideStyleSheet(nsIStyleSheet *aSheet) = 0;
|
|
|
|
|
2004-01-21 23:05:10 +00:00
|
|
|
/**
|
|
|
|
* Reconstruct frames for all elements in the document
|
|
|
|
*/
|
|
|
|
virtual nsresult ReconstructFrames() = 0;
|
|
|
|
|
2007-09-05 08:00:40 +00:00
|
|
|
/**
|
|
|
|
* Given aFrame, the root frame of a stacking context, find its descendant
|
|
|
|
* frame under the point aPt that receives a mouse event at that location,
|
|
|
|
* or nsnull if there is no such frame.
|
|
|
|
* @param aPt the point, relative to the frame origin
|
|
|
|
*/
|
|
|
|
virtual nsIFrame* GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt) = 0;
|
|
|
|
|
1998-07-13 19:49:20 +00:00
|
|
|
/**
|
|
|
|
* See if reflow verification is enabled. To enable reflow verification add
|
|
|
|
* "verifyreflow:1" to your NSPR_LOG_MODULES environment variable
|
|
|
|
* (any non-zero debug level will work). Or, call SetVerifyReflowEnable
|
|
|
|
* with PR_TRUE.
|
|
|
|
*/
|
2001-10-23 01:37:21 +00:00
|
|
|
static PRBool GetVerifyReflowEnable();
|
1998-07-13 19:49:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the verify-reflow enable flag.
|
|
|
|
*/
|
2001-10-23 01:37:21 +00:00
|
|
|
static void SetVerifyReflowEnable(PRBool aEnabled);
|
1999-08-30 22:38:58 +00:00
|
|
|
|
2000-03-22 23:19:10 +00:00
|
|
|
/**
|
|
|
|
* Get the flags associated with the VerifyReflow debug tool
|
|
|
|
*/
|
2001-10-23 01:37:21 +00:00
|
|
|
static PRInt32 GetVerifyReflowFlags();
|
2000-04-21 14:59:47 +00:00
|
|
|
|
2008-01-22 07:39:06 +00:00
|
|
|
virtual nsIFrame* GetAbsoluteContainingBlock(nsIFrame* aFrame);
|
|
|
|
|
2000-04-21 14:59:47 +00:00
|
|
|
#ifdef MOZ_REFLOW_PERF
|
2000-04-28 23:31:13 +00:00
|
|
|
NS_IMETHOD DumpReflows() = 0;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
NS_IMETHOD CountReflows(const char * aName, nsIFrame * aFrame) = 0;
|
2001-03-13 01:47:22 +00:00
|
|
|
NS_IMETHOD PaintCount(const char * aName,
|
|
|
|
nsIRenderingContext* aRenderingContext,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext * aPresContext,
|
2001-03-13 01:47:22 +00:00
|
|
|
nsIFrame * aFrame,
|
|
|
|
PRUint32 aColor) = 0;
|
|
|
|
NS_IMETHOD SetPaintFrameCount(PRBool aOn) = 0;
|
2000-04-21 14:59:47 +00:00
|
|
|
#endif
|
|
|
|
|
2004-01-07 22:30:53 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
// Debugging hooks
|
|
|
|
virtual void ListStyleContexts(nsIFrame *aRootFrame, FILE *out,
|
|
|
|
PRInt32 aIndent = 0) = 0;
|
|
|
|
|
|
|
|
virtual void ListStyleSheets(FILE *out, PRInt32 aIndent = 0) = 0;
|
2005-11-06 18:01:17 +00:00
|
|
|
virtual void VerifyStyleTree() = 0;
|
2004-01-07 22:30:53 +00:00
|
|
|
#endif
|
|
|
|
|
2007-05-04 02:19:18 +00:00
|
|
|
static PRBool gIsAccessibilityActive;
|
|
|
|
static PRBool IsAccessibilityActive() { return gIsAccessibilityActive; }
|
2005-05-03 03:46:51 +00:00
|
|
|
|
2005-05-04 20:22:32 +00:00
|
|
|
/**
|
|
|
|
* Stop all active elements (plugins and the caret) in this presentation and
|
2005-07-01 07:12:02 +00:00
|
|
|
* in the presentations of subdocuments. Resets painting to a suppressed state.
|
2005-05-04 20:22:32 +00:00
|
|
|
* XXX this should include image animations
|
|
|
|
*/
|
|
|
|
virtual void Freeze() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restarts active elements (plugins) in this presentation and in the
|
2005-07-01 07:12:02 +00:00
|
|
|
* presentations of subdocuments, then do a full invalidate of the content area.
|
2005-05-04 20:22:32 +00:00
|
|
|
*/
|
2005-07-19 17:07:40 +00:00
|
|
|
virtual void Thaw() = 0;
|
2005-05-04 20:22:32 +00:00
|
|
|
|
2009-03-03 20:20:11 +00:00
|
|
|
virtual void NeedsFocusOrBlurAfterSuppression(nsPIDOMEventTarget* aTarget, PRUint32 aEventType) = 0;
|
2009-03-03 20:11:14 +00:00
|
|
|
virtual void FireOrClearDelayedEvents(PRBool aFireEvents) = 0;
|
|
|
|
|
2005-08-22 01:55:34 +00:00
|
|
|
/**
|
|
|
|
* When this shell is disconnected from its containing docshell, we
|
|
|
|
* lose our container pointer. However, we'd still like to be able to target
|
|
|
|
* user events at the docshell's parent. This pointer allows us to do that.
|
|
|
|
* It should not be used for any other purpose.
|
|
|
|
*/
|
2005-08-22 19:46:25 +00:00
|
|
|
void SetForwardingContainer(nsWeakPtr aContainer)
|
|
|
|
{
|
|
|
|
mForwardingContainer = aContainer;
|
|
|
|
}
|
2006-01-26 02:29:17 +00:00
|
|
|
|
|
|
|
/**
|
2007-05-23 00:11:05 +00:00
|
|
|
* Render the document into an arbitrary gfxContext
|
|
|
|
* Designed for getting a picture of a document or a piece of a document
|
|
|
|
* Note that callers will generally want to call FlushPendingNotifications
|
|
|
|
* to get an up-to-date view of the document
|
2006-01-26 02:29:17 +00:00
|
|
|
* @param aRect is the region to capture into the offscreen buffer, in the
|
|
|
|
* root frame's coordinate system (if aIgnoreViewportScrolling is false)
|
|
|
|
* or in the root scrolled frame's coordinate system
|
2007-11-08 04:43:36 +00:00
|
|
|
* (if aIgnoreViewportScrolling is true). The coordinates are in appunits.
|
2008-12-12 10:50:31 +00:00
|
|
|
* @param aFlags see below;
|
|
|
|
* set RENDER_IS_UNTRUSTED if the contents may be passed to malicious
|
2006-01-26 02:29:17 +00:00
|
|
|
* agents. E.g. we might choose not to paint the contents of sensitive widgets
|
|
|
|
* such as the file name in a file upload widget, and we might choose not
|
|
|
|
* to paint themes.
|
2008-12-12 10:50:31 +00:00
|
|
|
* set RENDER_IGNORE_VIEWPORT_SCROLLING to ignore
|
|
|
|
* clipping/scrolling/scrollbar painting due to scrolling in the viewport
|
|
|
|
* set RENDER_CARET to draw the caret if one would be visible
|
|
|
|
* (by default the caret is never drawn)
|
2006-01-26 02:29:17 +00:00
|
|
|
* @param aBackgroundColor a background color to render onto
|
2007-11-08 04:43:36 +00:00
|
|
|
* @param aRenderedContext the gfxContext to render to. We render so that
|
|
|
|
* one CSS pixel in the source document is rendered to one unit in the current
|
|
|
|
* transform.
|
2007-05-23 00:11:05 +00:00
|
|
|
*/
|
2008-12-12 10:50:31 +00:00
|
|
|
enum {
|
|
|
|
RENDER_IS_UNTRUSTED = 0x01,
|
|
|
|
RENDER_IGNORE_VIEWPORT_SCROLLING = 0x02,
|
|
|
|
RENDER_CARET = 0x04
|
|
|
|
};
|
|
|
|
NS_IMETHOD RenderDocument(const nsRect& aRect, PRUint32 aFlags,
|
2007-05-23 00:11:05 +00:00
|
|
|
nscolor aBackgroundColor,
|
|
|
|
gfxContext* aRenderedContext) = 0;
|
2005-08-22 01:55:34 +00:00
|
|
|
|
2007-03-20 12:14:52 +00:00
|
|
|
/**
|
|
|
|
* Renders a node aNode to a surface and returns it. The aRegion may be used
|
|
|
|
* to clip the rendering. This region is measured in device pixels from the
|
|
|
|
* edge of the presshell area. The aPoint, aScreenRect and aSurface
|
|
|
|
* arguments function in a similar manner as RenderSelection.
|
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxASurface> RenderNode(nsIDOMNode* aNode,
|
|
|
|
nsIRegion* aRegion,
|
2009-01-15 03:27:09 +00:00
|
|
|
nsIntPoint& aPoint,
|
|
|
|
nsIntRect* aScreenRect) = 0;
|
2007-03-20 12:14:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Renders a selection to a surface and returns it. This method is primarily
|
|
|
|
* intended to create the drag feedback when dragging a selection.
|
|
|
|
*
|
|
|
|
* aScreenRect will be filled in with the bounding rectangle of the
|
|
|
|
* selection area on screen.
|
|
|
|
*
|
|
|
|
* If the area of the selection is large, the image will be scaled down.
|
|
|
|
* The argument aPoint is used in this case as a reference point when
|
|
|
|
* determining the new screen rectangle after scaling. Typically, this
|
|
|
|
* will be the mouse position, so that the screen rectangle is positioned
|
|
|
|
* such that the mouse is over the same point in the scaled image as in
|
|
|
|
* the original. When scaling does not occur, the mouse point isn't used
|
|
|
|
* as the position can be determined from the displayed frames.
|
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxASurface> RenderSelection(nsISelection* aSelection,
|
2009-01-15 03:27:09 +00:00
|
|
|
nsIntPoint& aPoint,
|
|
|
|
nsIntRect* aScreenRect) = 0;
|
2007-03-20 12:14:52 +00:00
|
|
|
|
2006-07-12 07:41:11 +00:00
|
|
|
void AddWeakFrame(nsWeakFrame* aWeakFrame);
|
|
|
|
void RemoveWeakFrame(nsWeakFrame* aWeakFrame);
|
2007-02-20 20:22:19 +00:00
|
|
|
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
nsIFrame* GetDrawEventTargetFrame() { return mDrawEventTargetFrame; }
|
|
|
|
#endif
|
|
|
|
|
2009-02-12 10:44:38 +00:00
|
|
|
/**
|
|
|
|
* Stop or restart non synthetic test mouse event handling on *all*
|
|
|
|
* presShells.
|
|
|
|
*
|
2009-02-23 01:10:23 +00:00
|
|
|
* @param aDisable If true, disable all non synthetic test mouse
|
|
|
|
* events on all presShells. Otherwise, enable them.
|
2009-02-12 10:44:38 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD DisableNonTestMouseEvents(PRBool aDisable) = 0;
|
|
|
|
|
2009-02-23 01:10:23 +00:00
|
|
|
/* Record the background color of the most recently loaded canvas.
|
|
|
|
* This color is composited on top of the user's default background
|
|
|
|
* color whenever we need to provide an "ultimate" background color.
|
|
|
|
* See PresShell::Paint, PresShell::PaintDefaultBackground, and
|
|
|
|
* nsDocShell::SetupNewViewer; bug 476557 and other bugs mentioned there.
|
|
|
|
*/
|
|
|
|
void SetCanvasBackground(nscolor aColor) { mCanvasBackgroundColor = aColor; }
|
|
|
|
nscolor GetCanvasBackground() { return mCanvasBackgroundColor; }
|
|
|
|
|
2003-06-19 18:16:53 +00:00
|
|
|
protected:
|
|
|
|
// IMPORTANT: The ownership implicit in the following member variables
|
|
|
|
// has been explicitly checked. If you add any members to this class,
|
|
|
|
// please make the ownership explicit (pinkerton, scc).
|
|
|
|
|
|
|
|
// these are the same Document and PresContext owned by the DocViewer.
|
|
|
|
// we must share ownership.
|
|
|
|
nsIDocument* mDocument; // [STRONG]
|
2004-08-29 03:08:44 +00:00
|
|
|
nsPresContext* mPresContext; // [STRONG]
|
2004-01-08 19:23:12 +00:00
|
|
|
nsStyleSet* mStyleSet; // [OWNS]
|
2004-01-21 23:05:10 +00:00
|
|
|
nsCSSFrameConstructor* mFrameConstructor; // [OWNS]
|
2003-06-19 18:16:53 +00:00
|
|
|
nsIViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
|
2006-04-26 02:01:07 +00:00
|
|
|
nsFrameSelection* mSelection;
|
2004-03-06 04:46:11 +00:00
|
|
|
nsFrameManagerBase mFrameManager; // [OWNS]
|
2005-08-22 01:55:34 +00:00
|
|
|
nsWeakPtr mForwardingContainer;
|
2004-08-29 03:08:44 +00:00
|
|
|
|
2007-02-20 20:22:19 +00:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
nsIFrame* mDrawEventTargetFrame;
|
|
|
|
#endif
|
|
|
|
|
2004-08-29 03:08:44 +00:00
|
|
|
PRPackedBool mStylesHaveChanged;
|
2005-11-06 18:01:17 +00:00
|
|
|
PRPackedBool mDidInitialReflow;
|
2005-11-08 04:07:13 +00:00
|
|
|
PRPackedBool mIsDestroying;
|
2005-05-03 03:46:51 +00:00
|
|
|
|
2005-06-10 13:57:27 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
/**
|
|
|
|
* Call this when there have been significant changes in the rendering for
|
|
|
|
* a content subtree, so the matching accessibility subtree can be invalidated
|
|
|
|
*/
|
|
|
|
void InvalidateAccessibleSubtree(nsIContent *aContent);
|
|
|
|
#endif
|
|
|
|
|
2005-05-03 03:46:51 +00:00
|
|
|
// Set to true when the accessibility service is being used to mirror
|
|
|
|
// the dom/layout trees
|
2006-07-12 07:41:11 +00:00
|
|
|
PRPackedBool mIsAccessibilityActive;
|
|
|
|
|
|
|
|
// A list of weak frames. This is a pointer to the last item in the list.
|
|
|
|
nsWeakFrame* mWeakFrames;
|
2009-02-23 01:10:23 +00:00
|
|
|
|
|
|
|
// Most recent canvas background color.
|
|
|
|
nscolor mCanvasBackgroundColor;
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new empty presentation shell. Upon success, call Init
|
|
|
|
* before attempting to use the shell.
|
|
|
|
*/
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
|
|
|
NS_NewPresShell(nsIPresShell** aInstancePtrResult);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
#endif /* nsIPresShell_h___ */
|