Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / layout / generic / nsFrameStateBits.h
blobd6ccf0ea90924e114aea5ab2d3f7529894c9e7c6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* a list of all frame state bits, for preprocessing */
9 /******
11 This file contains definitions for frame state bits -- values used
12 in nsIFrame::mState -- and groups of frame state bits and which
13 classes they apply to.
15 There are three macros that can be defined before #including this
16 file:
18 FRAME_STATE_GROUP_NAME(name_)
20 This denotes the existence of a named group of frame state bits.
22 The main group of frame state bits is named "Generic" and is
23 defined to apply to nsIFrame, i.e. all frames. All of the global
24 frame state bits -- bits 0..19 and 32..59 -- are in this group.
26 FRAME_STATE_GROUP_CLASS(group_, class_)
27 class_ is the name of a frame class that uses the frame state bits
28 that are a part of the group.
30 FRAME_STATE_BIT(group_, value_, name_)
32 This denotes the existence of a frame state bit. group_ indicates
33 which group the bit belongs to, value_ is the bit number (0..63),
34 and name_ is the name of the frame state bit constant.
36 Note that if you add a new frame state group, you'll need to #include
37 the header for its frame classes in nsFrameState.cpp and, if they don't
38 already, add nsQueryFrame implementations (which can be DEBUG-only) to
39 the frame classes.
41 ******/
43 #ifndef FRAME_STATE_GROUP_NAME
44 #define FRAME_STATE_GROUP_NAME(name_) /* nothing */
45 #define DEFINED_FRAME_STATE_GROUP_NAME
46 #endif
48 #ifndef FRAME_STATE_GROUP_CLASS
49 #define FRAME_STATE_GROUP_CLASS(name_, class_) /* nothing */
50 #define DEFINED_FRAME_STATE_GROUP_CLASS
51 #endif
53 #ifndef FRAME_STATE_BIT
54 #define FRAME_STATE_BIT(group_, value_, name_) /* nothing */
55 #define DEFINED_FRAME_STATE_BIT
56 #endif
58 // Helper macro for the common case of a single class
59 #define FRAME_STATE_GROUP(name_, class_) \
60 FRAME_STATE_GROUP_NAME(name_) \
61 FRAME_STATE_GROUP_CLASS(name_, class_)
63 // == Frame state bits that apply to all frames ===============================
65 FRAME_STATE_GROUP(Generic, nsIFrame)
67 // This bit is set when the frame is actively being reflowed. It is set in many
68 // frames' Reflow() by calling MarkInReflow() and unset in DidReflow().
69 FRAME_STATE_BIT(Generic, 0, NS_FRAME_IN_REFLOW)
71 // This bit is set when a frame is created. After it has been reflowed
72 // once (during the DidReflow with a finished state) the bit is
73 // cleared.
74 FRAME_STATE_BIT(Generic, 1, NS_FRAME_FIRST_REFLOW)
76 // For a continuation frame, if this bit is set, then this a "fluid"
77 // continuation, i.e., across a line boundary. Otherwise it's a "hard"
78 // continuation, e.g. a bidi continuation.
79 FRAME_STATE_BIT(Generic, 2, NS_FRAME_IS_FLUID_CONTINUATION)
81 // Free bit here.
83 // If this bit is set, then a reference to the frame is being held
84 // elsewhere. The frame may want to send a notification when it is
85 // destroyed to allow these references to be cleared.
86 FRAME_STATE_BIT(Generic, 4, NS_FRAME_EXTERNAL_REFERENCE)
88 // If this bit is set, this frame or one of its descendants has a
89 // percentage block-size that depends on an ancestor of this frame.
90 // (Or it did at one point in the past, since we don't necessarily clear
91 // the bit when it's no longer needed; it's an optimization.)
92 FRAME_STATE_BIT(Generic, 5, NS_FRAME_CONTAINS_RELATIVE_BSIZE)
94 // If this bit is set, then the frame corresponds to generated content
95 FRAME_STATE_BIT(Generic, 6, NS_FRAME_GENERATED_CONTENT)
97 // If this bit is set the frame is a continuation that is holding overflow,
98 // i.e. it is a next-in-flow created to hold overflow after the box's
99 // height has ended. This means the frame should be a) at the top of the
100 // page and b) invisible: no borders, zero height, ignored in margin
101 // collapsing, etc. See nsContainerFrame.h
102 FRAME_STATE_BIT(Generic, 7, NS_FRAME_IS_OVERFLOW_CONTAINER)
104 // If this bit is set, then the frame has been moved out of the flow,
105 // e.g., it is absolutely positioned or floated
106 FRAME_STATE_BIT(Generic, 8, NS_FRAME_OUT_OF_FLOW)
108 // Frame can be an abs/fixed pos. container, if its style says so.
109 // MarkAs[Not]AbsoluteContainingBlock will assert that this bit is set.
110 // NS_FRAME_HAS_ABSPOS_CHILDREN must not be set when this bit is unset.
111 FRAME_STATE_BIT(Generic, 9, NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)
113 // If this bit is set, then the frame and _all_ of its descendant frames need
114 // to be reflowed.
115 // This bit is set when the frame is first created.
116 // This bit is cleared by DidReflow after the required call to Reflow has
117 // finished.
118 // Do not set this bit yourself if you plan to pass the frame to
119 // PresShell::FrameNeedsReflow. Pass the right arguments instead.
120 FRAME_STATE_BIT(Generic, 10, NS_FRAME_IS_DIRTY)
122 // If this bit is set then the frame is too deep in the frame tree, and
123 // we'll stop updating it and its children, to prevent stack overflow
124 // and the like.
125 FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
127 // If this bit is set, then either:
128 // 1. the frame has at least one child that has the NS_FRAME_IS_DIRTY bit or
129 // NS_FRAME_HAS_DIRTY_CHILDREN bit set, or
130 // 2. the frame has had at least one child removed since the last reflow, or
131 // 3. the frame has had a style change that requires the frame to be reflowed
132 // but does not _necessarily_ require its descendants to be reflowed (e.g.,
133 // for a 'height', 'width', 'margin', etc. change, it's up to the
134 // applicable Reflow methods to decide whether the frame's children
135 // _actually_ need to be reflowed).
136 // If this bit is set but the NS_FRAME_IS_DIRTY is not set, then Reflow still
137 // needs to be called on the frame, but Reflow will likely not do as much work
138 // as it would if NS_FRAME_IS_DIRTY were set. See the comment documenting
139 // nsIFrame::Reflow for more.
140 // This bit is cleared by DidReflow after the required call to Reflow has
141 // finished.
142 // Do not set this bit yourself if you plan to pass the frame to
143 // PresShell::FrameNeedsReflow. Pass the right arguments instead.
144 FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN)
146 // If this bit is set, the frame has an associated view
147 FRAME_STATE_BIT(Generic, 13, NS_FRAME_HAS_VIEW)
149 // If this bit is set, the frame was created from anonymous content.
150 FRAME_STATE_BIT(Generic, 14, NS_FRAME_INDEPENDENT_SELECTION)
152 // If this bit is set, the frame is part of the mangled frame hierarchy
153 // that results when an inline has been split because of a nested block.
154 // See the comments in nsCSSFrameConstructor::ConstructInline for
155 // more details. (this is only set on nsBlockFrame/nsInlineFrame frames)
156 FRAME_STATE_BIT(Generic, 15, NS_FRAME_PART_OF_IBSPLIT)
158 // If this bit is set, then transforms (e.g. CSS or SVG transforms) are allowed
159 // to affect the frame, and a transform may currently be in affect. If this bit
160 // is not set, then any transforms on the frame will be ignored.
161 // This is used primarily in GetTransformMatrix to optimize for the
162 // common case.
163 FRAME_STATE_BIT(Generic, 16, NS_FRAME_MAY_BE_TRANSFORMED)
165 // If this bit is set, the frame itself is a bidi continuation,
166 // or is incomplete (its next sibling is a bidi continuation)
167 FRAME_STATE_BIT(Generic, 17, NS_FRAME_IS_BIDI)
169 // If this bit is set the frame has descendant with a view
170 FRAME_STATE_BIT(Generic, 18, NS_FRAME_HAS_CHILD_WITH_VIEW)
172 // If this bit is set, then reflow may be dispatched from the current
173 // frame instead of the root frame.
174 FRAME_STATE_BIT(Generic, 19, NS_FRAME_REFLOW_ROOT)
176 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
177 // frame classes.
179 // This bit is set on floats whose parent does not contain their
180 // placeholder. This can happen for two reasons: (1) the float was
181 // split, and this piece is the continuation, or (2) the entire float
182 // didn't fit on the page.
183 // Note that this bit is also shared by text frames for
184 // TEXT_IS_IN_TOKEN_MATHML. That's OK because we only check the
185 // NS_FRAME_IS_PUSHED_FLOAT bit on frames which we already know are
186 // out-of-flow.
187 FRAME_STATE_BIT(Generic, 32, NS_FRAME_IS_PUSHED_FLOAT)
189 // This bit acts as a loop flag for recursive paint server drawing.
190 FRAME_STATE_BIT(Generic, 33, NS_FRAME_DRAWING_AS_PAINTSERVER)
192 // Intrinsic ISize depending on the frame's BSize is rare but possible.
193 // This flag indicates that the frame has (or once had) a descendant in that
194 // situation (possibly the frame itself).
195 FRAME_STATE_BIT(Generic, 34,
196 NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE)
198 // A flag that tells us we can take the common path with respect to style
199 // properties for this frame when building event regions. This flag is cleared
200 // when any styles are changed and then we recompute it on the next build
201 // of the event regions.
202 FRAME_STATE_BIT(Generic, 35, NS_FRAME_SIMPLE_EVENT_REGIONS)
204 // Frame is a display root and the retained layer tree needs to be updated
205 // at the next paint via display list construction.
206 // Only meaningful for display roots, so we don't really need a global state
207 // bit; we could free up this bit with a little extra complexity.
208 FRAME_STATE_BIT(Generic, 36, NS_FRAME_UPDATE_LAYER_TREE)
210 // Frame can accept absolutely positioned children.
211 FRAME_STATE_BIT(Generic, 37, NS_FRAME_HAS_ABSPOS_CHILDREN)
213 // A display item for this frame has been painted as part of a PaintedLayer.
214 FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES)
216 // Frame is or is a descendant of something with a fixed block-size, unless
217 // that ancestor is a body or html element, and has no closer ancestor that is
218 // overflow:auto or overflow:scroll.
219 FRAME_STATE_BIT(Generic, 39, NS_FRAME_IN_CONSTRAINED_BSIZE)
221 // This is only set during painting
222 FRAME_STATE_BIT(Generic, 40, NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)
224 // Is this frame a container for font size inflation, i.e., is it a
225 // frame whose width is used to determine the inflation factor for
226 // everything whose nearest ancestor container for this frame?
227 FRAME_STATE_BIT(Generic, 41, NS_FRAME_FONT_INFLATION_CONTAINER)
229 // Does this frame manage a region in which we do font size inflation,
230 // i.e., roughly, is it an element establishing a new block formatting
231 // context?
232 FRAME_STATE_BIT(Generic, 42, NS_FRAME_FONT_INFLATION_FLOW_ROOT)
234 // This bit is set on SVG frames that are laid out using SVG's coordinate
235 // system based layout (as opposed to any of the CSS layout models). Note that
236 // this does not include SVGOuterSVGFrame since it takes part in CSS layout.
237 FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT)
239 // This bit is set if a frame has a multi-column ancestor (i.e.
240 // ColumnSetWrapperFrame) within the same block formatting context. A top-level
241 // ColumnSetWrapperFrame doesn't have this bit set, whereas a
242 // ColumnSetWrapperFrame nested inside a column does have this bit set.
244 // All the children of the column-spanners or any other type of frames which
245 // create their own block formatting context do not have this bit set because
246 // they are not in the same block formatting context created by a multi-column
247 // ancestor.
248 FRAME_STATE_BIT(Generic, 44, NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR)
250 // If this bit is set, then reflow may be dispatched from the current
251 // frame instead of the root frame.
252 FRAME_STATE_BIT(Generic, 45, NS_FRAME_DYNAMIC_REFLOW_ROOT)
254 // This bit indicates that we're tracking visibility for this frame, and that
255 // the frame has a VisibilityStateProperty property.
256 FRAME_STATE_BIT(Generic, 46, NS_FRAME_VISIBILITY_IS_TRACKED)
258 // The frame is a descendant of SVGTextFrame and is thus used for SVG
259 // text layout.
260 FRAME_STATE_BIT(Generic, 47, NS_FRAME_IS_SVG_TEXT)
262 // Frame is marked as needing painting
263 FRAME_STATE_BIT(Generic, 48, NS_FRAME_NEEDS_PAINT)
265 // Frame has a descendant frame that needs painting - This includes
266 // cross-doc children.
267 FRAME_STATE_BIT(Generic, 49, NS_FRAME_DESCENDANT_NEEDS_PAINT)
269 // Frame is a descendant of a popup
270 FRAME_STATE_BIT(Generic, 50, NS_FRAME_IN_POPUP)
272 // Frame has only descendant frames that needs painting - This includes
273 // cross-doc children. This guarantees that all descendents have
274 // NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they
275 // have no display items.
276 FRAME_STATE_BIT(Generic, 51, NS_FRAME_ALL_DESCENDANTS_NEED_PAINT)
278 // Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
279 // rect stored to invalidate.
280 FRAME_STATE_BIT(Generic, 52, NS_FRAME_HAS_INVALID_RECT)
282 // Frame is not displayed directly due to it being, or being under, an SVG
283 // <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
284 FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY)
286 // Frame has a LayerActivityProperty property
287 FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY)
289 // Frame owns anonymous boxes whose ComputedStyles it will need to update
290 // during a stylo tree traversal.
291 FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
293 // Frame maybe has a counter-reset/increment style
294 FRAME_STATE_BIT(Generic, 56, NS_FRAME_HAS_CSS_COUNTER_STYLE)
296 // The display list of the frame can be handled by the shortcut for
297 // COMMON CASE.
298 FRAME_STATE_BIT(Generic, 57, NS_FRAME_SIMPLE_DISPLAYLIST)
300 // Set for all descendants of MathML sub/supscript elements (other than the
301 // base frame) to indicate that the SSTY font feature should be used.
302 FRAME_STATE_BIT(Generic, 58, NS_FRAME_MATHML_SCRIPT_DESCENDANT)
304 // This state bit is set on frames within token MathML elements if the
305 // token represents an <mi> tag whose inner HTML consists of a single
306 // non-whitespace character to allow special rendering behaviour.
307 FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI)
309 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
310 // frame classes.
312 // NOTE: No more unused bits. If needed, investigate removing obsolete bits by
313 // adjusting logic, or moving infrequently-used bits elsewhere. If more space
314 // for frame state is still needed, look for bit field gaps in nsIFrame.
316 // == Frame state bits that apply to flex container frames ====================
318 FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
320 // True iff the normal flow children are already in CSS 'order' in the
321 // order they occur in the child frame list.
322 FRAME_STATE_BIT(FlexContainer, 20,
323 NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
325 // Set for a flex container that is emulating a legacy
326 // 'display:-webkit-{inline-}box'.
327 FRAME_STATE_BIT(FlexContainer, 21, NS_STATE_FLEX_IS_EMULATING_LEGACY_WEBKIT_BOX)
329 // True if the container has no flex items; may lie if there is a pending reflow
330 FRAME_STATE_BIT(FlexContainer, 22, NS_STATE_FLEX_SYNTHESIZE_BASELINE)
332 // True iff some first-in-flow in-flow children were pushed.
333 // Note that those child frames may have been removed without this bit
334 // being updated for performance reasons, so code shouldn't depend on
335 // actually finding any pushed items when this bit is set.
336 FRAME_STATE_BIT(FlexContainer, 23, NS_STATE_FLEX_DID_PUSH_ITEMS)
338 // We've merged some OverflowList children since last reflow.
339 FRAME_STATE_BIT(FlexContainer, 24, NS_STATE_FLEX_HAS_CHILD_NIFS)
341 // == Frame state bits that apply to grid container frames ====================
343 FRAME_STATE_GROUP(GridContainer, nsGridContainerFrame)
345 // True iff the normal flow children are already in CSS 'order' in the
346 // order they occur in the child frame list.
347 FRAME_STATE_BIT(GridContainer, 20,
348 NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
350 // True iff some first-in-flow in-flow children were pushed.
351 // Note that those child frames may have been removed without this bit
352 // being updated for performance reasons, so code shouldn't depend on
353 // actually finding any pushed items when this bit is set.
354 FRAME_STATE_BIT(GridContainer, 21, NS_STATE_GRID_DID_PUSH_ITEMS)
356 // True if the container has no grid items; may lie if there is a pending
357 // reflow.
358 FRAME_STATE_BIT(GridContainer, 22, NS_STATE_GRID_SYNTHESIZE_BASELINE)
360 // True if the container is a subgrid in its inline axis.
361 FRAME_STATE_BIT(GridContainer, 23, NS_STATE_GRID_IS_COL_SUBGRID)
363 // True if the container is a subgrid in its block axis.
364 FRAME_STATE_BIT(GridContainer, 24, NS_STATE_GRID_IS_ROW_SUBGRID)
366 // The container contains one or more items subgridded in its inline axis.
367 FRAME_STATE_BIT(GridContainer, 25, NS_STATE_GRID_HAS_COL_SUBGRID_ITEM)
369 // The container contains one or more items subgridded in its block axis.
370 FRAME_STATE_BIT(GridContainer, 26, NS_STATE_GRID_HAS_ROW_SUBGRID_ITEM)
372 // We've merged some OverflowList children since last reflow.
373 FRAME_STATE_BIT(GridContainer, 27, NS_STATE_GRID_HAS_CHILD_NIFS)
375 // True if the container has masonry layout in its inline axis.
376 // (mutually exclusive with NS_STATE_GRID_IS_ROW_MASONRY)
377 FRAME_STATE_BIT(GridContainer, 28, NS_STATE_GRID_IS_COL_MASONRY)
379 // True if the container has masonry layout in its block axis.
380 // (mutually exclusive with NS_STATE_GRID_IS_COL_MASONRY)
381 FRAME_STATE_BIT(GridContainer, 29, NS_STATE_GRID_IS_ROW_MASONRY)
383 // == Frame state bits that apply to SVG frames ===============================
385 FRAME_STATE_GROUP_NAME(SVG)
386 FRAME_STATE_GROUP_CLASS(SVG, ISVGDisplayableFrame)
387 FRAME_STATE_GROUP_CLASS(SVG, SVGContainerFrame)
389 // If this bit is set, we are a <clipPath> element or descendant.
390 FRAME_STATE_BIT(SVG, 20, NS_STATE_SVG_CLIPPATH_CHILD)
392 // For SVG text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits
393 // indicate that our anonymous block child needs to be reflowed, and that
394 // mPositions will likely need to be updated as a consequence. These are set,
395 // for example, when the font-family changes. Sometimes we only need to
396 // update mPositions though. For example if the x/y attributes change.
397 // mPositioningDirty is used to indicate this latter "things are dirty" case
398 // to allow us to avoid reflowing the anonymous block when it is not
399 // necessary.
400 FRAME_STATE_BIT(SVG, 21, NS_STATE_SVG_POSITIONING_DIRTY)
402 // For text, whether the values from x/y/dx/dy attributes have any percentage
403 // values that are used in determining the positions of glyphs. The value will
404 // be true even if a positioning value is overridden by a descendant element's
405 // attribute with a non-percentage length. For example,
406 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for:
408 // <text x="10%"><tspan x="0">abc</tspan></text>
410 // Percentage values beyond the number of addressable characters, however, do
411 // not influence NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES. For example,
412 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be false for:
414 // <text x="10 20 30 40%">abc</text>
416 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether
417 // to recompute mPositions when the viewport size changes. So although the
418 // first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES
419 // can be true even if a viewport size change will not affect mPositions,
420 // determining a completley accurate value for
421 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
422 // probably not worth it.
423 FRAME_STATE_BIT(SVG, 22, NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES)
425 FRAME_STATE_BIT(SVG, 23, NS_STATE_SVG_TEXT_IN_REFLOW)
427 // Set on SVGTextFrame frames when they need a
428 // TextNodeCorrespondenceRecorder::RecordCorrespondence call
429 // to update the cached nsTextNode indexes that they correspond to.
430 FRAME_STATE_BIT(SVG, 24, NS_STATE_SVG_TEXT_CORRESPONDENCE_DIRTY)
432 // We can stop ancestor traversal of rendering observers when we hit
433 // one a frame with this state bit.
434 FRAME_STATE_BIT(SVG, 25, NS_STATE_SVG_RENDERING_OBSERVER_CONTAINER)
436 // == Frame state bits that apply to text frames ==============================
438 FRAME_STATE_GROUP(Text, nsTextFrame)
440 // -- Flags set during reflow -------------------------------------------------
442 // nsTextFrame.cpp defines TEXT_REFLOW_FLAGS to be all of these bits.
444 // This bit is set on the first frame in a continuation indicating
445 // that it was chopped short because of :first-letter style.
446 FRAME_STATE_BIT(Text, 20, TEXT_FIRST_LETTER)
448 // This bit is set on frames that are logically adjacent to the start of the
449 // line (i.e. no prior frame on line with actual displayed in-flow content).
450 FRAME_STATE_BIT(Text, 21, TEXT_START_OF_LINE)
452 // This bit is set on frames that are logically adjacent to the end of the
453 // line (i.e. no following on line with actual displayed in-flow content).
454 FRAME_STATE_BIT(Text, 22, TEXT_END_OF_LINE)
456 // This bit is set on frames that end with a hyphenated break.
457 FRAME_STATE_BIT(Text, 23, TEXT_HYPHEN_BREAK)
459 // This bit is set on frames that trimmed trailing whitespace characters when
460 // calculating their width during reflow.
461 FRAME_STATE_BIT(Text, 24, TEXT_TRIMMED_TRAILING_WHITESPACE)
463 // This bit is set on frames that have justification enabled. We record
464 // this in a state bit because we don't always have the containing block
465 // easily available to check text-align on.
466 FRAME_STATE_BIT(Text, 25, TEXT_JUSTIFICATION_ENABLED)
468 // Set this bit if the textframe has overflow area for IME/spellcheck underline.
469 FRAME_STATE_BIT(Text, 26, TEXT_SELECTION_UNDERLINE_OVERFLOWED)
471 // -- Cache bits for IsEmpty() ------------------------------------------------
473 // nsTextFrame.cpp defines TEXT_WHITESPACE_FLAGS to be both of these bits.
475 // Set this bit if the textframe is known to be only collapsible whitespace.
476 FRAME_STATE_BIT(Text, 27, TEXT_IS_ONLY_WHITESPACE)
478 // Set this bit if the textframe is known to be not only collapsible whitespace.
479 FRAME_STATE_BIT(Text, 28, TEXT_ISNOT_ONLY_WHITESPACE)
481 // -- Other state bits --------------------------------------------------------
483 // Set when this text frame is mentioned in the userdata for mTextRun
484 FRAME_STATE_BIT(Text, 29, TEXT_IN_TEXTRUN_USER_DATA)
486 // This state bit is set on frames whose character data offsets need to be
487 // fixed up
488 FRAME_STATE_BIT(Text, 30, TEXT_OFFSETS_NEED_FIXING)
490 // This state bit is set on frames that have some non-collapsed characters after
491 // reflow
492 FRAME_STATE_BIT(Text, 31, TEXT_HAS_NONCOLLAPSED_CHARACTERS)
494 // This state bit is set on children of token MathML elements.
495 // NOTE: TEXT_IS_IN_TOKEN_MATHML has a global state bit value that is shared
496 // with NS_FRAME_IS_PUSHED_FLOAT.
497 FRAME_STATE_BIT(Text, 32, TEXT_IS_IN_TOKEN_MATHML)
499 // Set when this text frame is mentioned in the userdata for the
500 // uninflated textrun property
501 FRAME_STATE_BIT(Text, 60, TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA)
503 FRAME_STATE_BIT(Text, 61, TEXT_HAS_FONT_INFLATION)
505 // Set when this text frame contains nothing that will actually render
506 FRAME_STATE_BIT(Text, 62, TEXT_NO_RENDERED_GLYPHS)
508 // Whether this frame is cached in the Offset Frame Cache
509 // (OffsetToFrameProperty)
510 FRAME_STATE_BIT(Text, 63, TEXT_IN_OFFSET_CACHE)
512 // == Frame state bits that apply to block frames =============================
514 FRAME_STATE_GROUP(Block, nsBlockFrame)
516 // Something in the block has changed that requires Bidi resolution to be
517 // performed on the block. This flag must be either set on all blocks in a
518 // continuation chain or none of them.
519 FRAME_STATE_BIT(Block, 20, NS_BLOCK_NEEDS_BIDI_RESOLUTION)
521 FRAME_STATE_BIT(Block, 21, NS_BLOCK_HAS_PUSHED_FLOATS)
523 // This indicates that this is a frame from which child margins can be
524 // calculated. The absence of this flag implies that child margin calculations
525 // should ignore the frame and look further up the parent chain. Used in
526 // nsBlockReflowContext::ComputeCollapsedBStartMargin() via
527 // nsBlockFrame::IsMarginRoot().
529 // This causes the BlockReflowState's constructor to set the
530 // mIsBStartMarginRoot and mIsBEndMarginRoot flags.
531 FRAME_STATE_BIT(Block, 22, NS_BLOCK_MARGIN_ROOT)
533 // This indicates that a block frame should create its own float manager. This
534 // is required by each block frame that can contain floats. The float manager is
535 // used to reserve space for the floated frames.
536 FRAME_STATE_BIT(Block, 23, NS_BLOCK_FLOAT_MGR)
538 // For setting the relevant bits on a block formatting context:
539 #define NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS \
540 (NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT)
542 FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_LINE_CURSOR)
544 FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_LINES)
546 FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)
548 // Set on any block that has descendant frames in the normal
549 // flow with 'clear' set to something other than 'none'
550 // (including <BR CLEAR="..."> frames)
551 FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_CLEAR_CHILDREN)
553 // NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
554 // blocks which were forced to not have scrollframes but still need to clip
555 // the display of their kids.
556 FRAME_STATE_BIT(Block, 28, NS_BLOCK_CLIP_PAGINATED_OVERFLOW)
558 // NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
559 // even if it has no actual first-letter frame among its descendants.
560 FRAME_STATE_BIT(Block, 29, NS_BLOCK_HAS_FIRST_LETTER_STYLE)
562 // NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER and NS_BLOCK_FRAME_HAS_INSIDE_MARKER
563 // means the block has an associated ::marker frame, they are mutually
564 // exclusive.
565 FRAME_STATE_BIT(Block, 30, NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER)
566 FRAME_STATE_BIT(Block, 31, NS_BLOCK_FRAME_HAS_INSIDE_MARKER)
568 // NS_BLOCK_HAS_LINE_CLAMP_ELLIPSIS indicates that exactly one line in this
569 // block has the LineClampEllipsis flag set, and that such a line must be found
570 // and have that flag cleared when reflowing this element's nearest legacy box
571 // container.
572 FRAME_STATE_BIT(Block, 60, NS_BLOCK_HAS_LINE_CLAMP_ELLIPSIS)
574 // This block has had a child marked dirty, so before we reflow we need
575 // to look through the lines to find any such children and mark
576 // appropriate lines dirty.
577 FRAME_STATE_BIT(Block, 61, NS_BLOCK_LOOK_FOR_DIRTY_FRAMES)
579 // Are our cached intrinsic widths intrinsic widths for font size
580 // inflation? i.e., what was the current state of
581 // GetPresContext()->mInflationDisabledForShrinkWrap at the time they
582 // were computed?
583 // nsBlockFrame is the only thing that caches intrinsic widths that
584 // needs to track this because it's the only thing that caches intrinsic
585 // widths that lives inside of things (form controls) that do intrinsic
586 // sizing with font inflation enabled.
587 FRAME_STATE_BIT(Block, 62, NS_BLOCK_FRAME_INTRINSICS_INFLATED)
589 // NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
590 // frame among the block's descendants. If there is a floating first-letter
591 // frame, or the block has first-letter style but has no first letter, this
592 // bit is not set. This bit is set on the first continuation only.
593 FRAME_STATE_BIT(Block, 63, NS_BLOCK_HAS_FIRST_LETTER_CHILD)
595 // == Frame state bits that apply to image frames =============================
597 FRAME_STATE_GROUP(Image, nsImageFrame)
599 FRAME_STATE_BIT(Image, 20, IMAGE_SIZECONSTRAINED)
601 // == Frame state bits that apply to inline frames ============================
603 FRAME_STATE_GROUP(Inline, nsInlineFrame)
605 /** In Bidi inline start (or end) margin/padding/border should be applied to
606 * first (or last) frame (or a continuation frame).
607 * This state value shows if this frame is first (or last) continuation
608 * or not.
611 FRAME_STATE_BIT(Inline, 21, NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET)
612 FRAME_STATE_BIT(Inline, 22, NS_INLINE_FRAME_BIDI_VISUAL_IS_FIRST)
613 FRAME_STATE_BIT(Inline, 23, NS_INLINE_FRAME_BIDI_VISUAL_IS_LAST)
614 // nsRubyTextFrame inherits from nsInlineFrame
616 // == Frame state bits that apply to ruby text frames =========================
618 FRAME_STATE_GROUP(RubyText, nsRubyTextFrame)
620 // inherits from nsInlineFrame
621 FRAME_STATE_BIT(RubyText, 24, NS_RUBY_TEXT_FRAME_COLLAPSED)
623 // == Frame state bits that apply to ruby text container frames ===============
625 FRAME_STATE_GROUP(RubyTextContainer, nsRubyTextContainerFrame)
627 FRAME_STATE_BIT(RubyTextContainer, 20, NS_RUBY_TEXT_CONTAINER_IS_SPAN)
629 // == Frame state bits that apply to placeholder frames =======================
631 FRAME_STATE_GROUP(Placeholder, nsPlaceholderFrame)
633 // Frame state bits that are used to keep track of what this is a
634 // placeholder for.
636 FRAME_STATE_BIT(Placeholder, 20, PLACEHOLDER_FOR_FLOAT)
637 FRAME_STATE_BIT(Placeholder, 21, PLACEHOLDER_FOR_ABSPOS)
638 FRAME_STATE_BIT(Placeholder, 22, PLACEHOLDER_FOR_FIXEDPOS)
639 FRAME_STATE_BIT(Placeholder, 24, PLACEHOLDER_FOR_TOPLAYER)
641 // This bit indicates that the out-of-flow frame's static position needs to be
642 // determined using the CSS Box Alignment properties
643 // ([align,justify]-[self,content]). When this is set, the placeholder frame's
644 // position doesn't represent the static position, as it usually would --
645 // rather, it represents the logical start corner of the alignment containing
646 // block. Then, after we've determined the out-of-flow frame's size, we can
647 // resolve the actual static position using the alignment properties.
648 FRAME_STATE_BIT(Placeholder, 25, PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN)
650 // Are all earlier frames on the same block line empty?
651 FRAME_STATE_BIT(Placeholder, 26, PLACEHOLDER_LINE_IS_EMPTY_SO_FAR)
652 // Does the above bit have a valid value?
653 FRAME_STATE_BIT(Placeholder, 27, PLACEHOLDER_HAVE_LINE_IS_EMPTY_SO_FAR)
655 // == Frame state bits that apply to table cell frames ========================
657 FRAME_STATE_GROUP(TableCell, nsTableCellFrame)
659 FRAME_STATE_BIT(TableCell, 20, NS_TABLE_CELL_HAD_SPECIAL_REFLOW)
660 FRAME_STATE_BIT(TableCell, 21, NS_TABLE_CELL_CONTENT_EMPTY)
662 // == Frame state bits that apply to table column frames ======================
664 // Bits 28-31 on nsTableColFrames are used to store the column type.
666 // == Frame state bits that apply to table column group frames ================
668 // Bits 30-31 on nsTableColGroupFrames are used to store the column type.
670 // == Frame state bits that apply to table rows and table row group frames ====
672 FRAME_STATE_GROUP_NAME(TableRowAndRowGroup)
673 FRAME_STATE_GROUP_CLASS(TableRowAndRowGroup, nsTableRowFrame)
674 FRAME_STATE_GROUP_CLASS(TableRowAndRowGroup, nsTableRowGroupFrame)
676 // see nsTableRowGroupFrame::InitRepeatedFrame
677 FRAME_STATE_BIT(TableRowAndRowGroup, 28, NS_REPEATED_ROW_OR_ROWGROUP)
679 // == Frame state bits that apply to table row frames =========================
681 FRAME_STATE_GROUP(TableRow, nsTableRowFrame)
683 // Indicates whether this row has any cells that have
684 // non-auto-bsize and rowspan=1
685 FRAME_STATE_BIT(TableRow, 29, NS_ROW_HAS_CELL_WITH_STYLE_BSIZE)
687 FRAME_STATE_BIT(TableRow, 30, NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE)
689 // == Frame state bits that apply to table row group frames ===================
691 FRAME_STATE_GROUP(TableRowGroup, nsTableRowGroupFrame)
693 FRAME_STATE_BIT(TableRowGroup, 27, NS_ROWGROUP_HAS_ROW_CURSOR)
694 FRAME_STATE_BIT(TableRowGroup, 30, NS_ROWGROUP_HAS_STYLE_BSIZE)
696 // thead or tfoot should be repeated on every printed page
697 FRAME_STATE_BIT(TableRowGroup, 31, NS_ROWGROUP_REPEATABLE)
699 FRAME_STATE_GROUP(Table, nsTableFrame)
701 FRAME_STATE_BIT(Table, 28, NS_TABLE_PART_HAS_FIXED_BACKGROUND)
703 // == Frame state bits that apply to page frames ==============================
704 FRAME_STATE_GROUP(Page, nsPageFrame)
706 // If set, this bit indicates that the given nsPageFrame has been skipped
707 // via the user's custom-page-range choice, and should not be rendered.
708 FRAME_STATE_BIT(Page, 20, NS_PAGE_SKIPPED_BY_CUSTOM_RANGE)
710 #undef FRAME_STATE_GROUP
712 #ifdef DEFINED_FRAME_STATE_GROUP_NAME
713 #undef DEFINED_FRAME_STATE_GROUP_NAME
714 #undef FRAME_STATE_GROUP_NAME
715 #endif
717 #ifdef DEFINED_FRAME_STATE_GROUP_CLASS
718 #undef DEFINED_FRAME_STATE_GROUP_CLASS
719 #undef FRAME_STATE_GROUP_CLASS
720 #endif
722 #ifdef DEFINED_FRAME_STATE_BIT
723 #undef DEFINED_FRAME_STATE_BIT
724 #undef FRAME_STATE_BIT
725 #endif