layout/generic/nsHTMLParts.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 /* factory functions for rendering object classes */
michael@0 7
michael@0 8 #ifndef nsHTMLParts_h___
michael@0 9 #define nsHTMLParts_h___
michael@0 10
michael@0 11 #include "nscore.h"
michael@0 12 #include "nsISupports.h"
michael@0 13 #include "nsIFrame.h"
michael@0 14 class nsIAtom;
michael@0 15 class nsNodeInfoManager;
michael@0 16 class nsIContent;
michael@0 17 class nsIContentIterator;
michael@0 18 class nsIDocument;
michael@0 19 class nsIFrame;
michael@0 20 class nsIHTMLContentSink;
michael@0 21 class nsIFragmentContentSink;
michael@0 22 class nsStyleContext;
michael@0 23 class nsIURI;
michael@0 24 class nsString;
michael@0 25 class nsIPresShell;
michael@0 26 class nsIChannel;
michael@0 27 class nsTableColFrame;
michael@0 28
michael@0 29 // These are all the block specific frame bits, they are copied from
michael@0 30 // the prev-in-flow to a newly created next-in-flow, except for the
michael@0 31 // NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
michael@0 32 #define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \
michael@0 33 NS_BLOCK_FLOAT_MGR | \
michael@0 34 NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \
michael@0 35 NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
michael@0 36 NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
michael@0 37 NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
michael@0 38 NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
michael@0 39
michael@0 40 // This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited
michael@0 41 // by default. They should only be set on the first-in-flow.
michael@0 42 // See nsBlockFrame::Init.
michael@0 43 #define NS_BLOCK_FLAGS_NON_INHERITED_MASK \
michael@0 44 (NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
michael@0 45 NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
michael@0 46 NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
michael@0 47
michael@0 48 // Factory methods for creating html layout objects
michael@0 49
michael@0 50 // Create a frame that supports "display: block" layout behavior
michael@0 51 nsIFrame*
michael@0 52 NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0));
michael@0 53
michael@0 54 // Special Generated Content Node. It contains text taken from an
michael@0 55 // attribute of its *grandparent* content node.
michael@0 56 nsresult
michael@0 57 NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
michael@0 58 int32_t aNameSpaceID, nsIAtom* aAttrName,
michael@0 59 nsIContent** aResult);
michael@0 60
michael@0 61 // Create a basic area frame but the GetFrameForPoint is overridden to always
michael@0 62 // return the option frame
michael@0 63 // By default, area frames will extend
michael@0 64 // their height to cover any children that "stick out".
michael@0 65 nsIFrame*
michael@0 66 NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
michael@0 67
michael@0 68 // Create a block formatting context blockframe
michael@0 69 inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
michael@0 70 nsStyleContext* aStyleContext)
michael@0 71 {
michael@0 72 return NS_NewBlockFrame(aPresShell, aStyleContext,
michael@0 73 NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
michael@0 74 }
michael@0 75
michael@0 76 nsIFrame*
michael@0 77 NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 78
michael@0 79 nsIFrame*
michael@0 80 NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 81
michael@0 82 // <frame> and <iframe>
michael@0 83 nsIFrame*
michael@0 84 NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 85 // <frameset>
michael@0 86 nsIFrame*
michael@0 87 NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 88
michael@0 89 nsIFrame*
michael@0 90 NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 91 nsIFrame*
michael@0 92 NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 93 nsIFrame*
michael@0 94 NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 95 nsIFrame*
michael@0 96 NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 97 nsIFrame*
michael@0 98 NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 99 nsIFrame*
michael@0 100 NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 101 nsIFrame*
michael@0 102 NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 103 nsIFrame*
michael@0 104 NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 105 inline nsIFrame*
michael@0 106 NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
michael@0 107 return NS_NewEmptyFrame(aPresShell, aContext);
michael@0 108 }
michael@0 109
michael@0 110 nsIFrame*
michael@0 111 NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags);
michael@0 112
michael@0 113 nsIFrame*
michael@0 114 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 115 nsIFrame*
michael@0 116 NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 117 nsIFrame*
michael@0 118 NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 119 nsIFrame*
michael@0 120 NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 121 nsIFrame*
michael@0 122 NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 123 nsIFrame*
michael@0 124 NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 125
michael@0 126 // forms
michael@0 127 nsIFrame*
michael@0 128 NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 129 nsIFrame*
michael@0 130 NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 131 nsIFrame*
michael@0 132 NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 133 nsIFrame*
michael@0 134 NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 135 nsIFrame*
michael@0 136 NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 137 nsIFrame*
michael@0 138 NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 139 nsIFrame*
michael@0 140 NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 141 nsIFrame*
michael@0 142 NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 143 nsIFrame*
michael@0 144 NS_NewColorControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 145 nsIFrame*
michael@0 146 NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 147 nsIFrame*
michael@0 148 NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 149 nsIFrame*
michael@0 150 NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 151 nsIFrame*
michael@0 152 NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 153 nsIFrame*
michael@0 154 NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 155 nsIFrame*
michael@0 156 NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 157 nsIFrame*
michael@0 158 NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 159 nsIFrame*
michael@0 160 NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 161 nsIFrame*
michael@0 162 NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
michael@0 163 nsIFrame*
michael@0 164 NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 165 nsIFrame*
michael@0 166 NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 167 nsIFrame*
michael@0 168 NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 169 nsIFrame*
michael@0 170 NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 171
michael@0 172 // Table frame factories
michael@0 173 nsIFrame*
michael@0 174 NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 175 nsIFrame*
michael@0 176 NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 177 nsIFrame*
michael@0 178 NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 179 nsTableColFrame*
michael@0 180 NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 181 nsIFrame*
michael@0 182 NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 183 nsIFrame*
michael@0 184 NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 185 nsIFrame*
michael@0 186 NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 187 nsIFrame*
michael@0 188 NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse);
michael@0 189
michael@0 190 nsresult
michael@0 191 NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
michael@0 192 nsIDocument* aDoc, nsIURI* aURL,
michael@0 193 nsISupports* aContainer, // e.g. docshell
michael@0 194 nsIChannel* aChannel);
michael@0 195 nsresult
michael@0 196 NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
michael@0 197 nsresult
michael@0 198 NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
michael@0 199
michael@0 200 #endif /* nsHTMLParts_h___ */

mercurial