nsFrameStateBits.h (31329B)
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/. */ 6 7 /* a list of all frame state bits, for preprocessing */ 8 9 /****** 10 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. 14 15 There are three macros that can be defined before #including this 16 file: 17 18 FRAME_STATE_GROUP_NAME(name_) 19 20 This denotes the existence of a named group of frame state bits. 21 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. 25 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. 29 30 FRAME_STATE_BIT(group_, value_, name_) 31 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. 35 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. 40 41 ******/ 42 43 #ifndef FRAME_STATE_GROUP_NAME 44 #define FRAME_STATE_GROUP_NAME(name_) /* nothing */ 45 #define DEFINED_FRAME_STATE_GROUP_NAME 46 #endif 47 48 #ifndef FRAME_STATE_GROUP_CLASS 49 #define FRAME_STATE_GROUP_CLASS(name_, class_) /* nothing */ 50 #define DEFINED_FRAME_STATE_GROUP_CLASS 51 #endif 52 53 #ifndef FRAME_STATE_BIT 54 #define FRAME_STATE_BIT(group_, value_, name_) /* nothing */ 55 #define DEFINED_FRAME_STATE_BIT 56 #endif 57 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_) 62 63 // == Frame state bits that apply to all frames =============================== 64 65 FRAME_STATE_GROUP(Generic, nsIFrame) 66 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) 70 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) 75 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) 80 81 // Whether this frame is being captured in a view transition. 82 FRAME_STATE_BIT(Generic, 3, NS_FRAME_CAPTURED_IN_VIEW_TRANSITION) 83 84 // If this bit is set, then a reference to the frame is being held 85 // elsewhere. The frame may want to send a notification when it is 86 // destroyed to allow these references to be cleared. 87 FRAME_STATE_BIT(Generic, 4, NS_FRAME_EXTERNAL_REFERENCE) 88 89 // If this bit is set, this frame or one of its descendants has a 90 // percentage block-size that depends on an ancestor of this frame. 91 // (Or it did at one point in the past, since we don't necessarily clear 92 // the bit when it's no longer needed; it's an optimization.) 93 FRAME_STATE_BIT(Generic, 5, NS_FRAME_CONTAINS_RELATIVE_BSIZE) 94 95 // If this bit is set, then the frame corresponds to generated content 96 FRAME_STATE_BIT(Generic, 6, NS_FRAME_GENERATED_CONTENT) 97 98 // If this bit is set the frame is a continuation that is holding overflow, 99 // i.e. it is a next-in-flow created to hold overflow after the box's 100 // height has ended. This means the frame should be a) at the top of the 101 // page and b) invisible: no borders, zero height, ignored in margin 102 // collapsing, etc. See nsContainerFrame.h 103 FRAME_STATE_BIT(Generic, 7, NS_FRAME_IS_OVERFLOW_CONTAINER) 104 105 // If this bit is set, then the frame has been moved out of the flow, 106 // e.g., it is absolutely positioned or floated 107 FRAME_STATE_BIT(Generic, 8, NS_FRAME_OUT_OF_FLOW) 108 109 // Frame can be an abs/fixed pos. container, if its style says so. 110 // MarkAs[Not]AbsoluteContainingBlock will assert that this bit is set. 111 // NS_FRAME_HAS_ABSPOS_CHILDREN must not be set when this bit is unset. 112 FRAME_STATE_BIT(Generic, 9, NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) 113 114 // If this bit is set, then the frame and _all_ of its descendant frames need 115 // to be reflowed. 116 // This bit is set when the frame is first created. 117 // This bit is cleared by DidReflow after the required call to Reflow has 118 // finished. 119 // Do not set this bit yourself if you plan to pass the frame to 120 // PresShell::FrameNeedsReflow. Pass the right arguments instead. 121 FRAME_STATE_BIT(Generic, 10, NS_FRAME_IS_DIRTY) 122 123 // If this bit is set then the frame is too deep in the frame tree, and 124 // we'll stop updating it and its children, to prevent stack overflow 125 // and the like. 126 FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE) 127 128 // If this bit is set, then either: 129 // 1. the frame has at least one child that has the NS_FRAME_IS_DIRTY bit or 130 // NS_FRAME_HAS_DIRTY_CHILDREN bit set, or 131 // 2. the frame has had at least one child removed since the last reflow, or 132 // 3. the frame has had a style change that requires the frame to be reflowed 133 // but does not _necessarily_ require its descendants to be reflowed (e.g., 134 // for a 'height', 'width', 'margin', etc. change, it's up to the 135 // applicable Reflow methods to decide whether the frame's children 136 // _actually_ need to be reflowed). 137 // If this bit is set but the NS_FRAME_IS_DIRTY is not set, then Reflow still 138 // needs to be called on the frame, but Reflow will likely not do as much work 139 // as it would if NS_FRAME_IS_DIRTY were set. See the comment documenting 140 // nsIFrame::Reflow for more. 141 // This bit is cleared by DidReflow after the required call to Reflow has 142 // finished. 143 // Do not set this bit yourself if you plan to pass the frame to 144 // PresShell::FrameNeedsReflow. Pass the right arguments instead. 145 FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN) 146 147 // If this bit is set, the frame will not be rendered, because of it's 148 // 'position-visibility' values. 149 FRAME_STATE_BIT(Generic, 13, NS_FRAME_POSITION_VISIBILITY_HIDDEN) 150 151 // If this bit is set, the frame is part of the mangled frame hierarchy 152 // that results when an inline has been split because of a nested block. 153 // See the comments in nsCSSFrameConstructor::ConstructInline for 154 // more details. (this is only set on nsBlockFrame/nsInlineFrame frames) 155 FRAME_STATE_BIT(Generic, 15, NS_FRAME_PART_OF_IBSPLIT) 156 157 // If this bit is set, then transforms (e.g. CSS or SVG transforms) are allowed 158 // to affect the frame, and a transform may currently be in affect. If this bit 159 // is not set, then any transforms on the frame will be ignored. 160 // This is used primarily in GetTransformMatrix to optimize for the 161 // common case. 162 FRAME_STATE_BIT(Generic, 16, NS_FRAME_MAY_BE_TRANSFORMED) 163 164 // If this bit is set, the frame itself is a bidi continuation, 165 // or is incomplete (its next sibling is a bidi continuation) 166 FRAME_STATE_BIT(Generic, 17, NS_FRAME_IS_BIDI) 167 168 // Free bit here. 169 170 // If this bit is set, then reflow may be dispatched from the current 171 // frame instead of the root frame. 172 FRAME_STATE_BIT(Generic, 19, NS_FRAME_REFLOW_ROOT) 173 174 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific 175 // frame classes. 176 177 // This bit is set on out-of-flow frames (e.g. floats or absolutely positioned 178 // elements) whose parent does not contain their placeholder. This can happen 179 // for two reasons: (1) the frame was split, and this piece is the continuation, 180 // or (2) the entire frame didn't fit on the fragmentainer (e.g. page/column). 181 // Note that this bit is also shared by text frames for TEXT_IS_IN_TOKEN_MATHML. 182 // That's OK because we only check the NS_FRAME_IS_PUSHED_OUT_OF_FLOW bit on 183 // frames which we already know are out-of-flow. 184 FRAME_STATE_BIT(Generic, 32, NS_FRAME_IS_PUSHED_OUT_OF_FLOW) 185 186 // This bit acts as a loop flag for recursive paint server drawing. 187 FRAME_STATE_BIT(Generic, 33, NS_FRAME_DRAWING_AS_PAINTSERVER) 188 189 // Intrinsic ISize depending on the frame's BSize is rare but possible. 190 // This flag indicates that the frame has (or once had) a descendant in that 191 // situation (possibly the frame itself). 192 FRAME_STATE_BIT(Generic, 34, 193 NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE) 194 195 // Frame is a display root and the retained layer tree needs to be updated 196 // at the next paint via display list construction. 197 // Only meaningful for display roots, so we don't really need a global state 198 // bit; we could free up this bit with a little extra complexity. 199 FRAME_STATE_BIT(Generic, 36, NS_FRAME_UPDATE_LAYER_TREE) 200 201 // Frame can accept absolutely positioned children. 202 FRAME_STATE_BIT(Generic, 37, NS_FRAME_HAS_ABSPOS_CHILDREN) 203 204 // A display item for this frame has been painted as part of a PaintedLayer. 205 FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES) 206 207 // Frame is or is a descendant of something with a fixed block-size, unless 208 // that ancestor is a body or html element, and has no closer ancestor that is 209 // overflow:auto or overflow:scroll. 210 FRAME_STATE_BIT(Generic, 39, NS_FRAME_IN_CONSTRAINED_BSIZE) 211 212 // This is only set during painting 213 FRAME_STATE_BIT(Generic, 40, NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO) 214 215 // Is this frame a container for font size inflation, i.e., is it a 216 // frame whose width is used to determine the inflation factor for 217 // everything whose nearest ancestor container for this frame? 218 FRAME_STATE_BIT(Generic, 41, NS_FRAME_FONT_INFLATION_CONTAINER) 219 220 // Does this frame manage a region in which we do font size inflation, 221 // i.e., roughly, is it an element establishing a new block formatting 222 // context? 223 FRAME_STATE_BIT(Generic, 42, NS_FRAME_FONT_INFLATION_FLOW_ROOT) 224 225 // This bit is set on SVG frames that are laid out using SVG's coordinate 226 // system based layout (as opposed to any of the CSS layout models). Note that 227 // this does not include SVGOuterSVGFrame since it takes part in CSS layout. 228 FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT) 229 230 // This bit is set if a frame has a multi-column ancestor (i.e. 231 // ColumnSetWrapperFrame) within the same block formatting context. A top-level 232 // ColumnSetWrapperFrame doesn't have this bit set, whereas a 233 // ColumnSetWrapperFrame nested inside a column does have this bit set. 234 // 235 // All the children of the column-spanners or any other type of frames which 236 // create their own block formatting context do not have this bit set because 237 // they are not in the same block formatting context created by a multi-column 238 // ancestor. 239 FRAME_STATE_BIT(Generic, 44, NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR) 240 241 // If this bit is set, then reflow may be dispatched from the current 242 // frame instead of the root frame. 243 FRAME_STATE_BIT(Generic, 45, NS_FRAME_DYNAMIC_REFLOW_ROOT) 244 245 // This bit indicates that we're tracking visibility for this frame, and that 246 // the frame has a VisibilityStateProperty property. 247 FRAME_STATE_BIT(Generic, 46, NS_FRAME_VISIBILITY_IS_TRACKED) 248 249 // The frame is a descendant of SVGTextFrame and is thus used for SVG 250 // text layout. 251 FRAME_STATE_BIT(Generic, 47, NS_FRAME_IS_SVG_TEXT) 252 253 // Frame is marked as needing painting 254 FRAME_STATE_BIT(Generic, 48, NS_FRAME_NEEDS_PAINT) 255 256 // Frame has a descendant frame that needs painting - This includes 257 // cross-doc children. 258 FRAME_STATE_BIT(Generic, 49, NS_FRAME_DESCENDANT_NEEDS_PAINT) 259 260 // Frame is a descendant of a popup 261 FRAME_STATE_BIT(Generic, 50, NS_FRAME_IN_POPUP) 262 263 // Frame has only descendant frames that needs painting - This includes 264 // cross-doc children. This guarantees that all descendents have 265 // NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they 266 // have no display items. 267 FRAME_STATE_BIT(Generic, 51, NS_FRAME_ALL_DESCENDANTS_NEED_PAINT) 268 269 // Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit 270 // rect stored to invalidate. 271 FRAME_STATE_BIT(Generic, 52, NS_FRAME_HAS_INVALID_RECT) 272 273 // Frame is not displayed directly due to it being, or being under, an SVG 274 // <defs> element or an SVG resource element (<mask>, <pattern>, etc.) 275 FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY) 276 277 // Frame has a LayerActivityProperty property 278 FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY) 279 280 // Frame owns anonymous boxes whose ComputedStyles it will need to update 281 // during a stylo tree traversal. 282 FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES) 283 284 // Frame maybe has a counter-reset/increment style 285 FRAME_STATE_BIT(Generic, 56, NS_FRAME_HAS_CSS_COUNTER_STYLE) 286 287 // The display list of the frame can be handled by the shortcut for 288 // COMMON CASE. 289 FRAME_STATE_BIT(Generic, 57, NS_FRAME_SIMPLE_DISPLAYLIST) 290 291 // Set for all descendants of MathML sub/supscript elements (other than the 292 // base frame) to indicate that the SSTY font feature should be used. 293 FRAME_STATE_BIT(Generic, 58, NS_FRAME_MATHML_SCRIPT_DESCENDANT) 294 295 // This state bit is set on frames within token MathML elements if the 296 // token represents an <mi> tag whose inner HTML consists of a single 297 // non-whitespace character to allow special rendering behaviour. 298 FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI) 299 300 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific 301 // frame classes. 302 303 // NOTE: No more unused bits. If needed, investigate removing obsolete bits by 304 // adjusting logic, or moving infrequently-used bits elsewhere. If more space 305 // for frame state is still needed, look for bit field gaps in nsIFrame. 306 307 // == Frame state bits that apply to flex container frames ==================== 308 309 FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame) 310 311 // True iff the normal flow children are already in CSS 'order' in the 312 // order they occur in the child frame list. 313 FRAME_STATE_BIT(FlexContainer, 20, 314 NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER) 315 316 // Set for a flex container that is emulating a legacy 317 // 'display:-webkit-{inline-}box'. 318 FRAME_STATE_BIT(FlexContainer, 21, NS_STATE_FLEX_IS_EMULATING_LEGACY_WEBKIT_BOX) 319 320 // True if the container has no flex items; may lie if there is a pending reflow 321 FRAME_STATE_BIT(FlexContainer, 22, NS_STATE_FLEX_SYNTHESIZE_BASELINE) 322 323 // True iff some first-in-flow in-flow children were pushed. 324 // Note that those child frames may have been removed without this bit 325 // being updated for performance reasons, so code shouldn't depend on 326 // actually finding any pushed items when this bit is set. 327 FRAME_STATE_BIT(FlexContainer, 23, NS_STATE_FLEX_DID_PUSH_ITEMS) 328 329 // We've merged some OverflowList children since last reflow. 330 FRAME_STATE_BIT(FlexContainer, 24, NS_STATE_FLEX_HAS_CHILD_NIFS) 331 332 // True if the next reflow of this frame should generate computed info metrics. 333 // These are used by devtools to reveal details of the layout process. 334 FRAME_STATE_BIT(FlexContainer, 25, NS_STATE_FLEX_COMPUTED_INFO) 335 336 // == Frame state bits that apply to grid container frames ==================== 337 338 FRAME_STATE_GROUP(GridContainer, nsGridContainerFrame) 339 340 // True iff the normal flow children are already in CSS 'order' in the 341 // order they occur in the child frame list. 342 FRAME_STATE_BIT(GridContainer, 20, 343 NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER) 344 345 // True iff some first-in-flow in-flow children were pushed. 346 // Note that those child frames may have been removed without this bit 347 // being updated for performance reasons, so code shouldn't depend on 348 // actually finding any pushed items when this bit is set. 349 FRAME_STATE_BIT(GridContainer, 21, NS_STATE_GRID_DID_PUSH_ITEMS) 350 351 // True if the container has no grid items; may lie if there is a pending 352 // reflow. 353 FRAME_STATE_BIT(GridContainer, 22, NS_STATE_GRID_SYNTHESIZE_BASELINE) 354 355 // True if the container is a subgrid in its inline axis. 356 FRAME_STATE_BIT(GridContainer, 23, NS_STATE_GRID_IS_COL_SUBGRID) 357 358 // True if the container is a subgrid in its block axis. 359 FRAME_STATE_BIT(GridContainer, 24, NS_STATE_GRID_IS_ROW_SUBGRID) 360 361 // The container contains one or more items subgridded in its inline axis. 362 FRAME_STATE_BIT(GridContainer, 25, NS_STATE_GRID_HAS_COL_SUBGRID_ITEM) 363 364 // The container contains one or more items subgridded in its block axis. 365 FRAME_STATE_BIT(GridContainer, 26, NS_STATE_GRID_HAS_ROW_SUBGRID_ITEM) 366 367 // We've merged some OverflowList children since last reflow. 368 FRAME_STATE_BIT(GridContainer, 27, NS_STATE_GRID_HAS_CHILD_NIFS) 369 370 // True if the container has masonry layout in its inline axis. 371 // (mutually exclusive with NS_STATE_GRID_IS_ROW_MASONRY) 372 FRAME_STATE_BIT(GridContainer, 28, NS_STATE_GRID_IS_COL_MASONRY) 373 374 // True if the container has masonry layout in its block axis. 375 // (mutually exclusive with NS_STATE_GRID_IS_COL_MASONRY) 376 FRAME_STATE_BIT(GridContainer, 29, NS_STATE_GRID_IS_ROW_MASONRY) 377 378 // True if the next reflow of this frame should generate computed info metrics. 379 // These are used by devtools to reveal details of the layout process. 380 FRAME_STATE_BIT(GridContainer, 30, NS_STATE_GRID_COMPUTED_INFO) 381 382 // == Frame state bits that apply to SVG frames =============================== 383 384 FRAME_STATE_GROUP_NAME(SVG) 385 FRAME_STATE_GROUP_CLASS(SVG, ISVGDisplayableFrame) 386 FRAME_STATE_GROUP_CLASS(SVG, SVGContainerFrame) 387 388 // If this bit is set, we are a <clipPath> element or descendant. 389 FRAME_STATE_BIT(SVG, 20, NS_STATE_SVG_CLIPPATH_CHILD) 390 391 // For SVG text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits 392 // indicate that our anonymous block child needs to be reflowed, and that 393 // mPositions will likely need to be updated as a consequence. These are set, 394 // for example, when the font-family changes. Sometimes we only need to 395 // update mPositions though. For example if the x/y attributes change. 396 // mPositioningDirty is used to indicate this latter "things are dirty" case 397 // to allow us to avoid reflowing the anonymous block when it is not 398 // necessary. 399 FRAME_STATE_BIT(SVG, 21, NS_STATE_SVG_POSITIONING_DIRTY) 400 401 // For text, whether the values from x/y/dx/dy attributes have any percentage 402 // values that are used in determining the positions of glyphs. The value will 403 // be true even if a positioning value is overridden by a descendant element's 404 // attribute with a non-percentage length. For example, 405 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for: 406 // 407 // <text x="10%"><tspan x="0">abc</tspan></text> 408 // 409 // Percentage values beyond the number of addressable characters, however, do 410 // not influence NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES. For example, 411 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be false for: 412 // 413 // <text x="10 20 30 40%">abc</text> 414 // 415 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether 416 // to recompute mPositions when the viewport size changes. So although the 417 // first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES 418 // can be true even if a viewport size change will not affect mPositions, 419 // determining a completley accurate value for 420 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is 421 // probably not worth it. 422 FRAME_STATE_BIT(SVG, 22, NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES) 423 424 FRAME_STATE_BIT(SVG, 23, NS_STATE_SVG_TEXT_IN_REFLOW) 425 426 // Set on SVGTextFrame frames when they need a 427 // TextNodeCorrespondenceRecorder::RecordCorrespondence call 428 // to update the cached nsTextNode indexes that they correspond to. 429 FRAME_STATE_BIT(SVG, 24, NS_STATE_SVG_TEXT_CORRESPONDENCE_DIRTY) 430 431 // Set on svg frames when they or their descendants may contain non-scaling 432 // stroke contents. 433 FRAME_STATE_BIT(SVG, 25, NS_STATE_SVG_MAY_CONTAIN_NON_SCALING_STROKE) 434 435 // == Frame state bits that apply to text frames ============================== 436 437 FRAME_STATE_GROUP(Text, nsTextFrame) 438 439 // -- Flags set during reflow ------------------------------------------------- 440 441 // nsTextFrame.cpp defines TEXT_REFLOW_FLAGS to be all of these bits. 442 443 // This bit is set on the first frame in a continuation indicating 444 // that it was chopped short because of :first-letter style. 445 FRAME_STATE_BIT(Text, 20, TEXT_FIRST_LETTER) 446 447 // This bit is set on frames that are logically adjacent to the start of the 448 // line (i.e. no prior frame on line with actual displayed in-flow content). 449 FRAME_STATE_BIT(Text, 21, TEXT_START_OF_LINE) 450 451 // This bit is set on frames that are logically adjacent to the end of the 452 // line (i.e. no following on line with actual displayed in-flow content). 453 FRAME_STATE_BIT(Text, 22, TEXT_END_OF_LINE) 454 455 // This bit is set on frames that end with a hyphenated break. 456 FRAME_STATE_BIT(Text, 23, TEXT_HYPHEN_BREAK) 457 458 // This bit is set on frames that trimmed trailing whitespace characters when 459 // calculating their width during reflow. 460 FRAME_STATE_BIT(Text, 24, TEXT_TRIMMED_TRAILING_WHITESPACE) 461 462 // This bit is set on frames that have justification enabled. We record 463 // this in a state bit because we don't always have the containing block 464 // easily available to check text-align on. 465 FRAME_STATE_BIT(Text, 25, TEXT_JUSTIFICATION_ENABLED) 466 467 // Set this bit if the textframe has overflow area for IME/spellcheck underline. 468 FRAME_STATE_BIT(Text, 26, TEXT_SELECTION_UNDERLINE_OVERFLOWED) 469 470 // -- Cache bits for IsEmpty() ------------------------------------------------ 471 472 // nsTextFrame.cpp defines TEXT_WHITESPACE_FLAGS to be both of these bits. 473 474 // Set this bit if the textframe is known to be only collapsible whitespace. 475 FRAME_STATE_BIT(Text, 27, TEXT_IS_ONLY_WHITESPACE) 476 477 // Set this bit if the textframe is known to be not only collapsible whitespace. 478 FRAME_STATE_BIT(Text, 28, TEXT_ISNOT_ONLY_WHITESPACE) 479 480 // -- Other state bits -------------------------------------------------------- 481 482 // Set when this text frame is mentioned in the userdata for mTextRun 483 FRAME_STATE_BIT(Text, 29, TEXT_IN_TEXTRUN_USER_DATA) 484 485 // This state bit is set on frames whose character data offsets need to be 486 // fixed up 487 FRAME_STATE_BIT(Text, 30, TEXT_OFFSETS_NEED_FIXING) 488 489 // This state bit is set on frames that have some non-collapsed characters after 490 // reflow 491 FRAME_STATE_BIT(Text, 31, TEXT_HAS_NONCOLLAPSED_CHARACTERS) 492 493 // This state bit is set on children of token MathML elements. 494 // NOTE: TEXT_IS_IN_TOKEN_MATHML has a global state bit value that is shared 495 // with NS_FRAME_IS_PUSHED_OUT_OF_FLOW. 496 FRAME_STATE_BIT(Text, 32, TEXT_IS_IN_TOKEN_MATHML) 497 498 // Set when this text frame is mentioned in the userdata for the 499 // uninflated textrun property 500 FRAME_STATE_BIT(Text, 60, TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA) 501 502 FRAME_STATE_BIT(Text, 61, TEXT_HAS_FONT_INFLATION) 503 504 // Set when this text frame contains nothing that will actually render 505 FRAME_STATE_BIT(Text, 62, TEXT_NO_RENDERED_GLYPHS) 506 507 // Whether this frame is cached in the Offset Frame Cache 508 // (OffsetToFrameProperty) 509 FRAME_STATE_BIT(Text, 63, TEXT_IN_OFFSET_CACHE) 510 511 // == Frame state bits that apply to block frames ============================= 512 513 FRAME_STATE_GROUP(Block, nsBlockFrame) 514 515 // NS_BLOCK_HAS_FLOATS indicates that the block has a float list. 516 FRAME_STATE_BIT(Block, 20, NS_BLOCK_HAS_FLOATS) 517 518 // NS_BLOCK_HAS_PUSHED_FLOATS indicates that the block has a pushed float list. 519 FRAME_STATE_BIT(Block, 21, NS_BLOCK_HAS_PUSHED_FLOATS) 520 521 // This indicates that the frame establishes a block formatting context i.e. 522 // 523 // 1. 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(). 528 // This causes the BlockReflowState's constructor to set the 529 // mIsBStartMarginRoot and mIsBEndMarginRoot flags. 530 // 531 // 2. This indicates that a block frame should create its own float manager. 532 // This is required by each block frame that can contain floats. The float 533 // manager is used to reserve space for the floated frames. 534 FRAME_STATE_BIT(Block, 22, NS_BLOCK_BFC) 535 536 FRAME_STATE_BIT(Block, 23, NS_BLOCK_HAS_LINE_CURSOR) 537 538 FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_OVERFLOW_LINES) 539 540 FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS) 541 542 // Set on any block that has descendant frames in the normal 543 // flow with 'clear' set to something other than 'none' 544 // (including <BR CLEAR="..."> frames) 545 FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_CLEAR_CHILDREN) 546 547 // NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style, 548 // even if it has no actual first-letter frame among its descendants. 549 FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_FIRST_LETTER_STYLE) 550 551 // NS_BLOCK_HAS_MARKER means the block has an associated ::marker frame, inside 552 // or outside depending on list-style-position. 553 FRAME_STATE_BIT(Block, 28, NS_BLOCK_HAS_MARKER) 554 555 // Something in the block has changed that requires Bidi resolution to be 556 // performed on the block. This flag must be either set on all blocks in a 557 // continuation chain or none of them. 558 FRAME_STATE_BIT(Block, 29, NS_BLOCK_NEEDS_BIDI_RESOLUTION) 559 560 // See nsBlockFrame.h for docs 561 FRAME_STATE_BIT(Block, 30, NS_BLOCK_HAS_LINE_CLAMP_ELLIPSIS) 562 FRAME_STATE_BIT(Block, 31, NS_BLOCK_HAS_LINE_CLAMP_ELLIPSIS_DESCENDANT) 563 564 // This block has had a child marked dirty, so before we reflow we need 565 // to look through the lines to find any such children and mark 566 // appropriate lines dirty. 567 FRAME_STATE_BIT(Block, 60, NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) 568 569 // Are our cached intrinsic inline sizes for font size inflation? i.e., what was 570 // the current state of GetPresContext()->mInflationDisabledForShrinkWrap at the 571 // time they were computed? 572 // 573 // nsBlockFrame is the only thing that caches intrinsic inline sizes that needs 574 // to track this because it's the only thing that caches intrinsic inline sizes 575 // that lives inside of things (form controls) that do intrinsic sizing with 576 // font inflation enabled. 577 FRAME_STATE_BIT(Block, 61, NS_BLOCK_INTRINSICS_INFLATED) 578 579 // NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter 580 // frame among the block's descendants. If there is a floating first-letter 581 // frame, or the block has first-letter style but has no first letter, this 582 // bit is not set. This bit is set on the first continuation only. 583 FRAME_STATE_BIT(Block, 62, NS_BLOCK_HAS_FIRST_LETTER_CHILD) 584 585 // == Frame state bits that apply to image frames ============================= 586 587 FRAME_STATE_GROUP(Image, nsImageFrame) 588 589 FRAME_STATE_BIT(Image, 20, IMAGE_SIZECONSTRAINED) 590 591 // == Frame state bits that apply to inline frames ============================ 592 593 FRAME_STATE_GROUP(Inline, nsInlineFrame) 594 595 /** In Bidi inline start (or end) margin/padding/border should be applied to 596 * first (or last) frame (or a continuation frame). 597 * This state value shows if this frame is first (or last) continuation 598 * or not. 599 */ 600 601 FRAME_STATE_BIT(Inline, 21, NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) 602 FRAME_STATE_BIT(Inline, 22, NS_INLINE_FRAME_BIDI_VISUAL_IS_FIRST) 603 FRAME_STATE_BIT(Inline, 23, NS_INLINE_FRAME_BIDI_VISUAL_IS_LAST) 604 // nsRubyTextFrame inherits from nsInlineFrame 605 606 // == Frame state bits that apply to ruby text frames ========================= 607 608 FRAME_STATE_GROUP(RubyText, nsRubyTextFrame) 609 610 // inherits from nsInlineFrame 611 FRAME_STATE_BIT(RubyText, 24, NS_RUBY_TEXT_FRAME_COLLAPSED) 612 613 // == Frame state bits that apply to ruby text container frames =============== 614 615 FRAME_STATE_GROUP(RubyTextContainer, nsRubyTextContainerFrame) 616 617 FRAME_STATE_BIT(RubyTextContainer, 20, NS_RUBY_TEXT_CONTAINER_IS_SPAN) 618 619 // == Frame state bits that apply to placeholder frames ======================= 620 621 FRAME_STATE_GROUP(Placeholder, nsPlaceholderFrame) 622 623 // Frame state bits that are used to keep track of what this is a 624 // placeholder for. 625 626 FRAME_STATE_BIT(Placeholder, 20, PLACEHOLDER_FOR_FLOAT) 627 FRAME_STATE_BIT(Placeholder, 21, PLACEHOLDER_FOR_ABSPOS) 628 FRAME_STATE_BIT(Placeholder, 22, PLACEHOLDER_FOR_FIXEDPOS) 629 FRAME_STATE_BIT(Placeholder, 24, PLACEHOLDER_FOR_TOPLAYER) 630 631 // This bit indicates that the out-of-flow frame's static position needs to be 632 // determined using the CSS Box Alignment properties 633 // ([align,justify]-[self,content]). When this is set, the placeholder frame's 634 // position doesn't represent the static position, as it usually would -- 635 // rather, it represents the logical start corner of the alignment containing 636 // block. Then, after we've determined the out-of-flow frame's size, we can 637 // resolve the actual static position using the alignment properties. 638 FRAME_STATE_BIT(Placeholder, 25, PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN) 639 640 // Are all earlier frames on the same block line empty? 641 FRAME_STATE_BIT(Placeholder, 26, PLACEHOLDER_LINE_IS_EMPTY_SO_FAR) 642 // Does the above bit have a valid value? 643 FRAME_STATE_BIT(Placeholder, 27, PLACEHOLDER_HAVE_LINE_IS_EMPTY_SO_FAR) 644 645 // == Frame state bits that apply to table cell frames ======================== 646 647 FRAME_STATE_GROUP(TableCell, nsTableCellFrame) 648 649 FRAME_STATE_BIT(TableCell, 20, NS_TABLE_CELL_HAD_SPECIAL_REFLOW) 650 FRAME_STATE_BIT(TableCell, 21, NS_TABLE_CELL_CONTENT_EMPTY) 651 652 // == Frame state bits that apply to table column frames ====================== 653 654 // Bits 28-31 on nsTableColFrames are used to store the column type. 655 656 // == Frame state bits that apply to table column group frames ================ 657 658 // Bits 30-31 on nsTableColGroupFrames are used to store the column type. 659 660 // == Frame state bits that apply to table rows and table row group frames ==== 661 662 FRAME_STATE_GROUP_NAME(TableRowAndRowGroup) 663 FRAME_STATE_GROUP_CLASS(TableRowAndRowGroup, nsTableRowFrame) 664 FRAME_STATE_GROUP_CLASS(TableRowAndRowGroup, nsTableRowGroupFrame) 665 666 // see nsTableRowGroupFrame::InitRepeatedFrame 667 FRAME_STATE_BIT(TableRowAndRowGroup, 28, NS_REPEATED_ROW_OR_ROWGROUP) 668 669 // == Frame state bits that apply to table row frames ========================= 670 671 FRAME_STATE_GROUP(TableRow, nsTableRowFrame) 672 673 // Indicates whether this row has any cells that have 674 // non-auto-bsize and rowspan=1 675 FRAME_STATE_BIT(TableRow, 29, NS_ROW_HAS_CELL_WITH_STYLE_BSIZE) 676 677 FRAME_STATE_BIT(TableRow, 30, NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE) 678 679 // == Frame state bits that apply to table row group frames =================== 680 681 FRAME_STATE_GROUP(TableRowGroup, nsTableRowGroupFrame) 682 683 FRAME_STATE_BIT(TableRowGroup, 27, NS_ROWGROUP_HAS_ROW_CURSOR) 684 FRAME_STATE_BIT(TableRowGroup, 30, NS_ROWGROUP_HAS_STYLE_BSIZE) 685 686 // thead or tfoot should be repeated on every printed page 687 FRAME_STATE_BIT(TableRowGroup, 31, NS_ROWGROUP_REPEATABLE) 688 689 FRAME_STATE_GROUP(Table, nsTableFrame) 690 691 FRAME_STATE_BIT(Table, 28, NS_TABLE_PART_HAS_FIXED_BACKGROUND) 692 693 // == Frame state bits that apply to page frames ============================== 694 FRAME_STATE_GROUP(Page, nsPageFrame) 695 696 // If set, this bit indicates that the given nsPageFrame has been skipped 697 // via the user's custom-page-range choice, and should not be rendered. 698 FRAME_STATE_BIT(Page, 20, NS_PAGE_SKIPPED_BY_CUSTOM_RANGE) 699 700 #undef FRAME_STATE_GROUP 701 702 #ifdef DEFINED_FRAME_STATE_GROUP_NAME 703 #undef DEFINED_FRAME_STATE_GROUP_NAME 704 #undef FRAME_STATE_GROUP_NAME 705 #endif 706 707 #ifdef DEFINED_FRAME_STATE_GROUP_CLASS 708 #undef DEFINED_FRAME_STATE_GROUP_CLASS 709 #undef FRAME_STATE_GROUP_CLASS 710 #endif 711 712 #ifdef DEFINED_FRAME_STATE_BIT 713 #undef DEFINED_FRAME_STATE_BIT 714 #undef FRAME_STATE_BIT 715 #endif