2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* factory functions for rendering object classes */
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsHTMLParts_h___
|
|
|
|
#define nsHTMLParts_h___
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsISupports.h"
|
2010-06-09 09:28:14 +04:00
|
|
|
#include "nsIFrame.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIAtom;
|
2005-09-24 22:43:15 +04:00
|
|
|
class nsNodeInfoManager;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIContent;
|
2000-03-22 08:55:05 +03:00
|
|
|
class nsIContentIterator;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIDocument;
|
2001-12-18 01:39:59 +03:00
|
|
|
class nsIFrame;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIHTMLContentSink;
|
2004-10-01 02:27:45 +04:00
|
|
|
class nsIFragmentContentSink;
|
2006-03-27 01:30:36 +04:00
|
|
|
class nsStyleContext;
|
1999-06-23 07:29:44 +04:00
|
|
|
class nsIURI;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsString;
|
1999-12-05 02:49:50 +03:00
|
|
|
class nsIPresShell;
|
2001-03-03 03:41:02 +03:00
|
|
|
class nsIChannel;
|
2007-11-18 21:56:49 +03:00
|
|
|
class nsTableColFrame;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2001-02-23 15:42:12 +03:00
|
|
|
/**
|
|
|
|
* Additional frame-state bits used by nsBlockFrame
|
|
|
|
* See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
|
2007-12-05 11:15:15 +03:00
|
|
|
*
|
2010-11-30 21:19:57 +03:00
|
|
|
* NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
|
|
|
|
* blocks which were forced to not have scrollframes but still need to clip
|
|
|
|
* the display of their kids.
|
|
|
|
*
|
2007-12-05 11:15:15 +03:00
|
|
|
* NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
|
|
|
|
* even if it has no actual first-letter frame among its descendants.
|
|
|
|
*
|
|
|
|
* NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
|
|
|
|
* frame among the block's descendants. If there is a floating first-letter
|
|
|
|
* frame, or the block has first-letter style but has no first letter, this
|
2009-12-23 02:44:35 +03:00
|
|
|
* bit is not set. This bit is set on the first continuation only.
|
2012-03-08 05:57:37 +04:00
|
|
|
*
|
|
|
|
* NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET and NS_BLOCK_FRAME_HAS_INSIDE_BULLET
|
|
|
|
* means the block has an associated bullet frame, they are mutually exclusive.
|
|
|
|
*
|
2001-02-23 15:42:12 +03:00
|
|
|
*/
|
2010-06-09 09:28:14 +04:00
|
|
|
#define NS_BLOCK_MARGIN_ROOT NS_FRAME_STATE_BIT(22)
|
|
|
|
#define NS_BLOCK_FLOAT_MGR NS_FRAME_STATE_BIT(23)
|
2010-11-30 21:19:57 +03:00
|
|
|
#define NS_BLOCK_CLIP_PAGINATED_OVERFLOW NS_FRAME_STATE_BIT(28)
|
2010-06-09 09:28:14 +04:00
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_STYLE NS_FRAME_STATE_BIT(29)
|
|
|
|
#define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET NS_FRAME_STATE_BIT(30)
|
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_CHILD NS_FRAME_STATE_BIT(31)
|
2012-03-08 05:57:37 +04:00
|
|
|
#define NS_BLOCK_FRAME_HAS_INSIDE_BULLET NS_FRAME_STATE_BIT(63)
|
|
|
|
// These are all the block specific frame bits, they are copied from
|
|
|
|
// the prev-in-flow to a newly created next-in-flow, except for the
|
|
|
|
// NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
|
|
|
|
#define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \
|
|
|
|
NS_BLOCK_FLOAT_MGR | \
|
|
|
|
NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
|
|
|
|
NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
|
|
|
|
NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
|
|
|
|
|
|
|
|
// This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited
|
|
|
|
// by default. They should only be set on the first-in-flow.
|
|
|
|
// See nsBlockFrame::Init.
|
|
|
|
#define NS_BLOCK_FLAGS_NON_INHERITED_MASK \
|
|
|
|
(NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
|
|
|
|
NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
|
2001-02-23 15:42:12 +03:00
|
|
|
|
1998-09-01 05:33:19 +04:00
|
|
|
// Factory methods for creating html layout objects
|
|
|
|
|
1999-10-08 08:32:46 +04:00
|
|
|
// Create a frame that supports "display: block" layout behavior
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags = 0);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
2008-08-18 05:16:42 +04:00
|
|
|
// Special Generated Content Node. It contains text taken from an
|
|
|
|
// attribute of its *grandparent* content node.
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
2005-09-24 22:43:15 +04:00
|
|
|
NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNameSpaceID, nsIAtom* aAttrName,
|
2005-09-24 22:43:15 +04:00
|
|
|
nsIContent** aResult);
|
1999-08-19 18:32:19 +04:00
|
|
|
|
1999-09-03 18:52:17 +04:00
|
|
|
// Create a basic area frame but the GetFrameForPoint is overridden to always
|
|
|
|
// return the option frame
|
|
|
|
// By default, area frames will extend
|
|
|
|
// their height to cover any children that "stick out".
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
|
1999-08-19 18:32:19 +04:00
|
|
|
|
2009-02-18 16:25:29 +03:00
|
|
|
// Create a block formatting context blockframe
|
|
|
|
inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aStyleContext)
|
|
|
|
{
|
|
|
|
return NS_NewBlockFrame(aPresShell, aStyleContext,
|
|
|
|
NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
|
1999-05-12 02:03:29 +04:00
|
|
|
}
|
|
|
|
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-06 04:17:30 +04:00
|
|
|
|
1998-09-10 03:30:30 +04:00
|
|
|
// <frame> and <iframe>
|
2005-10-27 01:46:39 +04:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-10 03:30:30 +04:00
|
|
|
// <frameset>
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2003-03-05 18:08:41 +03:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
inline nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
|
|
|
|
return NS_NewEmptyFrame(aPresShell, aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
}
|
2004-10-08 16:17:10 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aStateFlags);
|
2004-10-08 16:17:10 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-10-13 02:13:23 +04:00
|
|
|
|
1998-09-23 21:16:51 +04:00
|
|
|
// forms
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2011-05-10 16:59:07 +04:00
|
|
|
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2012-05-16 19:47:10 +04:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
|
|
|
// Table frame factories
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-11-18 21:56:49 +03:00
|
|
|
nsTableColFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
|
2003-04-02 15:18:00 +04:00
|
|
|
nsIDocument* aDoc, nsIURI* aURL,
|
|
|
|
nsISupports* aContainer, // e.g. docshell
|
2003-03-05 18:08:41 +03:00
|
|
|
nsIChannel* aChannel);
|
|
|
|
nsresult
|
2004-10-01 02:27:45 +04:00
|
|
|
NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
2004-10-01 02:27:45 +04:00
|
|
|
NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
#endif /* nsHTMLParts_h___ */
|