Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / layout / generic / FrameClasses.py
blobd1d0a0b13b5b63c3a7205f55316c570580786fe7
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 # Frame class definitions, used to generate FrameIdList.h and FrameTypeList.h
6 from FrameClass import AbstractFrame, Frame
8 # Most frames support these.
9 COMMON = {
10 "SupportsCSSTransforms",
11 "SupportsContainLayoutAndPaint",
12 "SupportsAspectRatio",
14 LEAF = {"Leaf"}
15 MATHML = {"MathML"}
16 SVG = {"SVG"}
18 BLOCK = COMMON | {"CanContainOverflowContainers"}
20 REPLACED = COMMON | {"Replaced"}
21 REPLACED_SIZING = REPLACED | {"ReplacedSizing"}
22 REPLACED_WITH_BLOCK = REPLACED | {"ReplacedContainsBlock"}
23 REPLACED_SIZING_WITH_BLOCK = REPLACED_SIZING | REPLACED_WITH_BLOCK
25 TABLE = COMMON - {"SupportsCSSTransforms"}
26 TABLE_PART = {"SupportsCSSTransforms", "TablePart"}
27 TABLE_CELL = TABLE_PART | {"SupportsContainLayoutAndPaint"}
28 MATHML_CONTAINER = (COMMON - {"SupportsContainLayoutAndPaint"}) | MATHML
29 SVG_CONTENT = (COMMON - {"SupportsContainLayoutAndPaint"}) | SVG
30 SVG_CONTAINER = SVG_CONTENT | {"SVGContainer"}
32 # NOTE: Intentionally not including "COMMON" here.
33 INLINE = {"BidiInlineContainer", "LineParticipant"}
34 RUBY_CONTENT = {"LineParticipant"}
35 # FIXME(bug 713387): Shouldn't be Replaced, probably.
36 TEXT = COMMON | {"Replaced", "LineParticipant"} | LEAF
38 # See FrameClass.py and GenerateFrameLists.py for implementation details.
39 # The following is a list of all the frame classes, followed by the frame type,
40 # and a set of flags.
42 # The frame type is somewhat arbitrary (could literally be anything) but for
43 # new frame class implementations it's probably a good idea to make it a unique
44 # string (maybe matching the frame name).
46 # See bug 1555477 for some related discussion about the whole Type() set-up.
47 FRAME_CLASSES = [
48 Frame("BRFrame", "Br", REPLACED | LEAF | {"LineParticipant"}),
49 Frame("nsBCTableCellFrame", "TableCell", TABLE_CELL),
50 Frame("nsBackdropFrame", "Backdrop", COMMON | LEAF),
51 Frame("nsBlockFrame", "Block", BLOCK),
52 Frame("nsCanvasFrame", "Canvas", BLOCK),
53 # FIXME(emilio, bug 1866692): These don't have a block, wtf? Can we remove the "ReplacedContainsBlock" flag
54 Frame("nsCheckboxRadioFrame", "CheckboxRadio", REPLACED_WITH_BLOCK | LEAF),
55 Frame("nsColorControlFrame", "ColorControl", REPLACED_WITH_BLOCK | LEAF),
56 Frame("nsColumnSetFrame", "ColumnSet", COMMON),
57 Frame("ColumnSetWrapperFrame", "ColumnSetWrapper", BLOCK),
58 Frame("nsComboboxControlFrame", "ComboboxControl", BLOCK | REPLACED_WITH_BLOCK),
59 # FIXME(emilio, bug 1362907): Revisit these after that bug, this is the
60 # only frame that has ReplacedContainsBlock but not Replaced, which is
61 # sketchy.
62 Frame(
63 "nsComboboxDisplayFrame", "ComboboxDisplay", REPLACED_WITH_BLOCK - {"Replaced"}
65 Frame("nsContinuingTextFrame", "Text", TEXT),
66 Frame("nsDateTimeControlFrame", "DateTimeControl", REPLACED_WITH_BLOCK),
67 Frame("nsFieldSetFrame", "FieldSet", BLOCK),
68 Frame("nsFileControlFrame", "Block", REPLACED_WITH_BLOCK | LEAF),
69 Frame("FileControlLabelFrame", "Block", BLOCK | LEAF),
70 Frame("nsFirstLetterFrame", "Letter", INLINE),
71 Frame("nsFloatingFirstLetterFrame", "Letter", INLINE - {"LineParticipant"}),
72 Frame("nsFirstLineFrame", "Line", INLINE),
73 Frame("nsFlexContainerFrame", "FlexContainer", BLOCK),
74 Frame("nsIFrame", "None", COMMON),
75 Frame("nsGfxButtonControlFrame", "GfxButtonControl", REPLACED_WITH_BLOCK | LEAF),
76 Frame("nsGridContainerFrame", "GridContainer", BLOCK),
77 Frame("nsHTMLButtonControlFrame", "HTMLButtonControl", REPLACED_WITH_BLOCK),
78 Frame("nsHTMLCanvasFrame", "HTMLCanvas", REPLACED_SIZING),
79 Frame("nsHTMLFramesetBlankFrame", "None", COMMON | LEAF),
80 Frame("nsHTMLFramesetBorderFrame", "None", COMMON | LEAF),
81 Frame("nsHTMLFramesetFrame", "FrameSet", COMMON | LEAF),
82 Frame("nsHTMLScrollFrame", "Scroll", COMMON),
83 Frame("nsImageControlFrame", "ImageControl", REPLACED_SIZING | LEAF),
84 Frame("nsImageFrame", "Image", REPLACED_SIZING | {"LeafDynamic"}),
85 Frame("nsInlineFrame", "Inline", INLINE),
86 Frame("nsListControlFrame", "ListControl", REPLACED_WITH_BLOCK),
87 Frame("nsMathMLmathBlockFrame", "Block", BLOCK | MATHML),
88 Frame("nsMathMLmathInlineFrame", "Inline", INLINE | MATHML),
89 Frame("nsMathMLmencloseFrame", "None", MATHML_CONTAINER),
90 Frame("nsMathMLmfracFrame", "None", MATHML_CONTAINER),
91 Frame("nsMathMLmmultiscriptsFrame", "None", MATHML_CONTAINER),
92 Frame("nsMathMLmoFrame", "None", MATHML_CONTAINER),
93 Frame("nsMathMLmpaddedFrame", "None", MATHML_CONTAINER),
94 Frame("nsMathMLmrootFrame", "None", MATHML_CONTAINER),
95 Frame("nsMathMLmrowFrame", "None", MATHML_CONTAINER),
96 Frame("nsMathMLmspaceFrame", "None", MATHML_CONTAINER | LEAF),
97 Frame("nsMathMLmsqrtFrame", "None", MATHML_CONTAINER),
98 Frame("nsMathMLmtableFrame", "Table", TABLE | MATHML),
99 Frame("nsMathMLmtableWrapperFrame", "TableWrapper", BLOCK | MATHML),
100 Frame("nsMathMLmtdFrame", "TableCell", TABLE_CELL | MATHML),
101 Frame("nsMathMLmtdInnerFrame", "Block", BLOCK | MATHML),
102 Frame("nsMathMLmtrFrame", "TableRow", TABLE_PART | MATHML),
103 Frame("nsMathMLmunderoverFrame", "None", MATHML_CONTAINER),
104 Frame("nsMathMLTokenFrame", "None", MATHML_CONTAINER),
105 Frame("nsMenuPopupFrame", "MenuPopup", BLOCK),
106 Frame("nsMeterFrame", "Meter", REPLACED_WITH_BLOCK | LEAF),
107 Frame("nsNumberControlFrame", "TextInput", REPLACED_WITH_BLOCK | LEAF),
108 Frame("nsPageBreakFrame", "PageBreak", COMMON | LEAF),
109 Frame("nsPageContentFrame", "PageContent", BLOCK),
110 Frame("nsPageFrame", "Page", COMMON),
111 Frame("nsPlaceholderFrame", "Placeholder", COMMON | LEAF),
112 Frame("nsProgressFrame", "Progress", REPLACED_WITH_BLOCK | LEAF),
113 Frame("nsRangeFrame", "Range", REPLACED_WITH_BLOCK | LEAF),
114 Frame("nsRubyBaseContainerFrame", "RubyBaseContainer", RUBY_CONTENT),
115 Frame("nsRubyBaseFrame", "RubyBase", RUBY_CONTENT),
116 Frame("nsRubyFrame", "Ruby", RUBY_CONTENT),
117 Frame("nsRubyTextContainerFrame", "RubyTextContainer", {"None"}),
118 Frame("nsRubyTextFrame", "RubyText", RUBY_CONTENT),
119 Frame("SimpleXULLeafFrame", "SimpleXULLeaf", COMMON | LEAF),
120 Frame("nsScrollbarButtonFrame", "SimpleXULLeaf", COMMON | LEAF),
121 Frame("nsScrollbarFrame", "Scrollbar", COMMON),
122 Frame("nsSearchControlFrame", "SearchControl", LEAF),
123 Frame("nsSelectsAreaFrame", "Block", BLOCK),
124 Frame("nsPageSequenceFrame", "PageSequence", COMMON),
125 Frame("nsSliderFrame", "Slider", COMMON),
126 Frame("nsSplitterFrame", "SimpleXULLeaf", COMMON | LEAF),
127 Frame("nsSubDocumentFrame", "SubDocument", REPLACED_SIZING_WITH_BLOCK | LEAF),
128 Frame("PrintedSheetFrame", "PrintedSheet", COMMON),
129 Frame("SVGAFrame", "SVGA", SVG_CONTAINER),
130 Frame("SVGClipPathFrame", "SVGClipPath", SVG_CONTAINER),
131 Frame("SVGContainerFrame", "None", SVG_CONTAINER),
132 Frame("SVGFEContainerFrame", "SVGFEContainer", SVG_CONTENT),
133 Frame("SVGFEImageFrame", "SVGFEImage", SVG_CONTENT | LEAF),
134 Frame("SVGFELeafFrame", "SVGFELeaf", SVG_CONTENT | LEAF),
135 Frame("SVGFEUnstyledLeafFrame", "SVGFEUnstyledLeaf", SVG_CONTENT | LEAF),
136 Frame("SVGFilterFrame", "SVGFilter", SVG_CONTAINER),
137 Frame("SVGForeignObjectFrame", "SVGForeignObject", SVG_CONTENT),
138 Frame("SVGGeometryFrame", "SVGGeometry", SVG_CONTENT | LEAF),
139 Frame("SVGGFrame", "SVGG", SVG_CONTAINER),
140 Frame("SVGImageFrame", "SVGImage", SVG_CONTENT | LEAF),
141 Frame("SVGInnerSVGFrame", "SVGInnerSVG", SVG_CONTAINER),
142 Frame("SVGLinearGradientFrame", "SVGLinearGradient", SVG_CONTAINER),
143 Frame("SVGMarkerFrame", "SVGMarker", SVG_CONTAINER),
144 Frame("SVGMarkerAnonChildFrame", "SVGMarkerAnonChild", SVG_CONTAINER),
145 Frame("SVGMaskFrame", "SVGMask", SVG_CONTAINER),
146 Frame(
147 "SVGOuterSVGFrame",
148 "SVGOuterSVG",
149 SVG_CONTAINER | {"Replaced", "ReplacedSizing", "SupportsContainLayoutAndPaint"},
151 Frame("SVGOuterSVGAnonChildFrame", "SVGOuterSVGAnonChild", SVG_CONTAINER),
152 Frame("SVGPatternFrame", "SVGPattern", SVG_CONTAINER),
153 Frame("SVGRadialGradientFrame", "SVGRadialGradient", SVG_CONTAINER),
154 Frame("SVGStopFrame", "SVGStop", SVG_CONTENT | LEAF),
155 Frame("SVGSwitchFrame", "SVGSwitch", SVG_CONTAINER),
156 Frame("SVGSymbolFrame", "SVGSymbol", SVG_CONTAINER),
157 Frame("SVGTextFrame", "SVGText", SVG_CONTAINER),
158 # Not a leaf, though it always has a ShadowRoot, so in practice light DOM
159 # children never render.
160 Frame("SVGUseFrame", "SVGUse", SVG_CONTAINER),
161 Frame("MiddleCroppingLabelFrame", "MiddleCroppingLabel", BLOCK | LEAF),
162 Frame("SVGViewFrame", "SVGView", SVG_CONTENT | LEAF),
163 Frame("nsTableCellFrame", "TableCell", TABLE_CELL),
164 Frame("nsTableColFrame", "TableCol", TABLE_PART),
165 Frame("nsTableColGroupFrame", "TableColGroup", TABLE_PART),
166 Frame("nsTableFrame", "Table", TABLE),
167 Frame("nsTableWrapperFrame", "TableWrapper", BLOCK),
168 Frame("nsTableRowFrame", "TableRow", TABLE_PART),
169 Frame("nsTableRowGroupFrame", "TableRowGroup", TABLE_PART),
170 Frame("nsTextControlFrame", "TextInput", REPLACED_WITH_BLOCK | LEAF),
171 Frame("nsTextFrame", "Text", TEXT),
172 Frame("nsTreeBodyFrame", "SimpleXULLeaf", COMMON | LEAF),
173 Frame("nsVideoFrame", "HTMLVideo", REPLACED_SIZING),
174 Frame("nsAudioFrame", "HTMLVideo", REPLACED_SIZING - {"SupportsAspectRatio"}),
175 Frame("ViewportFrame", "Viewport", COMMON),
176 Frame("WBRFrame", "Wbr", COMMON | LEAF),
177 # Non-concrete classes (for FrameIID use)
178 AbstractFrame("MiddleCroppingBlockFrame"),
179 AbstractFrame("nsContainerFrame"),
180 AbstractFrame("nsLeafFrame"),
181 AbstractFrame("nsMathMLFrame"),
182 AbstractFrame("nsMathMLContainerFrame"),
183 AbstractFrame("nsRubyContentFrame"),
184 AbstractFrame("nsSplittableFrame"),
185 AbstractFrame("SVGDisplayContainerFrame"),
186 AbstractFrame("SVGGradientFrame"),
187 AbstractFrame("SVGPaintServerFrame"),
188 # Interfaces (for FrameIID use)
189 AbstractFrame("nsIAnonymousContentCreator"),
190 AbstractFrame("nsIFormControlFrame"),
191 AbstractFrame("nsIMathMLFrame"),
192 AbstractFrame("nsIPercentBSizeObserver"),
193 AbstractFrame("nsIPopupContainer"),
194 AbstractFrame("nsIScrollableFrame"),
195 AbstractFrame("nsIScrollbarMediator"),
196 AbstractFrame("nsISelectControlFrame"),
197 AbstractFrame("nsIStatefulFrame"),
198 AbstractFrame("ISVGDisplayableFrame"),
199 AbstractFrame("ISVGSVGFrame"),
200 AbstractFrame("nsITableCellLayout"),
201 AbstractFrame("nsITableLayout"),
202 AbstractFrame("nsITextControlFrame"),