Source code

Revision control

Copy as Markdown

Other Tools

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 three macros that can be defined before #including this
file:
FRAME_STATE_GROUP_NAME(name_)
This denotes the existence of a named group of frame state bits.
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_GROUP_CLASS(group_, class_)
class_ is the name of a frame class that uses the frame state bits
that are a part of the 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_NAME
#define FRAME_STATE_GROUP_NAME(name_) /* nothing */
#define DEFINED_FRAME_STATE_GROUP_NAME
#endif
#ifndef FRAME_STATE_GROUP_CLASS
#define FRAME_STATE_GROUP_CLASS(name_, class_) /* nothing */
#define DEFINED_FRAME_STATE_GROUP_CLASS
#endif
#ifndef FRAME_STATE_BIT
#define FRAME_STATE_BIT(group_, value_, name_) /* nothing */
#define DEFINED_FRAME_STATE_BIT
#endif
// Helper macro for the common case of a single class
#define FRAME_STATE_GROUP(name_, class_) \
FRAME_STATE_GROUP_NAME(name_) \
FRAME_STATE_GROUP_CLASS(name_, class_)
// == Frame state bits that apply to all frames ===============================
FRAME_STATE_GROUP(Generic, nsIFrame)
// This bit is set when the frame is actively being reflowed. It is set in many
// frames' Reflow() by calling MarkInReflow() and unset in DidReflow().
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)
// Free bit here.
// 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 block-size 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_BSIZE)
// 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
// PresShell::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
// nsIFrame::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
// PresShell::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 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. (this is only set on nsBlockFrame/nsInlineFrame frames)
FRAME_STATE_BIT(Generic, 15, NS_FRAME_PART_OF_IBSPLIT)
// 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)
// 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)
// 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)
// Intrinsic ISize depending on the frame's BSize is rare but possible.
// This flag indicates that the frame has (or once had) a descendant in that
// situation (possibly the frame itself).
FRAME_STATE_BIT(Generic, 34,
NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE)
// A flag that tells us we can take the common path with respect to style
// properties for this frame when building event regions. This flag is cleared
// when any styles are changed and then we recompute it on the next build
// of the event regions.
FRAME_STATE_BIT(Generic, 35, NS_FRAME_SIMPLE_EVENT_REGIONS)
// 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 PaintedLayer.
FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES)
// Frame is or is a descendant of something with a fixed block-size, 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_BSIZE)
// 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 SVGOuterSVGFrame since it takes part in CSS layout.
FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT)
// This bit is set if a frame has a multi-column ancestor (i.e.
// ColumnSetWrapperFrame) within the same block formatting context. A top-level
// ColumnSetWrapperFrame doesn't have this bit set, whereas a
// ColumnSetWrapperFrame nested inside a column does have this bit set.
//
// All the children of the column-spanners or any other type of frames which
// create their own block formatting context do not have this bit set because
// they are not in the same block formatting context created by a multi-column
// ancestor.
FRAME_STATE_BIT(Generic, 44, NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR)
// If this bit is set, then reflow may be dispatched from the current
// frame instead of the root frame.
FRAME_STATE_BIT(Generic, 45, NS_FRAME_DYNAMIC_REFLOW_ROOT)
// This bit indicates that we're tracking visibility for this frame, and that
// the frame has a VisibilityStateProperty property.
FRAME_STATE_BIT(Generic, 46, NS_FRAME_VISIBILITY_IS_TRACKED)
// 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)
// Frame owns anonymous boxes whose ComputedStyles it will need to update
// during a stylo tree traversal.
FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
// Frame maybe has a counter-reset/increment style
FRAME_STATE_BIT(Generic, 56, NS_FRAME_HAS_CSS_COUNTER_STYLE)
// The display list of the frame can be handled by the shortcut for
// COMMON CASE.
FRAME_STATE_BIT(Generic, 57, NS_FRAME_SIMPLE_DISPLAYLIST)
// 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.
// NOTE: No more unused bits. If needed, investigate removing obsolete bits by
// adjusting logic, or moving infrequently-used bits elsewhere. If more space
// for frame state is still needed, look for bit field gaps in nsIFrame.
// == Frame state bits that apply to flex container frames ====================
FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
// True iff the normal flow children are already in CSS 'order' in the
// order they occur in the child frame list.
FRAME_STATE_BIT(FlexContainer, 20,
NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
// Set for a flex container that is emulating a legacy
// 'display:-webkit-{inline-}box'.
FRAME_STATE_BIT(FlexContainer, 21, NS_STATE_FLEX_IS_EMULATING_LEGACY_WEBKIT_BOX)
// True if the container has no flex items; may lie if there is a pending reflow
FRAME_STATE_BIT(FlexContainer, 22, NS_STATE_FLEX_SYNTHESIZE_BASELINE)
// True iff some first-in-flow in-flow children were pushed.
// Note that those child frames may have been removed without this bit
// being updated for performance reasons, so code shouldn't depend on
// actually finding any pushed items when this bit is set.
FRAME_STATE_BIT(FlexContainer, 23, NS_STATE_FLEX_DID_PUSH_ITEMS)
// We've merged some OverflowList children since last reflow.
FRAME_STATE_BIT(FlexContainer, 24, NS_STATE_FLEX_HAS_CHILD_NIFS)
// True if the next reflow of this frame should generate computed info metrics.
// These are used by devtools to reveal details of the layout process.
FRAME_STATE_BIT(FlexContainer, 25, NS_STATE_FLEX_COMPUTED_INFO)
// == Frame state bits that apply to grid container frames ====================
FRAME_STATE_GROUP(GridContainer, nsGridContainerFrame)
// True iff the normal flow children are already in CSS 'order' in the
// order they occur in the child frame list.
FRAME_STATE_BIT(GridContainer, 20,
NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
// True iff some first-in-flow in-flow children were pushed.
// Note that those child frames may have been removed without this bit
// being updated for performance reasons, so code shouldn't depend on
// actually finding any pushed items when this bit is set.
FRAME_STATE_BIT(GridContainer, 21, NS_STATE_GRID_DID_PUSH_ITEMS)
// True if the container has no grid items; may lie if there is a pending
// reflow.
FRAME_STATE_BIT(GridContainer, 22, NS_STATE_GRID_SYNTHESIZE_BASELINE)
// True if the container is a subgrid in its inline axis.
FRAME_STATE_BIT(GridContainer, 23, NS_STATE_GRID_IS_COL_SUBGRID)
// True if the container is a subgrid in its block axis.
FRAME_STATE_BIT(GridContainer, 24, NS_STATE_GRID_IS_ROW_SUBGRID)
// The container contains one or more items subgridded in its inline axis.
FRAME_STATE_BIT(GridContainer, 25, NS_STATE_GRID_HAS_COL_SUBGRID_ITEM)
// The container contains one or more items subgridded in its block axis.
FRAME_STATE_BIT(GridContainer, 26, NS_STATE_GRID_HAS_ROW_SUBGRID_ITEM)
// We've merged some OverflowList children since last reflow.
FRAME_STATE_BIT(GridContainer, 27, NS_STATE_GRID_HAS_CHILD_NIFS)
// True if the container has masonry layout in its inline axis.
// (mutually exclusive with NS_STATE_GRID_IS_ROW_MASONRY)