layout/generic/nsFrameStateBits.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* a list of all frame state bits, for preprocessing */
michael@0 7
michael@0 8 /******
michael@0 9
michael@0 10 This file contains definitions for frame state bits -- values used
michael@0 11 in nsIFrame::mState -- and groups of frame state bits and which
michael@0 12 classes they apply to.
michael@0 13
michael@0 14 There are two macros that can be defined before #including this
michael@0 15 file:
michael@0 16
michael@0 17 FRAME_STATE_GROUP(name_, class_)
michael@0 18
michael@0 19 This denotes the existence of a named group of frame state bits.
michael@0 20 name_ is the name of the group and class_ is the name of a frame
michael@0 21 class that uses the frame state bits that are a part of the group.
michael@0 22
michael@0 23 The main group of frame state bits is named "Generic" and is
michael@0 24 defined to apply to nsIFrame, i.e. all frames. All of the global
michael@0 25 frame state bits -- bits 0..19 and 32..59 -- are in this group.
michael@0 26
michael@0 27 FRAME_STATE_BIT(group_, value_, name_)
michael@0 28
michael@0 29 This denotes the existence of a frame state bit. group_ indicates
michael@0 30 which group the bit belongs to, value_ is the bit number (0..63),
michael@0 31 and name_ is the name of the frame state bit constant.
michael@0 32
michael@0 33 Note that if you add a new frame state group, you'll need to #include
michael@0 34 the header for its frame classes in nsFrameState.cpp and, if they don't
michael@0 35 already, add nsQueryFrame implementations (which can be DEBUG-only) to
michael@0 36 the frame classes.
michael@0 37
michael@0 38 ******/
michael@0 39
michael@0 40 #ifndef FRAME_STATE_GROUP
michael@0 41 #define FRAME_STATE_GROUP(name_, class_) /* nothing */
michael@0 42 #define DEFINED_FRAME_STATE_GROUP
michael@0 43 #endif
michael@0 44
michael@0 45 #ifndef FRAME_STATE_BIT
michael@0 46 #define FRAME_STATE_BIT(group_, value_, name_) /* nothing */
michael@0 47 #define DEFINED_FRAME_STATE_BIT
michael@0 48 #endif
michael@0 49
michael@0 50 // == Frame state bits that apply to all frames ===============================
michael@0 51
michael@0 52 FRAME_STATE_GROUP(Generic, nsIFrame)
michael@0 53
michael@0 54 FRAME_STATE_BIT(Generic, 0, NS_FRAME_IN_REFLOW)
michael@0 55
michael@0 56 // This bit is set when a frame is created. After it has been reflowed
michael@0 57 // once (during the DidReflow with a finished state) the bit is
michael@0 58 // cleared.
michael@0 59 FRAME_STATE_BIT(Generic, 1, NS_FRAME_FIRST_REFLOW)
michael@0 60
michael@0 61 // For a continuation frame, if this bit is set, then this a "fluid"
michael@0 62 // continuation, i.e., across a line boundary. Otherwise it's a "hard"
michael@0 63 // continuation, e.g. a bidi continuation.
michael@0 64 FRAME_STATE_BIT(Generic, 2, NS_FRAME_IS_FLUID_CONTINUATION)
michael@0 65
michael@0 66 // For nsIAnonymousContentCreator content that's created using ContentInfo.
michael@0 67 FRAME_STATE_BIT(Generic, 3, NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT)
michael@0 68
michael@0 69 // If this bit is set, then a reference to the frame is being held
michael@0 70 // elsewhere. The frame may want to send a notification when it is
michael@0 71 // destroyed to allow these references to be cleared.
michael@0 72 FRAME_STATE_BIT(Generic, 4, NS_FRAME_EXTERNAL_REFERENCE)
michael@0 73
michael@0 74 // If this bit is set, this frame or one of its descendants has a
michael@0 75 // percentage height that depends on an ancestor of this frame.
michael@0 76 // (Or it did at one point in the past, since we don't necessarily clear
michael@0 77 // the bit when it's no longer needed; it's an optimization.)
michael@0 78 FRAME_STATE_BIT(Generic, 5, NS_FRAME_CONTAINS_RELATIVE_HEIGHT)
michael@0 79
michael@0 80 // If this bit is set, then the frame corresponds to generated content
michael@0 81 FRAME_STATE_BIT(Generic, 6, NS_FRAME_GENERATED_CONTENT)
michael@0 82
michael@0 83 // If this bit is set the frame is a continuation that is holding overflow,
michael@0 84 // i.e. it is a next-in-flow created to hold overflow after the box's
michael@0 85 // height has ended. This means the frame should be a) at the top of the
michael@0 86 // page and b) invisible: no borders, zero height, ignored in margin
michael@0 87 // collapsing, etc. See nsContainerFrame.h
michael@0 88 FRAME_STATE_BIT(Generic, 7, NS_FRAME_IS_OVERFLOW_CONTAINER)
michael@0 89
michael@0 90 // If this bit is set, then the frame has been moved out of the flow,
michael@0 91 // e.g., it is absolutely positioned or floated
michael@0 92 FRAME_STATE_BIT(Generic, 8, NS_FRAME_OUT_OF_FLOW)
michael@0 93
michael@0 94 // Frame can be an abs/fixed pos. container, if its style says so.
michael@0 95 // MarkAs[Not]AbsoluteContainingBlock will assert that this bit is set.
michael@0 96 // NS_FRAME_HAS_ABSPOS_CHILDREN must not be set when this bit is unset.
michael@0 97 FRAME_STATE_BIT(Generic, 9, NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)
michael@0 98
michael@0 99 // If this bit is set, then the frame and _all_ of its descendant frames need
michael@0 100 // to be reflowed.
michael@0 101 // This bit is set when the frame is first created.
michael@0 102 // This bit is cleared by DidReflow after the required call to Reflow has
michael@0 103 // finished.
michael@0 104 // Do not set this bit yourself if you plan to pass the frame to
michael@0 105 // nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
michael@0 106 FRAME_STATE_BIT(Generic, 10, NS_FRAME_IS_DIRTY)
michael@0 107
michael@0 108 // If this bit is set then the frame is too deep in the frame tree, and
michael@0 109 // we'll stop updating it and its children, to prevent stack overflow
michael@0 110 // and the like.
michael@0 111 FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
michael@0 112
michael@0 113 // If this bit is set, then either:
michael@0 114 // 1. the frame has at least one child that has the NS_FRAME_IS_DIRTY bit or
michael@0 115 // NS_FRAME_HAS_DIRTY_CHILDREN bit set, or
michael@0 116 // 2. the frame has had at least one child removed since the last reflow, or
michael@0 117 // 3. the frame has had a style change that requires the frame to be reflowed
michael@0 118 // but does not _necessarily_ require its descendants to be reflowed (e.g.,
michael@0 119 // for a 'height', 'width', 'margin', etc. change, it's up to the
michael@0 120 // applicable Reflow methods to decide whether the frame's children
michael@0 121 // _actually_ need to be reflowed).
michael@0 122 // If this bit is set but the NS_FRAME_IS_DIRTY is not set, then Reflow still
michael@0 123 // needs to be called on the frame, but Reflow will likely not do as much work
michael@0 124 // as it would if NS_FRAME_IS_DIRTY were set. See the comment documenting
michael@0 125 // nsFrame::Reflow for more.
michael@0 126 // This bit is cleared by DidReflow after the required call to Reflow has
michael@0 127 // finished.
michael@0 128 // Do not set this bit yourself if you plan to pass the frame to
michael@0 129 // nsIPresShell::FrameNeedsReflow. Pass the right arguments instead.
michael@0 130 FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN)
michael@0 131
michael@0 132 // If this bit is set, the frame has an associated view
michael@0 133 FRAME_STATE_BIT(Generic, 13, NS_FRAME_HAS_VIEW)
michael@0 134
michael@0 135 // If this bit is set, the frame was created from anonymous content.
michael@0 136 FRAME_STATE_BIT(Generic, 14, NS_FRAME_INDEPENDENT_SELECTION)
michael@0 137
michael@0 138 // If this bit is set, the frame is part of the mangled frame hierarchy
michael@0 139 // that results when an inline has been split because of a nested block.
michael@0 140 // See the comments in nsCSSFrameConstructor::ConstructInline for
michael@0 141 // more details.
michael@0 142 FRAME_STATE_BIT(Generic, 15, NS_FRAME_PART_OF_IBSPLIT)
michael@0 143
michael@0 144 // If this bit is set, then transforms (e.g. CSS or SVG transforms) are allowed
michael@0 145 // to affect the frame, and a transform may currently be in affect. If this bit
michael@0 146 // is not set, then any transforms on the frame will be ignored.
michael@0 147 // This is used primarily in GetTransformMatrix to optimize for the
michael@0 148 // common case.
michael@0 149 FRAME_STATE_BIT(Generic, 16, NS_FRAME_MAY_BE_TRANSFORMED)
michael@0 150
michael@0 151 // If this bit is set, the frame itself is a bidi continuation,
michael@0 152 // or is incomplete (its next sibling is a bidi continuation)
michael@0 153 FRAME_STATE_BIT(Generic, 17, NS_FRAME_IS_BIDI)
michael@0 154
michael@0 155 // If this bit is set the frame has descendant with a view
michael@0 156 FRAME_STATE_BIT(Generic, 18, NS_FRAME_HAS_CHILD_WITH_VIEW)
michael@0 157
michael@0 158 // If this bit is set, then reflow may be dispatched from the current
michael@0 159 // frame instead of the root frame.
michael@0 160 FRAME_STATE_BIT(Generic, 19, NS_FRAME_REFLOW_ROOT)
michael@0 161
michael@0 162 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
michael@0 163 // frame classes.
michael@0 164
michael@0 165 // This bit is set on floats whose parent does not contain their
michael@0 166 // placeholder. This can happen for two reasons: (1) the float was
michael@0 167 // split, and this piece is the continuation, or (2) the entire float
michael@0 168 // didn't fit on the page.
michael@0 169 // Note that this bit is also shared by text frames for
michael@0 170 // TEXT_IS_IN_TOKEN_MATHML. That's OK because we only check the
michael@0 171 // NS_FRAME_IS_PUSHED_FLOAT bit on frames which we already know are
michael@0 172 // out-of-flow.
michael@0 173 FRAME_STATE_BIT(Generic, 32, NS_FRAME_IS_PUSHED_FLOAT)
michael@0 174
michael@0 175 // This bit acts as a loop flag for recursive paint server drawing.
michael@0 176 FRAME_STATE_BIT(Generic, 33, NS_FRAME_DRAWING_AS_PAINTSERVER)
michael@0 177
michael@0 178 // Frame is a display root and the retained layer tree needs to be updated
michael@0 179 // at the next paint via display list construction.
michael@0 180 // Only meaningful for display roots, so we don't really need a global state
michael@0 181 // bit; we could free up this bit with a little extra complexity.
michael@0 182 FRAME_STATE_BIT(Generic, 36, NS_FRAME_UPDATE_LAYER_TREE)
michael@0 183
michael@0 184 // Frame can accept absolutely positioned children.
michael@0 185 FRAME_STATE_BIT(Generic, 37, NS_FRAME_HAS_ABSPOS_CHILDREN)
michael@0 186
michael@0 187 // A display item for this frame has been painted as part of a ThebesLayer.
michael@0 188 FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES)
michael@0 189
michael@0 190 // Frame is or is a descendant of something with a fixed height, unless that
michael@0 191 // ancestor is a body or html element, and has no closer ancestor that is
michael@0 192 // overflow:auto or overflow:scroll.
michael@0 193 FRAME_STATE_BIT(Generic, 39, NS_FRAME_IN_CONSTRAINED_HEIGHT)
michael@0 194
michael@0 195 // This is only set during painting
michael@0 196 FRAME_STATE_BIT(Generic, 40, NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)
michael@0 197
michael@0 198 // Is this frame a container for font size inflation, i.e., is it a
michael@0 199 // frame whose width is used to determine the inflation factor for
michael@0 200 // everything whose nearest ancestor container for this frame?
michael@0 201 FRAME_STATE_BIT(Generic, 41, NS_FRAME_FONT_INFLATION_CONTAINER)
michael@0 202
michael@0 203 // Does this frame manage a region in which we do font size inflation,
michael@0 204 // i.e., roughly, is it an element establishing a new block formatting
michael@0 205 // context?
michael@0 206 FRAME_STATE_BIT(Generic, 42, NS_FRAME_FONT_INFLATION_FLOW_ROOT)
michael@0 207
michael@0 208 // This bit is set on SVG frames that are laid out using SVG's coordinate
michael@0 209 // system based layout (as opposed to any of the CSS layout models). Note that
michael@0 210 // this does not include nsSVGOuterSVGFrame since it takes part is CSS layout.
michael@0 211 FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT)
michael@0 212
michael@0 213 // Is this frame allowed to have generated (::before/::after) content?
michael@0 214 FRAME_STATE_BIT(Generic, 44, NS_FRAME_MAY_HAVE_GENERATED_CONTENT)
michael@0 215
michael@0 216 // This bit is set on frames that create ContainerLayers with component
michael@0 217 // alpha children. With BasicLayers we avoid creating these, so we mark
michael@0 218 // the frames for future reference.
michael@0 219 FRAME_STATE_BIT(Generic, 45, NS_FRAME_NO_COMPONENT_ALPHA)
michael@0 220
michael@0 221 // The frame is a descendant of SVGTextFrame and is thus used for SVG
michael@0 222 // text layout.
michael@0 223 FRAME_STATE_BIT(Generic, 47, NS_FRAME_IS_SVG_TEXT)
michael@0 224
michael@0 225 // Frame is marked as needing painting
michael@0 226 FRAME_STATE_BIT(Generic, 48, NS_FRAME_NEEDS_PAINT)
michael@0 227
michael@0 228 // Frame has a descendant frame that needs painting - This includes
michael@0 229 // cross-doc children.
michael@0 230 FRAME_STATE_BIT(Generic, 49, NS_FRAME_DESCENDANT_NEEDS_PAINT)
michael@0 231
michael@0 232 // Frame is a descendant of a popup
michael@0 233 FRAME_STATE_BIT(Generic, 50, NS_FRAME_IN_POPUP)
michael@0 234
michael@0 235 // Frame has only descendant frames that needs painting - This includes
michael@0 236 // cross-doc children. This guarantees that all descendents have
michael@0 237 // NS_FRAME_NEEDS_PAINT and NS_FRAME_ALL_DESCENDANTS_NEED_PAINT, or they
michael@0 238 // have no display items.
michael@0 239 FRAME_STATE_BIT(Generic, 51, NS_FRAME_ALL_DESCENDANTS_NEED_PAINT)
michael@0 240
michael@0 241 // Frame is marked as NS_FRAME_NEEDS_PAINT and also has an explicit
michael@0 242 // rect stored to invalidate.
michael@0 243 FRAME_STATE_BIT(Generic, 52, NS_FRAME_HAS_INVALID_RECT)
michael@0 244
michael@0 245 // Frame is not displayed directly due to it being, or being under, an SVG
michael@0 246 // <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
michael@0 247 FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY)
michael@0 248
michael@0 249 // Frame has a LayerActivityProperty property
michael@0 250 FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY)
michael@0 251
michael@0 252 // Set for all descendants of MathML sub/supscript elements (other than the
michael@0 253 // base frame) to indicate that the SSTY font feature should be used.
michael@0 254 FRAME_STATE_BIT(Generic, 58, NS_FRAME_MATHML_SCRIPT_DESCENDANT)
michael@0 255
michael@0 256 // This state bit is set on frames within token MathML elements if the
michael@0 257 // token represents an <mi> tag whose inner HTML consists of a single
michael@0 258 // non-whitespace character to allow special rendering behaviour.
michael@0 259 FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI)
michael@0 260
michael@0 261 // NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
michael@0 262 // frame classes.
michael@0 263
michael@0 264
michael@0 265 // == Frame state bits that apply to box frames ===============================
michael@0 266
michael@0 267 FRAME_STATE_GROUP(Box, nsBoxFrame)
michael@0 268
michael@0 269 FRAME_STATE_BIT(Box, 20, NS_STATE_BOX_CHILD_RESERVED)
michael@0 270 FRAME_STATE_BIT(Box, 21, NS_STATE_STACK_NOT_POSITIONED)
michael@0 271 FRAME_STATE_BIT(Box, 22, NS_STATE_IS_HORIZONTAL)
michael@0 272 FRAME_STATE_BIT(Box, 23, NS_STATE_AUTO_STRETCH)
michael@0 273 FRAME_STATE_BIT(Box, 24, NS_STATE_IS_ROOT)
michael@0 274 FRAME_STATE_BIT(Box, 25, NS_STATE_CURRENTLY_IN_DEBUG)
michael@0 275 FRAME_STATE_BIT(Box, 26, NS_STATE_SET_TO_DEBUG)
michael@0 276 FRAME_STATE_BIT(Box, 27, NS_STATE_DEBUG_WAS_SET)
michael@0 277 FRAME_STATE_BIT(Box, 28, NS_STATE_MENU_HAS_POPUP_LIST)
michael@0 278 FRAME_STATE_BIT(Box, 29, NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK)
michael@0 279 FRAME_STATE_BIT(Box, 30, NS_STATE_EQUAL_SIZE)
michael@0 280 FRAME_STATE_BIT(Box, 31, NS_STATE_IS_DIRECTION_NORMAL)
michael@0 281 FRAME_STATE_BIT(Box, 60, NS_FRAME_MOUSE_THROUGH_ALWAYS)
michael@0 282 FRAME_STATE_BIT(Box, 61, NS_FRAME_MOUSE_THROUGH_NEVER)
michael@0 283
michael@0 284
michael@0 285 // == Frame state bits that apply to flex container frames ====================
michael@0 286
michael@0 287 FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
michael@0 288
michael@0 289 // Set for a flex container whose children have been reordered due to 'order'.
michael@0 290 // (Means that we have to be more thorough about checking them for sortedness.)
michael@0 291 FRAME_STATE_BIT(FlexContainer, 20, NS_STATE_FLEX_CHILDREN_REORDERED)
michael@0 292
michael@0 293 // == Frame state bits that apply to SVG frames ===============================
michael@0 294
michael@0 295 FRAME_STATE_GROUP(SVG, nsISVGChildFrame)
michael@0 296 FRAME_STATE_GROUP(SVG, nsSVGContainerFrame)
michael@0 297
michael@0 298 FRAME_STATE_BIT(SVG, 20, NS_STATE_IS_OUTER_SVG)
michael@0 299
michael@0 300 // If this bit is set, we are a <clipPath> element or descendant.
michael@0 301 FRAME_STATE_BIT(SVG, 21, NS_STATE_SVG_CLIPPATH_CHILD)
michael@0 302
michael@0 303 // For SVG text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits
michael@0 304 // indicate that our anonymous block child needs to be reflowed, and that
michael@0 305 // mPositions will likely need to be updated as a consequence. These are set,
michael@0 306 // for example, when the font-family changes. Sometimes we only need to
michael@0 307 // update mPositions though. For example if the x/y attributes change.
michael@0 308 // mPositioningDirty is used to indicate this latter "things are dirty" case
michael@0 309 // to allow us to avoid reflowing the anonymous block when it is not
michael@0 310 // necessary.
michael@0 311 FRAME_STATE_BIT(SVG, 22, NS_STATE_SVG_POSITIONING_DIRTY)
michael@0 312
michael@0 313 // For text, whether the values from x/y/dx/dy attributes have any percentage
michael@0 314 // values that are used in determining the positions of glyphs. The value will
michael@0 315 // be true even if a positioning value is overridden by a descendant element's
michael@0 316 // attribute with a non-percentage length. For example,
michael@0 317 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be set for:
michael@0 318 //
michael@0 319 // <text x="10%"><tspan x="0">abc</tspan></text>
michael@0 320 //
michael@0 321 // Percentage values beyond the number of addressable characters, however, do
michael@0 322 // not influence NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES. For example,
michael@0 323 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would be false for:
michael@0 324 //
michael@0 325 // <text x="10 20 30 40%">abc</text>
michael@0 326 //
michael@0 327 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES is used to determine whether
michael@0 328 // to recompute mPositions when the viewport size changes. So although the
michael@0 329 // first example above shows that NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES
michael@0 330 // can be true even if a viewport size change will not affect mPositions,
michael@0 331 // determining a completley accurate value for
michael@0 332 // NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
michael@0 333 // probably not worth it.
michael@0 334 FRAME_STATE_BIT(SVG, 23, NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES)
michael@0 335
michael@0 336 FRAME_STATE_BIT(SVG, 24, NS_STATE_SVG_TEXT_IN_REFLOW)
michael@0 337
michael@0 338
michael@0 339 // == Frame state bits that apply to text frames ==============================
michael@0 340
michael@0 341 FRAME_STATE_GROUP(Text, nsTextFrame)
michael@0 342
michael@0 343 // -- Flags set during reflow -------------------------------------------------
michael@0 344
michael@0 345 // nsTextFrame.cpp defines TEXT_REFLOW_FLAGS to be all of these bits.
michael@0 346
michael@0 347 // This bit is set on the first frame in a continuation indicating
michael@0 348 // that it was chopped short because of :first-letter style.
michael@0 349 FRAME_STATE_BIT(Text, 20, TEXT_FIRST_LETTER)
michael@0 350
michael@0 351 // This bit is set on frames that are logically adjacent to the start of the
michael@0 352 // line (i.e. no prior frame on line with actual displayed in-flow content).
michael@0 353 FRAME_STATE_BIT(Text, 21, TEXT_START_OF_LINE)
michael@0 354
michael@0 355 // This bit is set on frames that are logically adjacent to the end of the
michael@0 356 // line (i.e. no following on line with actual displayed in-flow content).
michael@0 357 FRAME_STATE_BIT(Text, 22, TEXT_END_OF_LINE)
michael@0 358
michael@0 359 // This bit is set on frames that end with a hyphenated break.
michael@0 360 FRAME_STATE_BIT(Text, 23, TEXT_HYPHEN_BREAK)
michael@0 361
michael@0 362 // This bit is set on frames that trimmed trailing whitespace characters when
michael@0 363 // calculating their width during reflow.
michael@0 364 FRAME_STATE_BIT(Text, 24, TEXT_TRIMMED_TRAILING_WHITESPACE)
michael@0 365
michael@0 366 // This bit is set on frames that have justification enabled. We record
michael@0 367 // this in a state bit because we don't always have the containing block
michael@0 368 // easily available to check text-align on.
michael@0 369 FRAME_STATE_BIT(Text, 25, TEXT_JUSTIFICATION_ENABLED)
michael@0 370
michael@0 371 // Set this bit if the textframe has overflow area for IME/spellcheck underline.
michael@0 372 FRAME_STATE_BIT(Text, 26, TEXT_SELECTION_UNDERLINE_OVERFLOWED)
michael@0 373
michael@0 374 // -- Cache bits for IsEmpty() ------------------------------------------------
michael@0 375
michael@0 376 // nsTextFrame.cpp defines TEXT_WHITESPACE_FLAGS to be both of these bits.
michael@0 377
michael@0 378 // Set this bit if the textframe is known to be only collapsible whitespace.
michael@0 379 FRAME_STATE_BIT(Text, 27, TEXT_IS_ONLY_WHITESPACE)
michael@0 380
michael@0 381 // Set this bit if the textframe is known to be not only collapsible whitespace.
michael@0 382 FRAME_STATE_BIT(Text, 28, TEXT_ISNOT_ONLY_WHITESPACE)
michael@0 383
michael@0 384 // -- Other state bits --------------------------------------------------------
michael@0 385
michael@0 386 // Set when this text frame is mentioned in the userdata for mTextRun
michael@0 387 FRAME_STATE_BIT(Text, 29, TEXT_IN_TEXTRUN_USER_DATA)
michael@0 388
michael@0 389 // This state bit is set on frames whose character data offsets need to be
michael@0 390 // fixed up
michael@0 391 FRAME_STATE_BIT(Text, 30, TEXT_OFFSETS_NEED_FIXING)
michael@0 392
michael@0 393 // This state bit is set on frames that have some non-collapsed characters after
michael@0 394 // reflow
michael@0 395 FRAME_STATE_BIT(Text, 31, TEXT_HAS_NONCOLLAPSED_CHARACTERS)
michael@0 396
michael@0 397 // This state bit is set on children of token MathML elements.
michael@0 398 // NOTE: TEXT_IS_IN_TOKEN_MATHML has a global state bit value that is shared
michael@0 399 // with NS_FRAME_IS_PUSHED_FLOAT.
michael@0 400 FRAME_STATE_BIT(Text, 32, TEXT_IS_IN_TOKEN_MATHML)
michael@0 401
michael@0 402 // Set when this text frame is mentioned in the userdata for the
michael@0 403 // uninflated textrun property
michael@0 404 FRAME_STATE_BIT(Text, 60, TEXT_IN_UNINFLATED_TEXTRUN_USER_DATA)
michael@0 405
michael@0 406 FRAME_STATE_BIT(Text, 61, TEXT_HAS_FONT_INFLATION)
michael@0 407
michael@0 408 // Whether this frame is cached in the Offset Frame Cache
michael@0 409 // (OffsetToFrameProperty)
michael@0 410 FRAME_STATE_BIT(Text, 63, TEXT_IN_OFFSET_CACHE)
michael@0 411
michael@0 412
michael@0 413 // == Frame state bits that apply to block frames =============================
michael@0 414
michael@0 415 FRAME_STATE_GROUP(Block, nsBlockFrame)
michael@0 416
michael@0 417 // See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
michael@0 418
michael@0 419 // Something in the block has changed that requires Bidi resolution to be
michael@0 420 // performed on the block. This flag must be either set on all blocks in a
michael@0 421 // continuation chain or none of them.
michael@0 422 FRAME_STATE_BIT(Block, 20, NS_BLOCK_NEEDS_BIDI_RESOLUTION)
michael@0 423
michael@0 424 FRAME_STATE_BIT(Block, 21, NS_BLOCK_HAS_PUSHED_FLOATS)
michael@0 425 FRAME_STATE_BIT(Block, 22, NS_BLOCK_MARGIN_ROOT)
michael@0 426 FRAME_STATE_BIT(Block, 23, NS_BLOCK_FLOAT_MGR)
michael@0 427 FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_LINE_CURSOR)
michael@0 428 FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_LINES)
michael@0 429 FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)
michael@0 430
michael@0 431 // Set on any block that has descendant frames in the normal
michael@0 432 // flow with 'clear' set to something other than 'none'
michael@0 433 // (including <BR CLEAR="..."> frames)
michael@0 434 FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_CLEAR_CHILDREN)
michael@0 435
michael@0 436 // NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
michael@0 437 // blocks which were forced to not have scrollframes but still need to clip
michael@0 438 // the display of their kids.
michael@0 439 FRAME_STATE_BIT(Block, 28, NS_BLOCK_CLIP_PAGINATED_OVERFLOW)
michael@0 440
michael@0 441 // NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
michael@0 442 // even if it has no actual first-letter frame among its descendants.
michael@0 443 FRAME_STATE_BIT(Block, 29, NS_BLOCK_HAS_FIRST_LETTER_STYLE)
michael@0 444
michael@0 445 // NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET and NS_BLOCK_FRAME_HAS_INSIDE_BULLET
michael@0 446 // means the block has an associated bullet frame, they are mutually exclusive.
michael@0 447 FRAME_STATE_BIT(Block, 30, NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET)
michael@0 448 FRAME_STATE_BIT(Block, 31, NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
michael@0 449
michael@0 450 // This block has had a child marked dirty, so before we reflow we need
michael@0 451 // to look through the lines to find any such children and mark
michael@0 452 // appropriate lines dirty.
michael@0 453 FRAME_STATE_BIT(Block, 61, NS_BLOCK_LOOK_FOR_DIRTY_FRAMES)
michael@0 454
michael@0 455 // Are our cached intrinsic widths intrinsic widths for font size
michael@0 456 // inflation? i.e., what was the current state of
michael@0 457 // GetPresContext()->mInflationDisabledForShrinkWrap at the time they
michael@0 458 // were computed?
michael@0 459 // nsBlockFrame is the only thing that caches intrinsic widths that
michael@0 460 // needs to track this because it's the only thing that caches intrinsic
michael@0 461 // widths that lives inside of things (form controls) that do intrinsic
michael@0 462 // sizing with font inflation enabled.
michael@0 463 FRAME_STATE_BIT(Block, 62, NS_BLOCK_FRAME_INTRINSICS_INFLATED)
michael@0 464
michael@0 465 // NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
michael@0 466 // frame among the block's descendants. If there is a floating first-letter
michael@0 467 // frame, or the block has first-letter style but has no first letter, this
michael@0 468 // bit is not set. This bit is set on the first continuation only.
michael@0 469 FRAME_STATE_BIT(Block, 63, NS_BLOCK_HAS_FIRST_LETTER_CHILD)
michael@0 470
michael@0 471
michael@0 472 // == Frame state bits that apply to bullet frames ============================
michael@0 473
michael@0 474 FRAME_STATE_GROUP(Bullet, nsBulletFrame)
michael@0 475
michael@0 476 FRAME_STATE_BIT(Block, 62, BULLET_FRAME_HAS_FONT_INFLATION)
michael@0 477 FRAME_STATE_BIT(Block, 63, BULLET_FRAME_IMAGE_LOADING)
michael@0 478
michael@0 479
michael@0 480 // == Frame state bits that apply to scroll frames ============================
michael@0 481
michael@0 482 FRAME_STATE_GROUP(Scroll, nsIScrollableFrame)
michael@0 483
michael@0 484 // When set, the next scroll operation on the scrollframe will invalidate its
michael@0 485 // entire contents. Useful for text-overflow.
michael@0 486 // This bit is cleared after each time the scrollframe is scrolled. Whoever
michael@0 487 // needs to set it should set it again on each paint.
michael@0 488 FRAME_STATE_BIT(Scroll, 20, NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL)
michael@0 489
michael@0 490
michael@0 491 // == Frame state bits that apply to image frames =============================
michael@0 492
michael@0 493 FRAME_STATE_GROUP(Image, nsImageFrame)
michael@0 494
michael@0 495 FRAME_STATE_BIT(Image, 20, IMAGE_SIZECONSTRAINED)
michael@0 496 FRAME_STATE_BIT(Image, 21, IMAGE_GOTINITIALREFLOW)
michael@0 497
michael@0 498
michael@0 499 // == Frame state bits that apply to inline frames ============================
michael@0 500
michael@0 501 FRAME_STATE_GROUP(Inline, nsInlineFrame)
michael@0 502
michael@0 503 /** In Bidi inline start (or end) margin/padding/border should be applied to
michael@0 504 * first (or last) frame (or a continuation frame).
michael@0 505 * This state value shows if this frame is first (or last) continuation
michael@0 506 * or not.
michael@0 507 */
michael@0 508
michael@0 509 FRAME_STATE_BIT(Inline, 21, NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET)
michael@0 510 FRAME_STATE_BIT(Inline, 22, NS_INLINE_FRAME_BIDI_VISUAL_IS_FIRST)
michael@0 511 FRAME_STATE_BIT(Inline, 23, NS_INLINE_FRAME_BIDI_VISUAL_IS_LAST)
michael@0 512
michael@0 513
michael@0 514 // == Frame state bits that apply to placeholder frames =======================
michael@0 515
michael@0 516 FRAME_STATE_GROUP(Placeholder, nsPlaceholderFrame)
michael@0 517
michael@0 518 // Frame state bits that are used to keep track of what this is a
michael@0 519 // placeholder for.
michael@0 520
michael@0 521 FRAME_STATE_BIT(Placeholder, 20, PLACEHOLDER_FOR_FLOAT)
michael@0 522 FRAME_STATE_BIT(Placeholder, 21, PLACEHOLDER_FOR_ABSPOS)
michael@0 523 FRAME_STATE_BIT(Placeholder, 22, PLACEHOLDER_FOR_FIXEDPOS)
michael@0 524 FRAME_STATE_BIT(Placeholder, 23, PLACEHOLDER_FOR_POPUP)
michael@0 525
michael@0 526
michael@0 527 // == Frame state bits that apply to table cell frames ========================
michael@0 528
michael@0 529 FRAME_STATE_GROUP(TableCell, nsTableCellFrame)
michael@0 530
michael@0 531 FRAME_STATE_BIT(TableCell, 28, NS_TABLE_CELL_HAS_PCT_OVER_HEIGHT)
michael@0 532 FRAME_STATE_BIT(TableCell, 29, NS_TABLE_CELL_HAD_SPECIAL_REFLOW)
michael@0 533 FRAME_STATE_BIT(TableCell, 31, NS_TABLE_CELL_CONTENT_EMPTY)
michael@0 534
michael@0 535
michael@0 536 // == Frame state bits that apply to table column frames ======================
michael@0 537
michael@0 538 // Bits 28-31 on nsTableColFrames are used to store the column type.
michael@0 539
michael@0 540
michael@0 541 // == Frame state bits that apply to table column group frames ================
michael@0 542
michael@0 543 // Bits 30-31 on nsTableColGroupFrames are used to store the column type.
michael@0 544
michael@0 545
michael@0 546 // == Frame state bits that apply to table rows and table row group frames ====
michael@0 547
michael@0 548 FRAME_STATE_GROUP(TableRowAndRowGroup, nsTableRowFrame)
michael@0 549 FRAME_STATE_GROUP(TableRowAndRowGroup, nsTableRowGroupFrame)
michael@0 550
michael@0 551 // see nsTableRowGroupFrame::InitRepeatedFrame
michael@0 552 FRAME_STATE_BIT(TableRowAndRowGroup, 28, NS_REPEATED_ROW_OR_ROWGROUP)
michael@0 553
michael@0 554
michael@0 555 // == Frame state bits that apply to table row frames =========================
michael@0 556
michael@0 557 FRAME_STATE_GROUP(TableRow, nsTableRowFrame)
michael@0 558
michael@0 559 // Indicates whether this row has any cells that have
michael@0 560 // non-auto-height and rowspan=1
michael@0 561 FRAME_STATE_BIT(TableRow, 29, NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT)
michael@0 562
michael@0 563 FRAME_STATE_BIT(TableRow, 30, NS_TABLE_ROW_HAS_UNPAGINATED_HEIGHT)
michael@0 564
michael@0 565
michael@0 566 // == Frame state bits that apply to table row group frames ===================
michael@0 567
michael@0 568 FRAME_STATE_GROUP(TableRowGroup, nsTableRowGroupFrame)
michael@0 569
michael@0 570 FRAME_STATE_BIT(TableRowGroup, 27, NS_ROWGROUP_HAS_ROW_CURSOR)
michael@0 571 FRAME_STATE_BIT(TableRowGroup, 30, NS_ROWGROUP_HAS_STYLE_HEIGHT)
michael@0 572
michael@0 573 // thead or tfoot should be repeated on every printed page
michael@0 574 FRAME_STATE_BIT(TableRowGroup, 31, NS_ROWGROUP_REPEATABLE)
michael@0 575
michael@0 576
michael@0 577 #ifdef DEFINED_FRAME_STATE_GROUP
michael@0 578 #undef DEFINED_FRAME_STATE_GROUP
michael@0 579 #undef FRAME_STATE_GROUP
michael@0 580 #endif
michael@0 581
michael@0 582 #ifdef DEFINED_FRAME_STATE_BIT
michael@0 583 #undef DEFINED_FRAME_STATE_BIT
michael@0 584 #undef FRAME_STATE_BIT
michael@0 585 #endif

mercurial