Backout 3635e6adde70, 8600c8ad593f and 1f72556326be (bug 960848 and bug 960899) for lots of red.

This commit is contained in:
Cameron McCormack 2014-01-18 19:03:30 +11:00
parent dada6408b8
commit 5e41a164a1
39 changed files with 498 additions and 814 deletions

View File

@ -885,7 +885,7 @@ nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShe
mFloatedItems(aFloatContainingBlock), mFloatedItems(aFloatContainingBlock),
// See PushAbsoluteContaningBlock below // See PushAbsoluteContaningBlock below
mFrameState(aHistoryState), mFrameState(aHistoryState),
mAdditionalStateBits(nsFrameState(0)), mAdditionalStateBits(0),
// If the fixed-pos containing block is equal to the abs-pos containing // If the fixed-pos containing block is equal to the abs-pos containing
// block, use the abs-pos containing block's abs-pos list for fixed-pos // block, use the abs-pos containing block's abs-pos list for fixed-pos
// frames. // frames.
@ -919,7 +919,7 @@ nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell,
mAbsoluteItems(aAbsoluteContainingBlock), mAbsoluteItems(aAbsoluteContainingBlock),
mFloatedItems(aFloatContainingBlock), mFloatedItems(aFloatContainingBlock),
// See PushAbsoluteContaningBlock below // See PushAbsoluteContaningBlock below
mAdditionalStateBits(nsFrameState(0)), mAdditionalStateBits(0),
// If the fixed-pos containing block is equal to the abs-pos containing // If the fixed-pos containing block is equal to the abs-pos containing
// block, use the abs-pos containing block's abs-pos list for fixed-pos // block, use the abs-pos containing block's abs-pos list for fixed-pos
// frames. // frames.
@ -2875,7 +2875,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
// a dropdown list. The display area and button are created through anonymous content. // a dropdown list. The display area and button are created through anonymous content.
// The drop-down list's frame is created explicitly. The combobox frame shares its content // The drop-down list's frame is created explicitly. The combobox frame shares its content
// with the drop-down list. // with the drop-down list.
nsFrameState flags = NS_BLOCK_FLOAT_MGR; uint32_t flags = NS_BLOCK_FLOAT_MGR;
nsIFrame* comboboxFrame = NS_NewComboboxControlFrame(mPresShell, styleContext, flags); nsIFrame* comboboxFrame = NS_NewComboboxControlFrame(mPresShell, styleContext, flags);
// Save the history state so we don't restore during construction // Save the history state so we don't restore during construction
@ -8051,7 +8051,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
newFrame->Init(content, aParentFrame, aFrame); newFrame->Init(content, aParentFrame, aFrame);
#endif #endif
} else if (nsGkAtoms::columnSetFrame == frameType) { } else if (nsGkAtoms::columnSetFrame == frameType) {
newFrame = NS_NewColumnSetFrame(shell, styleContext, nsFrameState(0)); newFrame = NS_NewColumnSetFrame(shell, styleContext, 0);
newFrame->Init(content, aParentFrame, aFrame); newFrame->Init(content, aParentFrame, aFrame);
} else if (nsGkAtoms::pageFrame == frameType) { } else if (nsGkAtoms::pageFrame == frameType) {
nsIFrame* canvasFrame; nsIFrame* canvasFrame;
@ -10330,8 +10330,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO
|| columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) { || columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) {
nsIFrame* columnSetFrame = nullptr; nsIFrame* columnSetFrame = nullptr;
columnSetFrame = columnSetFrame = NS_NewColumnSetFrame(mPresShell, aStyleContext, 0);
NS_NewColumnSetFrame(mPresShell, aStyleContext, nsFrameState(0));
InitAndRestoreFrame(aState, aContent, aParentFrame, columnSetFrame); InitAndRestoreFrame(aState, aContent, aParentFrame, columnSetFrame);
blockStyle = mPresShell->StyleSet()-> blockStyle = mPresShell->StyleSet()->

View File

@ -41,7 +41,6 @@
#include "nsPresArena.h" #include "nsPresArena.h"
#include "nsIImageLoadingContent.h" #include "nsIImageLoadingContent.h"
#include "nsMargin.h" #include "nsMargin.h"
#include "nsFrameState.h"
class nsIContent; class nsIContent;
class nsDocShell; class nsDocShell;
@ -93,6 +92,7 @@ class nsIWidget;
struct nsArenaMemoryStats; struct nsArenaMemoryStats;
typedef short SelectionType; typedef short SelectionType;
typedef uint64_t nsFrameState;
namespace mozilla { namespace mozilla {
class Selection; class Selection;

View File

@ -98,7 +98,7 @@ NS_IMPL_ISUPPORTS1(nsComboButtonListener,
nsComboboxControlFrame* nsComboboxControlFrame::sFocused = nullptr; nsComboboxControlFrame* nsComboboxControlFrame::sFocused = nullptr;
nsIFrame* nsIFrame*
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags) NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aStateFlags)
{ {
nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame(aContext); nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame(aContext);

View File

@ -46,7 +46,7 @@ class nsComboboxControlFrame : public nsBlockFrame,
public nsIStatefulFrame public nsIStatefulFrame
{ {
public: public:
friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
friend class nsComboboxDisplayFrame; friend class nsComboboxDisplayFrame;
nsComboboxControlFrame(nsStyleContext* aContext); nsComboboxControlFrame(nsStyleContext* aContext);

View File

@ -8,7 +8,7 @@
#include "nsDisplayList.h" #include "nsDisplayList.h"
nsIFrame* nsIFrame*
NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags) NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, uint32_t aFlags)
{ {
nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame(aContext); nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame(aContext);

View File

@ -13,7 +13,7 @@ class nsSelectsAreaFrame : public nsBlockFrame
public: public:
NS_DECL_FRAMEARENA_HELPERS NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags); friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, uint32_t aFlags);
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,

View File

@ -12,8 +12,6 @@ EXPORTS += [
'nsFrameIdList.h', 'nsFrameIdList.h',
'nsFrameList.h', 'nsFrameList.h',
'nsFrameSelection.h', 'nsFrameSelection.h',
'nsFrameState.h',
'nsFrameStateBits.h',
'nsHTMLParts.h', 'nsHTMLParts.h',
'nsHTMLReflowMetrics.h', 'nsHTMLReflowMetrics.h',
'nsHTMLReflowState.h', 'nsHTMLReflowState.h',
@ -63,7 +61,6 @@ UNIFIED_SOURCES += [
'nsFrame.cpp', 'nsFrame.cpp',
'nsFrameList.cpp', 'nsFrameList.cpp',
'nsFrameSetFrame.cpp', 'nsFrameSetFrame.cpp',
'nsFrameState.cpp',
'nsFrameUtil.cpp', 'nsFrameUtil.cpp',
'nsGfxScrollFrame.cpp', 'nsGfxScrollFrame.cpp',
'nsHTMLCanvasFrame.cpp', 'nsHTMLCanvasFrame.cpp',
@ -126,4 +123,4 @@ LOCAL_INCLUDES += [
'../xul', '../xul',
] ]
JAR_MANIFESTS += ['jar.mn'] JAR_MANIFESTS += ['jar.mn']

View File

@ -245,7 +245,7 @@ NS_DECLARE_FRAME_PROPERTY(InsideBulletProperty, nullptr)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
nsIFrame* nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags) NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags)
{ {
nsBlockFrame* it = new (aPresShell) nsBlockFrame(aContext); nsBlockFrame* it = new (aPresShell) nsBlockFrame(aContext);
it->SetFlags(aFlags); it->SetFlags(aFlags);

View File

@ -70,6 +70,39 @@ class nsFirstLineFrame;
* prepended to the overflow lines. * prepended to the overflow lines.
*/ */
// see nsHTMLParts.h for the public block state bits
/**
* Something in the block has changed that requires Bidi resolution to be
* performed on the block. This flag must be either set on all blocks in a
* continuation chain or none of them.
*/
#define NS_BLOCK_NEEDS_BIDI_RESOLUTION NS_FRAME_STATE_BIT(20)
#define NS_BLOCK_HAS_PUSHED_FLOATS NS_FRAME_STATE_BIT(21)
#define NS_BLOCK_HAS_LINE_CURSOR NS_FRAME_STATE_BIT(24)
#define NS_BLOCK_HAS_OVERFLOW_LINES NS_FRAME_STATE_BIT(25)
#define NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS NS_FRAME_STATE_BIT(26)
// Set on any block that has descendant frames in the normal
// flow with 'clear' set to something other than 'none'
// (including <BR CLEAR="..."> frames)
#define NS_BLOCK_HAS_CLEAR_CHILDREN NS_FRAME_STATE_BIT(27)
// This block has had a child marked dirty, so before we reflow we need
// to look through the lines to find any such children and mark
// appropriate lines dirty.
#define NS_BLOCK_LOOK_FOR_DIRTY_FRAMES NS_FRAME_STATE_BIT(61)
// Are our cached intrinsic widths intrinsic widths for font size
// inflation? i.e., what was the current state of
// GetPresContext()->mInflationDisabledForShrinkWrap at the time they
// were computed?
// nsBlockFrame is the only thing that caches intrinsic widths that
// needs to track this because it's the only thing that caches intrinsic
// widths that lives inside of things (form controls) that do intrinsic
// sizing with font inflation enabled.
#define NS_BLOCK_FRAME_INTRINSICS_INFLATED NS_FRAME_STATE_BIT(62)
#define nsBlockFrameSuper nsContainerFrame #define nsBlockFrameSuper nsContainerFrame
/* /*
@ -99,7 +132,7 @@ public:
line_iterator line(nsLineBox* aList) { return mLines.begin(aList); } line_iterator line(nsLineBox* aList) { return mLines.begin(aList); }
reverse_line_iterator rline(nsLineBox* aList) { return mLines.rbegin(aList); } reverse_line_iterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
// nsQueryFrame // nsQueryFrame
NS_DECL_QUERYFRAME NS_DECL_QUERYFRAME

View File

@ -35,12 +35,6 @@ NS_DECLARE_FRAME_PROPERTY(FontSizeInflationProperty, nullptr)
NS_IMPL_FRAMEARENA_HELPERS(nsBulletFrame) NS_IMPL_FRAMEARENA_HELPERS(nsBulletFrame)
#ifdef DEBUG
NS_QUERYFRAME_HEAD(nsBulletFrame)
NS_QUERYFRAME_ENTRY(nsBulletFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsFrame)
#endif
nsBulletFrame::~nsBulletFrame() nsBulletFrame::~nsBulletFrame()
{ {
} }

View File

@ -16,6 +16,9 @@
class imgIContainer; class imgIContainer;
class imgRequestProxy; class imgRequestProxy;
#define BULLET_FRAME_IMAGE_LOADING NS_FRAME_STATE_BIT(63)
#define BULLET_FRAME_HAS_FONT_INFLATION NS_FRAME_STATE_BIT(62)
class nsBulletFrame; class nsBulletFrame;
class nsBulletListener : public imgINotificationObserver class nsBulletListener : public imgINotificationObserver
@ -40,10 +43,6 @@ private:
class nsBulletFrame : public nsFrame { class nsBulletFrame : public nsFrame {
public: public:
NS_DECL_FRAMEARENA_HELPERS NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_DECL_QUERYFRAME_TARGET(nsBulletFrame)
NS_DECL_QUERYFRAME
#endif
nsBulletFrame(nsStyleContext* aContext) nsBulletFrame(nsStyleContext* aContext)
: nsFrame(aContext) : nsFrame(aContext)

View File

@ -21,7 +21,7 @@ using namespace mozilla::layout;
* XXX should we support CSS columns applied to table elements? * XXX should we support CSS columns applied to table elements?
*/ */
nsIFrame* nsIFrame*
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags) NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aStateFlags)
{ {
nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aContext); nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aContext);
it->AddStateBits(aStateFlags | NS_BLOCK_MARGIN_ROOT); it->AddStateBits(aStateFlags | NS_BLOCK_MARGIN_ROOT);

View File

@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* constants for frame state bits and a type to store them in a uint64_t */
#include "nsFrameState.h"
#include "nsBlockFrame.h"
#include "nsBoxFrame.h"
#include "nsBulletFrame.h"
#include "nsGfxScrollFrame.h"
#include "nsIFrame.h"
#include "nsISVGChildFrame.h"
#include "nsImageFrame.h"
#include "nsInlineFrame.h"
#include "nsPlaceholderFrame.h"
#include "nsSVGContainerFrame.h"
#include "nsTableCellFrame.h"
#include "nsTableRowFrame.h"
#include "nsTableRowGroupFrame.h"
#include "nsTextFrame.h"
namespace mozilla {
#ifdef DEBUG
nsCString
GetFrameState(nsIFrame* aFrame)
{
nsCString result;
nsAutoTArray<const char*,3> groups;
nsFrameState state = aFrame->GetStateBits();
if (state == nsFrameState(0)) {
result.AssignLiteral("0");
return result;
}
#define FRAME_STATE_GROUP(name_, class_) \
{ \
class_* frame = do_QueryFrame(aFrame); \
if (frame && (groups.IsEmpty() || strcmp(groups.LastElement(), #name_))) {\
groups.AppendElement(#name_); \
} \
}
#define FRAME_STATE_BIT(group_, value_, name_) \
if ((state & NS_FRAME_STATE_BIT(value_)) && groups.Contains(#group_)) { \
if (!result.IsEmpty()) { \
result.Insert(" | ", 0); \
} \
result.Insert(#name_, 0); \
state = state & ~NS_FRAME_STATE_BIT(value_); \
}
#include "nsFrameStateBits.h"
#undef FRAME_STATE_GROUP
#undef FRAME_STATE_BIT
if (state) {
result.AppendPrintf(" | 0x%0llx", state);
}
return result;
}
void
PrintFrameState(nsIFrame* aFrame)
{
printf("%s\n", GetFrameState(aFrame).get());
}
#endif
} // namespace mozilla

View File

@ -1,73 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* constants for frame state bits and a type to store them in a uint64_t */
#ifndef nsFrameState_h_
#define nsFrameState_h_
class nsIFrame;
typedef uint64_t nsFrameState_size_t;
#define NS_FRAME_STATE_BIT(n_) (nsFrameState(nsFrameState_size_t(1) << (n_)))
enum nsFrameState : nsFrameState_size_t {
#define FRAME_STATE_BIT(group_, value_, name_) \
name_ = NS_FRAME_STATE_BIT(value_),
#include "nsFrameStateBits.h"
#undef FRAME_STATE_BIT
};
inline nsFrameState operator|(nsFrameState aLeft, nsFrameState aRight)
{
return nsFrameState(nsFrameState_size_t(aLeft) | nsFrameState_size_t(aRight));
}
inline nsFrameState operator&(nsFrameState aLeft, nsFrameState aRight)
{
return nsFrameState(nsFrameState_size_t(aLeft) & nsFrameState_size_t(aRight));
}
inline nsFrameState& operator|=(nsFrameState& aLeft, nsFrameState aRight)
{
aLeft = aLeft | aRight;
return aLeft;
}
inline nsFrameState& operator&=(nsFrameState& aLeft, nsFrameState aRight)
{
aLeft = aLeft & aRight;
return aLeft;
}
inline nsFrameState operator~(nsFrameState aRight)
{
return nsFrameState(~nsFrameState_size_t(aRight));
}
inline nsFrameState operator^(nsFrameState aLeft, nsFrameState aRight)
{
return nsFrameState(nsFrameState_size_t(aLeft) ^ nsFrameState_size_t(aRight));
}
inline nsFrameState& operator^=(nsFrameState& aLeft, nsFrameState aRight)
{
aLeft = aLeft ^ aRight;
return aLeft;
}
// Bits 20-31 and 60-63 of the frame state are reserved for implementations.
#define NS_FRAME_IMPL_RESERVED nsFrameState(0xF0000000FFF00000)
#define NS_FRAME_RESERVED ~NS_FRAME_IMPL_RESERVED
namespace mozilla {
#ifdef DEBUG
nsCString GetFrameState(nsIFrame* aFrame);
void PrintFrameState(nsIFrame* aFrame);
#endif
}
#endif /* nsFrameState_h_ */

View File

@ -1,581 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/* a list of all frame state bits, for preprocessing */
/******
This file contains definitions for frame state bits -- values used
in nsIFrame::mState -- and groups of frame state bits and which
classes they apply to.
There are two macros that can be defined before #including this
file:
FRAME_STATE_GROUP(name_, class_)
This denotes the existence of a named group of frame state bits.
name_ is the name of the group and class_ is the name of a frame
class that uses the frame state bits that are a part of the group.
The main group of frame state bits is named "Generic" and is
defined to apply to nsIFrame, i.e. all frames. All of the global
frame state bits -- bits 0..19 and 32..59 -- are in this group.
FRAME_STATE_BIT(group_, value_, name_)
This denotes the existence of a frame state bit. group_ indicates
which group the bit belongs to, value_ is the bit number (0..63),
and name_ is the name of the frame state bit constant.
Note that if you add a new frame state group, you'll need to #include
the header for its frame classes in nsFrameState.cpp and, if they don't
already, add nsQueryFrame implementations (which can be DEBUG-only) to
the frame classes.
******/
#ifndef FRAME_STATE_GROUP
#define FRAME_STATE_GROUP(name_, class_) /* nothing */
#define DEFINED_FRAME_STATE_GROUP
#endif
#ifndef FRAME_STATE_BIT
#define FRAME_STATE_BIT(group_, value_, name_) /* nothing */
#define DEFINED_FRAME_STATE_BIT
#endif
// == Frame state bits that apply to all frames ===============================
FRAME_STATE_GROUP(Generic, nsIFrame)
FRAME_STATE_BIT(Generic, 0, NS_FRAME_IN_REFLOW)
// This bit is set when a frame is created. After it has been reflowed
// once (during the DidReflow with a finished state) the bit is
// cleared.
FRAME_STATE_BIT(Generic, 1, NS_FRAME_FIRST_REFLOW)
// For a continuation frame, if this bit is set, then this a "fluid"
// continuation, i.e., across a line boundary. Otherwise it's a "hard"
// continuation, e.g. a bidi continuation.
FRAME_STATE_BIT(Generic, 2, NS_FRAME_IS_FLUID_CONTINUATION)
// For nsIAnonymousContentCreator content that's created using ContentInfo.
FRAME_STATE_BIT(Generic, 3, NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT)
// If this bit is set, then a reference to the frame is being held
// elsewhere. The frame may want to send a notification when it is
// destroyed to allow these references to be cleared.
FRAME_STATE_BIT(Generic, 4, NS_FRAME_EXTERNAL_REFERENCE)
// If this bit is set, this frame or one of its descendants has a
// percentage height that depends on an ancestor of this frame.
// (Or it did at one point in the past, since we don't necessarily clear
// the bit when it's no longer needed; it's an optimization.)
FRAME_STATE_BIT(Generic, 5, NS_FRAME_CONTAINS_RELATIVE_HEIGHT)
// If this bit is set, then the frame corresponds to generated content
FRAME_STATE_BIT(Generic, 6, NS_FRAME_GENERATED_CONTENT)
// If this bit is set the frame is a continuation that is holding overflow,
// i.e. it is a next-in-flow created to hold overflow after the box's
// height has ended. This means the frame should be a) at the top of the
// page and b) invisible: no borders, zero height, ignored in margin
// collapsing, etc. See nsContainerFrame.h
FRAME_STATE_BIT(Generic, 7, NS_FRAME_IS_OVERFLOW_CONTAINER)
// If this bit is set, then the frame has been moved out of the flow,
// e.g., it is absolutely positioned or floated
FRAME_STATE_BIT(Generic, 8, NS_FRAME_OUT_OF_FLOW)
// Frame can be an abs/fixed pos. container, if its style says so.
// MarkAs[Not]AbsoluteContainingBlock will assert that this bit is set.
// NS_FRAME_HAS_ABSPOS_CHILDREN must not be set when this bit is unset.
FRAME_STATE_BIT(Generic, 9, NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)
// If this bit is set, then the frame and _all_ of its descendant frames need
// to be reflowed.
// This bit is set when the frame is first created.
// This bit is cleared by DidReflow after the required call to Reflow has
// finished.
// Do not set this bit yourself if you plan to pass the frame to
// nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
FRAME_STATE_BIT(Generic, 10, NS_FRAME_IS_DIRTY)
// If this bit is set then the frame is too deep in the frame tree, and
// we'll stop updating it and its children, to prevent stack overflow
// and the like.
FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
// If this bit is set, then either:
// 1. the frame has at least one child that has the NS_FRAME_IS_DIRTY bit or
// NS_FRAME_HAS_DIRTY_CHILDREN bit set, or
// 2. the frame has had at least one child removed since the last reflow, or
// 3. the frame has had a style change that requires the frame to be reflowed
// but does not _necessarily_ require its descendants to be reflowed (e.g.,
// for a 'height', 'width', 'margin', etc. change, it's up to the
// applicable Reflow methods to decide whether the frame's children
// _actually_ need to be reflowed).
// If this bit is set but the NS_FRAME_IS_DIRTY is not set, then Reflow still
// needs to be called on the frame, but Reflow will likely not do as much work
// as it would if NS_FRAME_IS_DIRTY were set. See the comment documenting
// nsFrame::Reflow for more.
// This bit is cleared by DidReflow after the required call to Reflow has
// finished.
// Do not set this bit yourself if you plan to pass the frame to
// nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN)
// If this bit is set, the frame has an associated view
FRAME_STATE_BIT(Generic, 13, NS_FRAME_HAS_VIEW)
// If this bit is set, the frame was created from anonymous content.
FRAME_STATE_BIT(Generic, 14, NS_FRAME_INDEPENDENT_SELECTION)
// If this bit is set, the frame is "special" (lame term, I know),
// which means that it is part of the mangled frame hierarchy that
// results when an inline has been split because of a nested block.
// See the comments in nsCSSFrameConstructor::ConstructInline for
// more details.
FRAME_STATE_BIT(Generic, 15, NS_FRAME_IS_SPECIAL)
// If this bit is set, then transforms (e.g. CSS or SVG transforms) are allowed
// to affect the frame, and a transform may currently be in affect. If this bit
// is not set, then any transforms on the frame will be ignored.
// This is used primarily in GetTransformMatrix to optimize for the
// common case.
FRAME_STATE_BIT(Generic, 16, NS_FRAME_MAY_BE_TRANSFORMED)
#ifdef IBMBIDI
// If this bit is set, the frame itself is a bidi continuation,
// or is incomplete (its next sibling is a bidi continuation)
FRAME_STATE_BIT(Generic, 17, NS_FRAME_IS_BIDI)
#endif
// If this bit is set the frame has descendant with a view
FRAME_STATE_BIT(Generic, 18, NS_FRAME_HAS_CHILD_WITH_VIEW)
// If this bit is set, then reflow may be dispatched from the current
// frame instead of the root frame.
FRAME_STATE_BIT(Generic, 19, NS_FRAME_REFLOW_ROOT)
// NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
// frame classes.
// This bit is set on floats whose parent does not contain their
// placeholder. This can happen for two reasons: (1) the float was
// split, and this piece is the continuation, or (2) the entire float
// didn't fit on the page.
// Note that this bit is also shared by text frames for
// TEXT_IS_IN_TOKEN_MATHML. That's OK because we only check the
// NS_FRAME_IS_PUSHED_FLOAT bit on frames which we already know are
// out-of-flow.
FRAME_STATE_BIT(Generic, 32, NS_FRAME_IS_PUSHED_FLOAT)
// This bit acts as a loop flag for recursive paint server drawing.
FRAME_STATE_BIT(Generic, 33, NS_FRAME_DRAWING_AS_PAINTSERVER)
// Frame is a display root and the retained layer tree needs to be updated
// at the next paint via display list construction.
// Only meaningful for display roots, so we don't really need a global state
// bit; we could free up this bit with a little extra complexity.
FRAME_STATE_BIT(Generic, 36, NS_FRAME_UPDATE_LAYER_TREE)
// Frame can accept absolutely positioned children.
FRAME_STATE_BIT(Generic, 37, NS_FRAME_HAS_ABSPOS_CHILDREN)
// A display item for this frame has been painted as part of a ThebesLayer.
FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES)
// Frame is or is a descendant of something with a fixed height, unless that
// ancestor is a body or html element, and has no closer ancestor that is
// overflow:auto or overflow:scroll.
FRAME_STATE_BIT(Generic, 39, NS_FRAME_IN_CONSTRAINED_HEIGHT)
// This is only set during painting
FRAME_STATE_BIT(Generic, 40, NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)
// Is this frame a container for font size inflation, i.e., is it a
// frame whose width is used to determine the inflation factor for
// everything whose nearest ancestor container for this frame?
FRAME_STATE_BIT(Generic, 41, NS_FRAME_FONT_INFLATION_CONTAINER)
// Does this frame manage a region in which we do font size inflation,
// i.e., roughly, is it an element establishing a new block formatting
// context?
FRAME_STATE_BIT(Generic, 42, NS_FRAME_FONT_INFLATION_FLOW_ROOT)
// This bit is set on SVG frames that are laid out using SVG's coordinate
// system based layout (as opposed to any of the CSS layout models). Note that
// this does not include nsSVGOuterSVGFrame since it takes part is CSS layout.
FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT)
// Is this frame allowed to have generated (::before/::after) content?
FRAME_STATE_BIT(Generic, 44, NS_FRAME_MAY_HAVE_GENERATED_CONTENT)
// This bit is set on frames that create ContainerLayers with component
// alpha children. With BasicLayers we avoid creating these, so we mark
// the frames for future reference.
FRAME_STATE_BIT(Generic, 45, NS_FRAME_NO_COMPONENT_ALPHA)
// The frame is a descendant of SVGTextFrame and is thus used for SVG
// text layout.
FRAME_STATE_BIT(Generic, 47, NS_FRAME_IS_SVG_TEXT)
// Frame is marked as needing painting
FRAME_STATE_BIT(Generic, 48, NS_FRAME_NEEDS_PAINT)
// Frame has a descendant frame that needs painting - This includes
// cross-doc children.
FRAME_STATE_BIT(Generic, 49, NS_FRAME_DESCENDANT_NEEDS_PAINT)
// Frame is a descendant of a popup
FRAME_STATE_BIT(Generic, 50, NS_FRAME_IN_POPUP)
// Frame has only descendant frames that needs painting - This includes
// cross-doc children. This guarantees that all descendents have
// NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they
// have no display items.
FRAME_STATE_BIT(Generic, 51, NS_FRAME_ALL_DESCENDANTS_NEED_PAINT)
// Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
// rect stored to invalidate.
FRAME_STATE_BIT(Generic, 52, NS_FRAME_HAS_INVALID_RECT)
// Frame is not displayed directly due to it being, or being under, an SVG
// <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY)
// Frame has a LayerActivityProperty property
FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY)
// Set for all descendants of MathML sub/supscript elements (other than the
// base frame) to indicate that the SSTY font feature should be used.
FRAME_STATE_BIT(Generic, 58, NS_FRAME_MATHML_SCRIPT_DESCENDANT)
// This state bit is set on frames within token MathML elements if the
// token represents an <mi> tag whose inner HTML consists of a single
// non-whitespace character to allow special rendering behaviour.
FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI)
// NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
// frame classes.
// == Frame state bits that apply to box frames ===============================
FRAME_STATE_GROUP(Box, nsBoxFrame)
FRAME_STATE_BIT(Box, 20, NS_STATE_BOX_CHILD_RESERVED)
FRAME_STATE_BIT(Box, 21, NS_STATE_STACK_NOT_POSITIONED)
FRAME_STATE_BIT(Box, 22, NS_STATE_IS_HORIZONTAL)
FRAME_STATE_BIT(Box, 23, NS_STATE_AUTO_STRETCH)
FRAME_STATE_BIT(Box, 24, NS_STATE_IS_ROOT)
FRAME_STATE_BIT(Box, 25, NS_STATE_CURRENTLY_IN_DEBUG)
FRAME_STATE_BIT(Box, 26, NS_STATE_SET_TO_DEBUG)
FRAME_STATE_BIT(Box, 27, NS_STATE_DEBUG_WAS_SET)
FRAME_STATE_BIT(Box, 28, NS_STATE_MENU_HAS_POPUP_LIST)
FRAME_STATE_BIT(Box, 29, NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK)
FRAME_STATE_BIT(Box, 30, NS_STATE_EQUAL_SIZE)
FRAME_STATE_BIT(Box, 31, NS_STATE_IS_DIRECTION_NORMAL)
FRAME_STATE_BIT(Box, 60, NS_FRAME_MOUSE_THROUGH_ALWAYS)
FRAME_STATE_BIT(Box, 61, NS_FRAME_MOUSE_THROUGH_NEVER)
// == Frame state bits that apply to SVG frames ===============================
FRAME_STATE_GROUP(SVG, nsISVGChildFrame)
FRAME_STATE_GROUP(SVG, nsSVGContainerFrame)
FRAME_STATE_BIT(SVG, 20, NS_STATE_IS_OUTER_SVG)
// If this bit is set, we are a <clipPath> element or descendant.
FRAME_STATE_BIT(SVG, 21, NS_STATE_SVG_CLIPPATH_CHILD)
// For SVG text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits
// indicate that our anonymous block child needs to be reflowed, and that
// mPositions will likely need to be updated as a consequence. These are set,
// for example, when the font-family changes. Sometimes we only need to
// update mPositions though. For example if the x/y attributes change.
// mPositioningDirty is used to indicate this latter "things are dirty" case
// to allow us to avoid reflowing the anonymous block when it is not
// necessary.
FRAME_STATE_BIT(SVG, 22, NS_STATE_SVG_POSITIONING_DIRTY)
// For text, whether the values from x/y/dx/dy attributes have any percentage
// values that are used in determining the positions of glyphs. The value will
// be true even if a positioning value is overridden by a descendant element's
// attribute with a non-percentage length. For example,
// NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for:
//
// <text x="10%"><tspan x="0">abc</tspan></text>
//
// Percentage values beyond the number of addressable characters, however, do
// not influence NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES. For example,
// NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be false for:
//
// <text x="10 20 30 40%">abc</text>
//
// NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether
// to recompute mPositions when the viewport size changes. So although the
// first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES
// can be true even if a viewport size change will not affect mPositions,
// determining a completley accurate value for
// NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
// probably not worth it.
FRAME_STATE_BIT(SVG, 23, NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES)
FRAME_STATE_BIT(SVG, 24, NS_STATE_SVG_TEXT_IN_REFLOW)
// == Frame state bits that apply to text frames ==============================
FRAME_STATE_GROUP(Text, nsTextFrame)
// -- Flags set during reflow -------------------------------------------------
// nsTextFrame.cpp defines TEXT_REFLOW_FLAGS to be all of these bits.
// This bit is set on the first frame in a continuation indicating
// that it was chopped short because of :first-letter style.
FRAME_STATE_BIT(Text, 20, TEXT_FIRST_LETTER)
// This bit is set on frames that are logically adjacent to the start of the
// line (i.e. no prior frame on line with actual displayed in-flow content).
FRAME_STATE_BIT(Text, 21, TEXT_START_OF_LINE)
// This bit is set on frames that are logically adjacent to the end of the
// line (i.e. no following on line with actual displayed in-flow content).
FRAME_STATE_BIT(Text, 22, TEXT_END_OF_LINE)
// This bit is set on frames that end with a hyphenated break.
FRAME_STATE_BIT(Text, 23, TEXT_HYPHEN_BREAK)
// This bit is set on frames that trimmed trailing whitespace characters when
// calculating their width during reflow.
FRAME_STATE_BIT(Text, 24, TEXT_TRIMMED_TRAILING_WHITESPACE)
// This bit is set on frames that have justification enabled. We record
// this in a state bit because we don't always have the containing block
// easily available to check text-align on.
FRAME_STATE_BIT(Text, 25, TEXT_JUSTIFICATION_ENABLED)
// Set this bit if the textframe has overflow area for IME/spellcheck underline.
FRAME_STATE_BIT(Text, 26, TEXT_SELECTION_UNDERLINE_OVERFLOWED)
// -- Cache bits for IsEmpty() ------------------------------------------------
// nsTextFrame.cpp defines TEXT_WHITESPACE_FLAGS to be both of these bits.
// Set this bit if the textframe is known to be only collapsible whitespace.
FRAME_STATE_BIT(Text, 27, TEXT_IS_ONLY_WHITESPACE)
// Set this bit if the textframe is known to be not only collapsible whitespace.
FRAME_STATE_BIT(Text, 28, TEXT_ISNOT_ONLY_WHITESPACE)
// -- Other state bits --------------------------------------------------------
// Set when this text frame is mentioned in the userdata for mTextRun
FRAME_STATE_BIT(Text, 29, TEXT_IN_TEXTRUN_USER_DATA)
// This state bit is set on frames that have some non-collapsed characters after
// reflow
FRAME_STATE_BIT(Text, 31, TEXT_HAS_NONCOLLAPSED_CHARACTERS)
// This state bit is set on children of token MathML elements.
// NOTE: TEXT_IS_IN_TOKEN_MATHML has a global state bit value that is shared
// with NS_FRAME_IS_PUSHED_FLOAT.
FRAME_STATE_BIT(Text, 32, TEXT_IS_IN_TOKEN_MATHML)
// Set when this text frame is mentioned in the userdata for the
// uninflated textrun property
FRAME_STATE_BIT(Text, 60, TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA)
FRAME_STATE_BIT(Text, 61, TEXT_HAS_FONT_INFLATION)
// If true, then this frame is being removed due to a SetLength() on a
// previous continuation and the style context of that previous
// continuation is the same as this frame's
FRAME_STATE_BIT(Text, 62, TEXT_STYLE_MATCHES_PREV_CONTINUATION)
// Whether this frame is cached in the Offset Frame Cache
// (OffsetToFrameProperty)
FRAME_STATE_BIT(Text, 63, TEXT_IN_OFFSET_CACHE)
// == Frame state bits that apply to block frames =============================
FRAME_STATE_GROUP(Block, nsBlockFrame)
// See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
// Something in the block has changed that requires Bidi resolution to be
// performed on the block. This flag must be either set on all blocks in a
// continuation chain or none of them.
FRAME_STATE_BIT(Block, 20, NS_BLOCK_NEEDS_BIDI_RESOLUTION)
FRAME_STATE_BIT(Block, 21, NS_BLOCK_HAS_PUSHED_FLOATS)
FRAME_STATE_BIT(Block, 22, NS_BLOCK_MARGIN_ROOT)
FRAME_STATE_BIT(Block, 23, NS_BLOCK_FLOAT_MGR)
FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_LINE_CURSOR)
FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_LINES)
FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)
// Set on any block that has descendant frames in the normal
// flow with 'clear' set to something other than 'none'
// (including <BR CLEAR="..."> frames)
FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_CLEAR_CHILDREN)
// NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
// blocks which were forced to not have scrollframes but still need to clip
// the display of their kids.
FRAME_STATE_BIT(Block, 28, NS_BLOCK_CLIP_PAGINATED_OVERFLOW)
// NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
// even if it has no actual first-letter frame among its descendants.
FRAME_STATE_BIT(Block, 29, NS_BLOCK_HAS_FIRST_LETTER_STYLE)
// NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET and NS_BLOCK_FRAME_HAS_INSIDE_BULLET
// means the block has an associated bullet frame, they are mutually exclusive.
FRAME_STATE_BIT(Block, 30, NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET)
FRAME_STATE_BIT(Block, 31, NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
// This block has had a child marked dirty, so before we reflow we need
// to look through the lines to find any such children and mark
// appropriate lines dirty.
FRAME_STATE_BIT(Block, 61, NS_BLOCK_LOOK_FOR_DIRTY_FRAMES)
// Are our cached intrinsic widths intrinsic widths for font size
// inflation? i.e., what was the current state of
// GetPresContext()->mInflationDisabledForShrinkWrap at the time they
// were computed?
// nsBlockFrame is the only thing that caches intrinsic widths that
// needs to track this because it's the only thing that caches intrinsic
// widths that lives inside of things (form controls) that do intrinsic
// sizing with font inflation enabled.
FRAME_STATE_BIT(Block, 62, NS_BLOCK_FRAME_INTRINSICS_INFLATED)
// NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
// frame among the block's descendants. If there is a floating first-letter
// frame, or the block has first-letter style but has no first letter, this
// bit is not set. This bit is set on the first continuation only.
FRAME_STATE_BIT(Block, 63, NS_BLOCK_HAS_FIRST_LETTER_CHILD)
// == Frame state bits that apply to bullet frames ============================
FRAME_STATE_GROUP(Bullet, nsBulletFrame)
FRAME_STATE_BIT(Block, 62, BULLET_FRAME_HAS_FONT_INFLATION)
FRAME_STATE_BIT(Block, 63, BULLET_FRAME_IMAGE_LOADING)
// == Frame state bits that apply to scroll frames ============================
FRAME_STATE_GROUP(Scroll, nsIScrollableFrame)
// When set, the next scroll operation on the scrollframe will invalidate its
// entire contents. Useful for text-overflow.
// This bit is cleared after each time the scrollframe is scrolled. Whoever
// needs to set it should set it again on each paint.
FRAME_STATE_BIT(Scroll, 20, NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL)
// == Frame state bits that apply to image frames =============================
FRAME_STATE_GROUP(Image, nsImageFrame)
FRAME_STATE_BIT(Image, 20, IMAGE_SIZECONSTRAINED)
FRAME_STATE_BIT(Image, 21, IMAGE_GOTINITIALREFLOW)
// == Frame state bits that apply to inline frames ============================
FRAME_STATE_GROUP(Inline, nsInlineFrame)
/** In Bidi left (or right) margin/padding/border should be applied to left
* (or right) most frame (or a continuation frame).
* This state value shows if this frame is left (or right) most continuation
* or not.
*/
FRAME_STATE_BIT(Inline, 21, NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET)
FRAME_STATE_BIT(Inline, 22, NS_INLINE_FRAME_BIDI_VISUAL_IS_LEFT_MOST)
FRAME_STATE_BIT(Inline, 23, NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST)
// == Frame state bits that apply to placeholder frames =======================
FRAME_STATE_GROUP(Placeholder, nsPlaceholderFrame)
// Frame state bits that are used to keep track of what this is a
// placeholder for.
FRAME_STATE_BIT(Placeholder, 20, PLACEHOLDER_FOR_FLOAT)
FRAME_STATE_BIT(Placeholder, 21, PLACEHOLDER_FOR_ABSPOS)
FRAME_STATE_BIT(Placeholder, 22, PLACEHOLDER_FOR_FIXEDPOS)
FRAME_STATE_BIT(Placeholder, 23, PLACEHOLDER_FOR_POPUP)
// == Frame state bits that apply to table cell frames ========================
FRAME_STATE_GROUP(TableCell, nsTableCellFrame)
FRAME_STATE_BIT(TableCell, 28, NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT)
FRAME_STATE_BIT(TableCell, 29, NS_TABLE_CELL_HAD_SPECIAL_REFLOW)
FRAME_STATE_BIT(TableCell, 31, NS_TABLE_CELL_CONTENT_EMPTY)
// == Frame state bits that apply to table column frames ======================
// Bits 28-31 on nsTableColFrames are used to store the column type.
// == Frame state bits that apply to table column group frames ================
// Bits 30-31 on nsTableColGroupFrames are used to store the column type.
// == Frame state bits that apply to table rows and table row group frames ====
FRAME_STATE_GROUP(TableRowAndRowGroup, nsTableRowFrame)
FRAME_STATE_GROUP(TableRowAndRowGroup, nsTableRowGroupFrame)
// see nsTableRowGroupFrame::InitRepeatedFrame
FRAME_STATE_BIT(TableRowAndRowGroup, 28, NS_REPEATED_ROW_OR_ROWGROUP)
// == Frame state bits that apply to table row frames =========================
FRAME_STATE_GROUP(TableRow, nsTableRowFrame)
// Indicates whether this row has any cells that have
// non-auto-height and rowspan=1
FRAME_STATE_BIT(TableRow, 29, NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT)
FRAME_STATE_BIT(TableRow, 30, NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT)
// == Frame state bits that apply to table row group frames ===================
FRAME_STATE_GROUP(TableRowGroup, nsTableRowGroupFrame)
FRAME_STATE_BIT(TableRowGroup, 27, NS_ROWGROUP_HAS_ROW_CURSOR)
FRAME_STATE_BIT(TableRowGroup, 30, NS_ROWGROUP_HAS_STYLE_HEIGHT)
// thead or tfoot should be repeated on every printed page
FRAME_STATE_BIT(TableRowGroup, 31, NS_ROWGROUP_REPEATABLE)
#ifdef DEFINED_FRAME_STATE_GROUP
#undef DEFINED_FRAME_STATE_GROUP
#undef FRAME_STATE_GROUP
#endif
#ifdef DEFINED_FRAME_STATE_BIT
#undef DEFINED_FRAME_STATE_BIT
#undef FRAME_STATE_BIT
#endif

View File

@ -35,6 +35,12 @@ class ScrollbarActivity;
} }
} }
// When set, the next scroll operation on the scrollframe will invalidate its
// entire contents. Useful for text-overflow.
// This bit is cleared after each time the scrollframe is scrolled. Whoever
// needs to set it should set it again on each paint.
#define NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL NS_FRAME_STATE_BIT(20)
namespace mozilla { namespace mozilla {
class ScrollFrameHelper : public nsIReflowCallback { class ScrollFrameHelper : public nsIReflowCallback {

View File

@ -26,6 +26,33 @@ class nsIPresShell;
class nsIChannel; class nsIChannel;
class nsTableColFrame; class nsTableColFrame;
/**
* Additional frame-state bits used by nsBlockFrame
* See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
*
* NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
* blocks which were forced to not have scrollframes but still need to clip
* the display of their kids.
*
* NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
* even if it has no actual first-letter frame among its descendants.
*
* NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
* frame among the block's descendants. If there is a floating first-letter
* frame, or the block has first-letter style but has no first letter, this
* bit is not set. This bit is set on the first continuation only.
*
* NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET and NS_BLOCK_FRAME_HAS_INSIDE_BULLET
* means the block has an associated bullet frame, they are mutually exclusive.
*
*/
#define NS_BLOCK_MARGIN_ROOT NS_FRAME_STATE_BIT(22)
#define NS_BLOCK_FLOAT_MGR NS_FRAME_STATE_BIT(23)
#define NS_BLOCK_CLIP_PAGINATED_OVERFLOW NS_FRAME_STATE_BIT(28)
#define NS_BLOCK_HAS_FIRST_LETTER_STYLE NS_FRAME_STATE_BIT(29)
#define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET NS_FRAME_STATE_BIT(30)
#define NS_BLOCK_HAS_FIRST_LETTER_CHILD NS_FRAME_STATE_BIT(31)
#define NS_BLOCK_FRAME_HAS_INSIDE_BULLET NS_FRAME_STATE_BIT(63)
// These are all the block specific frame bits, they are copied from // These are all the block specific frame bits, they are copied from
// the prev-in-flow to a newly created next-in-flow, except for the // the prev-in-flow to a newly created next-in-flow, except for the
// NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below. // NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
@ -49,7 +76,7 @@ class nsTableColFrame;
// Create a frame that supports "display: block" layout behavior // Create a frame that supports "display: block" layout behavior
nsIFrame* nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0)); NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags = 0);
// Special Generated Content Node. It contains text taken from an // Special Generated Content Node. It contains text taken from an
// attribute of its *grandparent* content node. // attribute of its *grandparent* content node.
@ -63,7 +90,7 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
// By default, area frames will extend // By default, area frames will extend
// their height to cover any children that "stick out". // their height to cover any children that "stick out".
nsIFrame* nsIFrame*
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
// Create a block formatting context blockframe // Create a block formatting context blockframe
inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell, inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
@ -108,7 +135,7 @@ NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
} }
nsIFrame* nsIFrame*
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags); NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aStateFlags);
nsIFrame* nsIFrame*
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
@ -159,7 +186,7 @@ NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContex
nsIFrame* nsIFrame*
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* nsIFrame*
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
nsIFrame* nsIFrame*
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* nsIFrame*

View File

@ -35,7 +35,6 @@
#include "nsITheme.h" #include "nsITheme.h"
#include "gfx3DMatrix.h" #include "gfx3DMatrix.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsFrameState.h"
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
#include "mozilla/a11y/AccTypes.h" #include "mozilla/a11y/AccTypes.h"
@ -129,6 +128,230 @@ typedef uint32_t nsSplittableType;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/**
* Frame state bits. Any bits not listed here are reserved for future
* extensions, but must be stored by the frames.
*/
typedef uint64_t nsFrameState;
#define NS_FRAME_STATE_BIT(n_) (nsFrameState(1) << (n_))
#define NS_FRAME_IN_REFLOW NS_FRAME_STATE_BIT(0)
// This bit is set when a frame is created. After it has been reflowed
// once (during the DidReflow with a finished state) the bit is
// cleared.
#define NS_FRAME_FIRST_REFLOW NS_FRAME_STATE_BIT(1)
// For a continuation frame, if this bit is set, then this a "fluid"
// continuation, i.e., across a line boundary. Otherwise it's a "hard"
// continuation, e.g. a bidi continuation.
#define NS_FRAME_IS_FLUID_CONTINUATION NS_FRAME_STATE_BIT(2)
// For nsIAnonymousContentCreator content that's created using ContentInfo.
#define NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT NS_FRAME_STATE_BIT(3)
// If this bit is set, then a reference to the frame is being held
// elsewhere. The frame may want to send a notification when it is
// destroyed to allow these references to be cleared.
#define NS_FRAME_EXTERNAL_REFERENCE NS_FRAME_STATE_BIT(4)
// If this bit is set, this frame or one of its descendants has a
// percentage height that depends on an ancestor of this frame.
// (Or it did at one point in the past, since we don't necessarily clear
// the bit when it's no longer needed; it's an optimization.)
#define NS_FRAME_CONTAINS_RELATIVE_HEIGHT NS_FRAME_STATE_BIT(5)
// If this bit is set, then the frame corresponds to generated content
#define NS_FRAME_GENERATED_CONTENT NS_FRAME_STATE_BIT(6)
// If this bit is set the frame is a continuation that is holding overflow,
// i.e. it is a next-in-flow created to hold overflow after the box's
// height has ended. This means the frame should be a) at the top of the
// page and b) invisible: no borders, zero height, ignored in margin
// collapsing, etc. See nsContainerFrame.h
#define NS_FRAME_IS_OVERFLOW_CONTAINER NS_FRAME_STATE_BIT(7)
// If this bit is set, then the frame has been moved out of the flow,
// e.g., it is absolutely positioned or floated
#define NS_FRAME_OUT_OF_FLOW NS_FRAME_STATE_BIT(8)
// Frame can be an abs/fixed pos. container, if its style says so.
// MarkAs[Not]AbsoluteContainingBlock will assert that this bit is set.
// NS_FRAME_HAS_ABSPOS_CHILDREN must not be set when this bit is unset.
#define NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN NS_FRAME_STATE_BIT(9)
// If this bit is set, then the frame and _all_ of its descendant frames need
// to be reflowed.
// This bit is set when the frame is first created.
// This bit is cleared by DidReflow after the required call to Reflow has
// finished.
// Do not set this bit yourself if you plan to pass the frame to
// nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
#define NS_FRAME_IS_DIRTY NS_FRAME_STATE_BIT(10)
// If this bit is set then the frame is too deep in the frame tree, and
// we'll stop updating it and its children, to prevent stack overflow
// and the like.
#define NS_FRAME_TOO_DEEP_IN_FRAME_TREE NS_FRAME_STATE_BIT(11)
// If this bit is set, then either:
// 1. the frame has at least one child that has the NS_FRAME_IS_DIRTY bit or
// NS_FRAME_HAS_DIRTY_CHILDREN bit set, or
// 2. the frame has had at least one child removed since the last reflow, or
// 3. the frame has had a style change that requires the frame to be reflowed
// but does not _necessarily_ require its descendants to be reflowed (e.g.,
// for a 'height', 'width', 'margin', etc. change, it's up to the
// applicable Reflow methods to decide whether the frame's children
// _actually_ need to be reflowed).
// If this bit is set but the NS_FRAME_IS_DIRTY is not set, then Reflow still
// needs to be called on the frame, but Reflow will likely not do as much work
// as it would if NS_FRAME_IS_DIRTY were set. See the comment documenting
// nsFrame::Reflow for more.
// This bit is cleared by DidReflow after the required call to Reflow has
// finished.
// Do not set this bit yourself if you plan to pass the frame to
// nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
#define NS_FRAME_HAS_DIRTY_CHILDREN NS_FRAME_STATE_BIT(12)
// If this bit is set, the frame has an associated view
#define NS_FRAME_HAS_VIEW NS_FRAME_STATE_BIT(13)
// If this bit is set, the frame was created from anonymous content.
#define NS_FRAME_INDEPENDENT_SELECTION NS_FRAME_STATE_BIT(14)
// If this bit is set, the frame is "special" (lame term, I know),
// which means that it is part of the mangled frame hierarchy that
// results when an inline has been split because of a nested block.
// See the comments in nsCSSFrameConstructor::ConstructInline for
// more details.
#define NS_FRAME_IS_SPECIAL NS_FRAME_STATE_BIT(15)
// If this bit is set, then transforms (e.g. CSS or SVG transforms) are allowed
// to affect the frame, and a transform may currently be in affect. If this bit
// is not set, then any transforms on the frame will be ignored.
// This is used primarily in GetTransformMatrix to optimize for the
// common case.
#define NS_FRAME_MAY_BE_TRANSFORMED NS_FRAME_STATE_BIT(16)
#ifdef IBMBIDI
// If this bit is set, the frame itself is a bidi continuation,
// or is incomplete (its next sibling is a bidi continuation)
#define NS_FRAME_IS_BIDI NS_FRAME_STATE_BIT(17)
#endif
// If this bit is set the frame has descendant with a view
#define NS_FRAME_HAS_CHILD_WITH_VIEW NS_FRAME_STATE_BIT(18)
// If this bit is set, then reflow may be dispatched from the current
// frame instead of the root frame.
#define NS_FRAME_REFLOW_ROOT NS_FRAME_STATE_BIT(19)
// Bits 20-31 and 60-63 of the frame state are reserved for implementations.
#define NS_FRAME_IMPL_RESERVED nsFrameState(0xF0000000FFF00000)
#define NS_FRAME_RESERVED ~NS_FRAME_IMPL_RESERVED
// This bit is set on floats whose parent does not contain their
// placeholder. This can happen for two reasons: (1) the float was
// split, and this piece is the continuation, or (2) the entire float
// didn't fit on the page.
// Note that this bit is also shared by text frames for
// TEXT_IS_IN_TOKEN_MATHML. That's OK because we only check the
// NS_FRAME_IS_PUSHED_FLOAT bit on frames which we already know are
// out-of-flow.
#define NS_FRAME_IS_PUSHED_FLOAT NS_FRAME_STATE_BIT(32)
// This bit acts as a loop flag for recursive paint server drawing.
#define NS_FRAME_DRAWING_AS_PAINTSERVER NS_FRAME_STATE_BIT(33)
// Frame is a display root and the retained layer tree needs to be updated
// at the next paint via display list construction.
// Only meaningful for display roots, so we don't really need a global state
// bit; we could free up this bit with a little extra complexity.
#define NS_FRAME_UPDATE_LAYER_TREE NS_FRAME_STATE_BIT(36)
// Frame can accept absolutely positioned children.
#define NS_FRAME_HAS_ABSPOS_CHILDREN NS_FRAME_STATE_BIT(37)
// A display item for this frame has been painted as part of a ThebesLayer.
#define NS_FRAME_PAINTED_THEBES NS_FRAME_STATE_BIT(38)
// Frame is or is a descendant of something with a fixed height, unless that
// ancestor is a body or html element, and has no closer ancestor that is
// overflow:auto or overflow:scroll.
#define NS_FRAME_IN_CONSTRAINED_HEIGHT NS_FRAME_STATE_BIT(39)
// This is only set during painting
#define NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO NS_FRAME_STATE_BIT(40)
// Is this frame a container for font size inflation, i.e., is it a
// frame whose width is used to determine the inflation factor for
// everything whose nearest ancestor container for this frame?
#define NS_FRAME_FONT_INFLATION_CONTAINER NS_FRAME_STATE_BIT(41)
// Does this frame manage a region in which we do font size inflation,
// i.e., roughly, is it an element establishing a new block formatting
// context?
#define NS_FRAME_FONT_INFLATION_FLOW_ROOT NS_FRAME_STATE_BIT(42)
// This bit is set on SVG frames that are laid out using SVG's coordinate
// system based layout (as opposed to any of the CSS layout models). Note that
// this does not include nsSVGOuterSVGFrame since it takes part is CSS layout.
#define NS_FRAME_SVG_LAYOUT NS_FRAME_STATE_BIT(43)
// Is this frame allowed to have generated (::before/::after) content?
#define NS_FRAME_MAY_HAVE_GENERATED_CONTENT NS_FRAME_STATE_BIT(44)
// This bit is set on frames that create ContainerLayers with component
// alpha children. With BasicLayers we avoid creating these, so we mark
// the frames for future reference.
#define NS_FRAME_NO_COMPONENT_ALPHA NS_FRAME_STATE_BIT(45)
// The frame is a descendant of SVGTextFrame and is thus used for SVG
// text layout.
#define NS_FRAME_IS_SVG_TEXT NS_FRAME_STATE_BIT(47)
// Frame is marked as needing painting
#define NS_FRAME_NEEDS_PAINT NS_FRAME_STATE_BIT(48)
// Frame has a descendant frame that needs painting - This includes
// cross-doc children.
#define NS_FRAME_DESCENDANT_NEEDS_PAINT NS_FRAME_STATE_BIT(49)
// Frame is a descendant of a popup
#define NS_FRAME_IN_POPUP NS_FRAME_STATE_BIT(50)
// Frame has only descendant frames that needs painting - This includes
// cross-doc children. This guarantees that all descendents have
// NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they
// have no display items.
#define NS_FRAME_ALL_DESCENDANTS_NEED_PAINT NS_FRAME_STATE_BIT(51)
// Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
// rect stored to invalidate.
#define NS_FRAME_HAS_INVALID_RECT NS_FRAME_STATE_BIT(52)
// Frame is not displayed directly due to it being, or being under, an SVG
// <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
#define NS_FRAME_IS_NONDISPLAY NS_FRAME_STATE_BIT(53)
// Frame has a LayerActivityProperty property
#define NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY NS_FRAME_STATE_BIT(54)
// Set for all descendants of MathML sub/supscript elements (other than the
// base frame) to indicate that the SSTY font feature should be used.
#define NS_FRAME_MATHML_SCRIPT_DESCENDANT NS_FRAME_STATE_BIT(58)
// This state bit is set on token MathML elements if the token represents an
// <mi> tag whose inner HTML consists of a single non-whitespace character
// to allow special rendering behaviour.
#define NS_FRAME_IS_IN_SINGLE_CHAR_MI NS_FRAME_STATE_BIT(59)
// Box layout bits
#define NS_STATE_IS_HORIZONTAL NS_FRAME_STATE_BIT(22)
#define NS_STATE_IS_DIRECTION_NORMAL NS_FRAME_STATE_BIT(31)
// Helper macros
#define NS_SUBTREE_DIRTY(_frame) \ #define NS_SUBTREE_DIRTY(_frame) \
(((_frame)->GetStateBits() & \ (((_frame)->GetStateBits() & \
(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0) (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) != 0)

View File

@ -54,6 +54,9 @@ private:
nsImageFrame *mFrame; nsImageFrame *mFrame;
}; };
#define IMAGE_SIZECONSTRAINED NS_FRAME_STATE_BIT(20)
#define IMAGE_GOTINITIALREFLOW NS_FRAME_STATE_BIT(21)
#define ImageFrameSuper nsSplittableFrame #define ImageFrameSuper nsSplittableFrame
class nsImageFrame : public ImageFrameSuper, class nsImageFrame : public ImageFrameSuper,

View File

@ -13,6 +13,17 @@
class nsLineLayout; class nsLineLayout;
/** In Bidi left (or right) margin/padding/border should be applied to left
* (or right) most frame (or a continuation frame).
* This state value shows if this frame is left (or right) most continuation
* or not.
*/
#define NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET NS_FRAME_STATE_BIT(21)
#define NS_INLINE_FRAME_BIDI_VISUAL_IS_LEFT_MOST NS_FRAME_STATE_BIT(22)
#define NS_INLINE_FRAME_BIDI_VISUAL_IS_RIGHT_MOST NS_FRAME_STATE_BIT(23)
typedef nsContainerFrame nsInlineFrameBase; typedef nsContainerFrame nsInlineFrameBase;
/** /**

View File

@ -26,12 +26,6 @@ NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
NS_IMPL_FRAMEARENA_HELPERS(nsPlaceholderFrame) NS_IMPL_FRAMEARENA_HELPERS(nsPlaceholderFrame)
#ifdef DEBUG
NS_QUERYFRAME_HEAD(nsPlaceholderFrame)
NS_QUERYFRAME_ENTRY(nsPlaceholderFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsFrame)
#endif
/* virtual */ nsSize /* virtual */ nsSize
nsPlaceholderFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState) nsPlaceholderFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
{ {

View File

@ -42,6 +42,12 @@ nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, nsStyleContext* aContext,
nsFrameState aTypeBit); nsFrameState aTypeBit);
// Frame state bits that are used to keep track of what this is a
// placeholder for.
#define PLACEHOLDER_FOR_FLOAT NS_FRAME_STATE_BIT(20)
#define PLACEHOLDER_FOR_ABSPOS NS_FRAME_STATE_BIT(21)
#define PLACEHOLDER_FOR_FIXEDPOS NS_FRAME_STATE_BIT(22)
#define PLACEHOLDER_FOR_POPUP NS_FRAME_STATE_BIT(23)
#define PLACEHOLDER_TYPE_MASK (PLACEHOLDER_FOR_FLOAT | \ #define PLACEHOLDER_TYPE_MASK (PLACEHOLDER_FOR_FLOAT | \
PLACEHOLDER_FOR_ABSPOS | \ PLACEHOLDER_FOR_ABSPOS | \
PLACEHOLDER_FOR_FIXEDPOS | \ PLACEHOLDER_FOR_FIXEDPOS | \
@ -54,10 +60,6 @@ nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell,
class nsPlaceholderFrame MOZ_FINAL : public nsFrame { class nsPlaceholderFrame MOZ_FINAL : public nsFrame {
public: public:
NS_DECL_FRAMEARENA_HELPERS NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_DECL_QUERYFRAME_TARGET(nsPlaceholderFrame)
NS_DECL_QUERYFRAME
#endif
/** /**
* Create a new placeholder frame. aTypeBit must be one of the * Create a new placeholder frame. aTypeBit must be one of the

View File

@ -203,14 +203,67 @@ static void DestroyGlyphObserverList(void* aPropertyValue)
*/ */
NS_DECLARE_FRAME_PROPERTY(TextFrameGlyphObservers, DestroyGlyphObserverList); NS_DECLARE_FRAME_PROPERTY(TextFrameGlyphObservers, DestroyGlyphObserverList);
// The following flags are set during reflow
// This bit is set on the first frame in a continuation indicating
// that it was chopped short because of :first-letter style.
#define TEXT_FIRST_LETTER NS_FRAME_STATE_BIT(20)
// This bit is set on frames that are logically adjacent to the start of the
// line (i.e. no prior frame on line with actual displayed in-flow content).
#define TEXT_START_OF_LINE NS_FRAME_STATE_BIT(21)
// This bit is set on frames that are logically adjacent to the end of the
// line (i.e. no following on line with actual displayed in-flow content).
#define TEXT_END_OF_LINE NS_FRAME_STATE_BIT(22)
// This bit is set on frames that end with a hyphenated break.
#define TEXT_HYPHEN_BREAK NS_FRAME_STATE_BIT(23)
// This bit is set on frames that trimmed trailing whitespace characters when
// calculating their width during reflow.
#define TEXT_TRIMMED_TRAILING_WHITESPACE NS_FRAME_STATE_BIT(24)
// This bit is set on frames that have justification enabled. We record
// this in a state bit because we don't always have the containing block
// easily available to check text-align on.
#define TEXT_JUSTIFICATION_ENABLED NS_FRAME_STATE_BIT(25)
// Set this bit if the textframe has overflow area for IME/spellcheck underline.
#define TEXT_SELECTION_UNDERLINE_OVERFLOWED NS_FRAME_STATE_BIT(26)
#define TEXT_REFLOW_FLAGS \ #define TEXT_REFLOW_FLAGS \
(TEXT_FIRST_LETTER|TEXT_START_OF_LINE|TEXT_END_OF_LINE|TEXT_HYPHEN_BREAK| \ (TEXT_FIRST_LETTER|TEXT_START_OF_LINE|TEXT_END_OF_LINE|TEXT_HYPHEN_BREAK| \
TEXT_TRIMMED_TRAILING_WHITESPACE|TEXT_JUSTIFICATION_ENABLED| \ TEXT_TRIMMED_TRAILING_WHITESPACE|TEXT_JUSTIFICATION_ENABLED| \
TEXT_HAS_NONCOLLAPSED_CHARACTERS|TEXT_SELECTION_UNDERLINE_OVERFLOWED) TEXT_HAS_NONCOLLAPSED_CHARACTERS|TEXT_SELECTION_UNDERLINE_OVERFLOWED)
// Cache bits for IsEmpty().
// Set this bit if the textframe is known to be only collapsible whitespace.
#define TEXT_IS_ONLY_WHITESPACE NS_FRAME_STATE_BIT(27)
// Set this bit if the textframe is known to be not only collapsible whitespace.
#define TEXT_ISNOT_ONLY_WHITESPACE NS_FRAME_STATE_BIT(28)
#define TEXT_WHITESPACE_FLAGS (TEXT_IS_ONLY_WHITESPACE | \ #define TEXT_WHITESPACE_FLAGS (TEXT_IS_ONLY_WHITESPACE | \
TEXT_ISNOT_ONLY_WHITESPACE) TEXT_ISNOT_ONLY_WHITESPACE)
// Set when this text frame is mentioned in the userdata for mTextRun
#define TEXT_IN_TEXTRUN_USER_DATA NS_FRAME_STATE_BIT(29)
// nsTextFrame.h has
// #define TEXT_HAS_NONCOLLAPSED_CHARACTERS NS_FRAME_STATE_BIT(31)
// nsTextFrame.h has
// #define TEXT_IS_IN_TOKEN_MATHML NS_FRAME_STATE_BIT(32)
// Set when this text frame is mentioned in the userdata for the
// uninflated textrun property
#define TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA NS_FRAME_STATE_BIT(60)
// nsTextFrame.h has
// #define TEXT_HAS_FONT_INFLATION NS_FRAME_STATE_BIT(61)
// If true, then this frame is being removed due to a SetLength() on a
// previous continuation and the style context of that previous
// continuation is the same as this frame's
#define TEXT_STYLE_MATCHES_PREV_CONTINUATION NS_FRAME_STATE_BIT(62)
// Whether this frame is cached in the Offset Frame Cache (OffsetToFrameProperty)
#define TEXT_IN_OFFSET_CACHE NS_FRAME_STATE_BIT(63)
/* /*
* Some general notes * Some general notes
* *

View File

@ -17,6 +17,15 @@
class nsTextPaintStyle; class nsTextPaintStyle;
class PropertyProvider; class PropertyProvider;
// This state bit is set on frames that have some non-collapsed characters after
// reflow
#define TEXT_HAS_NONCOLLAPSED_CHARACTERS NS_FRAME_STATE_BIT(31)
// This state bit is set on children of token MathML elements
#define TEXT_IS_IN_TOKEN_MATHML NS_FRAME_STATE_BIT(32)
#define TEXT_HAS_FONT_INFLATION NS_FRAME_STATE_BIT(61)
typedef nsFrame nsTextFrameBase; typedef nsFrame nsTextFrameBase;
class nsDisplayTextGeometry; class nsDisplayTextGeometry;

View File

@ -1532,7 +1532,7 @@ nsMathMLContainerFrame::TransmitAutomaticDataForMrowLikeElement()
/*static*/ void /*static*/ void
nsMathMLContainerFrame::PropagateFrameFlagFor(nsIFrame* aFrame, nsMathMLContainerFrame::PropagateFrameFlagFor(nsIFrame* aFrame,
nsFrameState aFlags) uint64_t aFlags)
{ {
if (!aFrame || !aFlags) if (!aFrame || !aFlags)
return; return;
@ -1584,7 +1584,7 @@ nsMathMLContainerFrame::ReportInvalidChildError(nsIAtom* aChildTag)
nsIFrame* nsIFrame*
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
nsFrameState aFlags) uint32_t aFlags)
{ {
nsMathMLmathBlockFrame* it = new (aPresShell) nsMathMLmathBlockFrame(aContext); nsMathMLmathBlockFrame* it = new (aPresShell) nsMathMLmathBlockFrame(aContext);
it->SetFlags(aFlags); it->SetFlags(aFlags);

View File

@ -342,7 +342,7 @@ public:
// Sets flags on aFrame and all descendant frames // Sets flags on aFrame and all descendant frames
static void static void
PropagateFrameFlagFor(nsIFrame* aFrame, PropagateFrameFlagFor(nsIFrame* aFrame,
nsFrameState aFlags); uint64_t aFlags);
// helper to let the rebuild of automatic data (presentation data // helper to let the rebuild of automatic data (presentation data
// and embellishement data) walk through a subtree that may contain // and embellishement data) walk through a subtree that may contain
@ -411,7 +411,7 @@ public:
NS_DECL_FRAMEARENA_HELPERS NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, nsFrameState aFlags); nsStyleContext* aContext, uint32_t aFlags);
// beware, mFrames is not set by nsBlockFrame // beware, mFrames is not set by nsBlockFrame
// cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames // cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames

View File

@ -35,10 +35,10 @@ nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aCo
nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
inline nsIFrame* NS_CreateNewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) inline nsIFrame* NS_CreateNewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{ {
return NS_NewMathMLmathBlockFrame(aPresShell, aContext, nsFrameState(0)); return NS_NewMathMLmathBlockFrame(aPresShell, aContext, 0);
} }
#endif /* nsMathMLParts_h___ */ #endif /* nsMathMLParts_h___ */

View File

@ -65,6 +65,51 @@ class SourceSurface;
} }
} // namespace mozilla } // namespace mozilla
// SVG Frame state bits
#define NS_STATE_IS_OUTER_SVG NS_FRAME_STATE_BIT(20)
// If this bit is set, we are a <clipPath> element or descendant.
#define NS_STATE_SVG_CLIPPATH_CHILD NS_FRAME_STATE_BIT(21)
/**
* For text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits indicate
* that our anonymous block child needs to be reflowed, and that mPositions
* will likely need to be updated as a consequence. These are set, for
* example, when the font-family changes. Sometimes we only need to
* update mPositions though. For example if the x/y attributes change.
* mPositioningDirty is used to indicate this latter "things are dirty" case
* to allow us to avoid reflowing the anonymous block when it is not
* necessary.
*/
#define NS_STATE_SVG_POSITIONING_DIRTY NS_FRAME_STATE_BIT(22)
/**
* For text, whether the values from x/y/dx/dy attributes have any percentage values
* that are used in determining the positions of glyphs. The value will
* be true even if a positioning value is overridden by a descendant element's
* attribute with a non-percentage length. For example,
* NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for:
*
* <text x="10%"><tspan x="0">abc</tspan></text>
*
* Percentage values beyond the number of addressable characters, however, do
* not influence NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES. For example,
* NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be false for:
*
* <text x="10 20 30 40%">abc</text>
*
* NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether
* to recompute mPositions when the viewport size changes. So although the
* first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES
* can be true even if a viewport size change will not affect mPositions,
* determining a completley accurate value for
* NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
* probably not worth it.
*/
#define NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES NS_FRAME_STATE_BIT(23)
#define NS_STATE_SVG_TEXT_IN_REFLOW NS_FRAME_STATE_BIT(24)
// maximum dimension of an offscreen surface - choose so that // maximum dimension of an offscreen surface - choose so that
// the surface size doesn't overflow a 32-bit signed int using // the surface size doesn't overflow a 32-bit signed int using
// 4 bytes per pixel; in line with gfxASurface::CheckSurfaceSize // 4 bytes per pixel; in line with gfxASurface::CheckSurfaceSize

View File

@ -18,6 +18,13 @@
class nsTableFrame; class nsTableFrame;
/**
* Additional frame-state bits
*/
#define NS_TABLE_CELL_CONTENT_EMPTY NS_FRAME_STATE_BIT(31)
#define NS_TABLE_CELL_HAD_SPECIAL_REFLOW NS_FRAME_STATE_BIT(29)
#define NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT NS_FRAME_STATE_BIT(28)
/** /**
* nsTableCellFrame * nsTableCellFrame
* data structure to maintain information about a single table cell's frame * data structure to maintain information about a single table cell's frame

View File

@ -47,7 +47,7 @@ nsTableColFrame::SetColType(nsTableColType aType)
GetPrevContinuation()->GetNextSibling() == this), GetPrevContinuation()->GetNextSibling() == this),
"spanned content cols must be continuations"); "spanned content cols must be continuations");
uint32_t type = aType - eColContent; uint32_t type = aType - eColContent;
mState |= nsFrameState(type << COL_TYPE_OFFSET); mState |= (type << COL_TYPE_OFFSET);
} }
/* virtual */ void /* virtual */ void

View File

@ -27,7 +27,7 @@ nsTableColGroupFrame::GetColType() const
void nsTableColGroupFrame::SetColType(nsTableColGroupType aType) void nsTableColGroupFrame::SetColType(nsTableColGroupType aType)
{ {
uint32_t type = aType - eColGroupContent; uint32_t type = aType - eColGroupContent;
mState |= nsFrameState(type << COL_GROUP_TYPE_OFFSET); mState |= (type << COL_GROUP_TYPE_OFFSET);
} }
void nsTableColGroupFrame::ResetColIndices(nsIFrame* aFirstColGroup, void nsTableColGroupFrame::ResetColIndices(nsIFrame* aFirstColGroup,

View File

@ -14,6 +14,15 @@ class nsTableFrame;
class nsTableCellFrame; class nsTableCellFrame;
struct nsTableCellReflowState; struct nsTableCellReflowState;
// This is also used on rows, from nsTableRowGroupFrame.h
// #define NS_REPEATED_ROW_OR_ROWGROUP NS_FRAME_STATE_BIT(28)
// Indicates whether this row has any cells that have
// non-auto-height and rowspan=1
#define NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT NS_FRAME_STATE_BIT(29)
#define NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT NS_FRAME_STATE_BIT(30)
/** /**
* nsTableRowFrame is the frame that maps table rows * nsTableRowFrame is the frame that maps table rows
* (HTML tag TR). This class cannot be reused * (HTML tag TR). This class cannot be reused

View File

@ -40,6 +40,15 @@ struct nsRowGroupReflowState {
~nsRowGroupReflowState() {} ~nsRowGroupReflowState() {}
}; };
// use the following bits from nsFrame's frame state
// thead or tfoot should be repeated on every printed page
#define NS_ROWGROUP_REPEATABLE NS_FRAME_STATE_BIT(31)
#define NS_ROWGROUP_HAS_STYLE_HEIGHT NS_FRAME_STATE_BIT(30)
// the next is also used on rows (see nsTableRowGroupFrame::InitRepeatedFrame)
#define NS_REPEATED_ROW_OR_ROWGROUP NS_FRAME_STATE_BIT(28)
#define NS_ROWGROUP_HAS_ROW_CURSOR NS_FRAME_STATE_BIT(27)
#define MIN_ROWS_NEEDING_CURSOR 20 #define MIN_ROWS_NEEDING_CURSOR 20
/** /**

View File

@ -11,6 +11,10 @@
class nsITheme; class nsITheme;
#define NS_STATE_IS_ROOT NS_FRAME_STATE_BIT(24)
#define NS_STATE_SET_TO_DEBUG NS_FRAME_STATE_BIT(26)
#define NS_STATE_DEBUG_WAS_SET NS_FRAME_STATE_BIT(27)
class nsBox : public nsIFrame { class nsBox : public nsIFrame {
public: public:

View File

@ -104,12 +104,6 @@ NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
NS_IMPL_FRAMEARENA_HELPERS(nsBoxFrame) NS_IMPL_FRAMEARENA_HELPERS(nsBoxFrame)
#ifdef DEBUG
NS_QUERYFRAME_HEAD(nsBoxFrame)
NS_QUERYFRAME_ENTRY(nsBoxFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
#endif
nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell, nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, nsStyleContext* aContext,
bool aIsRoot, bool aIsRoot,

View File

@ -21,6 +21,22 @@
class nsBoxLayoutState; class nsBoxLayoutState;
// flags from box
#define NS_STATE_BOX_CHILD_RESERVED NS_FRAME_STATE_BIT(20)
#define NS_STATE_STACK_NOT_POSITIONED NS_FRAME_STATE_BIT(21)
//#define NS_STATE_IS_HORIZONTAL NS_FRAME_STATE_BIT(22) moved to nsIFrame.h
#define NS_STATE_AUTO_STRETCH NS_FRAME_STATE_BIT(23)
//#define NS_STATE_IS_ROOT NS_FRAME_STATE_BIT(24) moved to nsBox.h
#define NS_STATE_CURRENTLY_IN_DEBUG NS_FRAME_STATE_BIT(25)
//#define NS_STATE_SET_TO_DEBUG NS_FRAME_STATE_BIT(26) moved to nsBox.h
//#define NS_STATE_DEBUG_WAS_SET NS_FRAME_STATE_BIT(27) moved to nsBox.h
#define NS_STATE_MENU_HAS_POPUP_LIST NS_FRAME_STATE_BIT(28) /* used on nsMenuFrame */
#define NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK NS_FRAME_STATE_BIT(29)
#define NS_STATE_EQUAL_SIZE NS_FRAME_STATE_BIT(30)
//#define NS_STATE_IS_DIRECTION_NORMAL NS_FRAME_STATE_BIT(31) moved to nsIFrame.h
#define NS_FRAME_MOUSE_THROUGH_ALWAYS NS_FRAME_STATE_BIT(60)
#define NS_FRAME_MOUSE_THROUGH_NEVER NS_FRAME_STATE_BIT(61)
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell, nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, nsStyleContext* aContext,
bool aIsRoot, bool aIsRoot,
@ -32,10 +48,6 @@ class nsBoxFrame : public nsContainerFrame
{ {
public: public:
NS_DECL_FRAMEARENA_HELPERS NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
NS_DECL_QUERYFRAME_TARGET(nsBoxFrame)
NS_DECL_QUERYFRAME
#endif
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell, friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext, nsStyleContext* aContext,

View File

@ -203,7 +203,7 @@ nsSprocketLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aState)
// The frame state contains cached knowledge about our box, such as our orientation // The frame state contains cached knowledge about our box, such as our orientation
// and direction. // and direction.
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
// Build a list of our children's desired sizes and computed sizes // Build a list of our children's desired sizes and computed sizes
@ -642,7 +642,7 @@ nsSprocketLayout::PopulateBoxSizes(nsIFrame* aBox, nsBoxLayoutState& aState, nsB
nscoord biggestMinWidth = 0; nscoord biggestMinWidth = 0;
nscoord smallestMaxWidth = NS_INTRINSICSIZE; nscoord smallestMaxWidth = NS_INTRINSICSIZE;
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
//if (frameState & NS_STATE_CURRENTLY_IN_DEBUG) //if (frameState & NS_STATE_CURRENTLY_IN_DEBUG)
@ -888,7 +888,7 @@ nsSprocketLayout::ComputeChildsNextPosition(nsIFrame* aBox,
{ {
// Get the position along the box axis for the child. // Get the position along the box axis for the child.
// The out-of-axis position is not set. // The out-of-axis position is not set.
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
if (IsHorizontal(aBox)) { if (IsHorizontal(aBox)) {
@ -911,7 +911,7 @@ void
nsSprocketLayout::AlignChildren(nsIFrame* aBox, nsSprocketLayout::AlignChildren(nsIFrame* aBox,
nsBoxLayoutState& aState) nsBoxLayoutState& aState)
{ {
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
bool isHorizontal = (frameState & NS_STATE_IS_HORIZONTAL) != 0; bool isHorizontal = (frameState & NS_STATE_IS_HORIZONTAL) != 0;
nsRect clientRect; nsRect clientRect;
@ -1306,7 +1306,7 @@ nsSprocketLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// return us the size of the box // return us the size of the box
nsIFrame* child = aBox->GetChildBox(); nsIFrame* child = aBox->GetChildBox();
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE); bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
int32_t count = 0; int32_t count = 0;
@ -1363,7 +1363,7 @@ nsSprocketLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// return us the size of the box // return us the size of the box
nsIFrame* child = aBox->GetChildBox(); nsIFrame* child = aBox->GetChildBox();
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE); bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
int32_t count = 0; int32_t count = 0;
@ -1432,7 +1432,7 @@ nsSprocketLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aState)
// return us the size of the box // return us the size of the box
nsIFrame* child = aBox->GetChildBox(); nsIFrame* child = aBox->GetChildBox();
nsFrameState frameState = nsFrameState(0); nsFrameState frameState = 0;
GetFrameState(aBox, frameState); GetFrameState(aBox, frameState);
bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE); bool isEqual = !!(frameState & NS_STATE_EQUAL_SIZE);
int32_t count = 0; int32_t count = 0;

View File

@ -84,19 +84,6 @@ called with a smart pointer like nsRefPtr or nsCOMPtr.
11 11
* pstate EXPR
Shows the frame state bits (using their symbolic names) of a given frame.
EXPR is an expression that is evaluated, and must be an nsIFrame*.
(lldb) p this
(nsTextFrame *) $1 = 0x000000011f470b10
(lldb) p/x mState
(nsFrameState) $2 = 0x0000004080604000
(lldb) pstate this
TEXT_HAS_NONCOLLAPSED_CHARACTERS | TEXT_END_OF_LINE | TEXT_START_OF_LINE | NS_FRAME_PAINTED_THEBES | NS_FRAME_INDEPENDENT_SELECTION
* ptag EXPR * ptag EXPR
Shows the DOM tag name of a node. EXPR is an expression that is Shows the DOM tag name of a node. EXPR is an expression that is

View File

@ -8,13 +8,8 @@ def frametreelimited(debugger, command, result, dict):
"""Dumps the subtree of a frame tree rooted at the given nsIFrame*.""" """Dumps the subtree of a frame tree rooted at the given nsIFrame*."""
debugger.HandleCommand('expr (' + command + ')->DumpFrameTreeLimited()') debugger.HandleCommand('expr (' + command + ')->DumpFrameTreeLimited()')
def pstate(debugger, command, result, dict):
"""Displays a frame's state bits symbolically."""
debugger.HandleCommand('expr mozilla::PrintFrameState(' + command + ')')
def init(debugger): def init(debugger):
debugger.HandleCommand('command script add -f lldbutils.layout.frametree frametree') debugger.HandleCommand('command script add -f lldbutils.layout.frametree frametree')
debugger.HandleCommand('command script add -f lldbutils.layout.frametreelimited frametreelimited') debugger.HandleCommand('command script add -f lldbutils.layout.frametreelimited frametreelimited')
debugger.HandleCommand('command alias ft frametree') debugger.HandleCommand('command alias ft frametree')
debugger.HandleCommand('command alias ftl frametreelimited') debugger.HandleCommand('command alias ftl frametreelimited')
debugger.HandleCommand('command script add -f lldbutils.layout.pstate pstate');