gecko/parser/htmlparser/nsIHTMLContentSink.h
Birunthan Mohanathas 89b6e87981 Bug 1057923 - Flatten parser/htmlparser/{public,src}/ into parent directory. r=mrbkap
--HG--
rename : parser/htmlparser/src/CNavDTD.cpp => parser/htmlparser/CNavDTD.cpp
rename : parser/htmlparser/src/CNavDTD.h => parser/htmlparser/CNavDTD.h
rename : parser/htmlparser/src/CParserContext.cpp => parser/htmlparser/CParserContext.cpp
rename : parser/htmlparser/src/CParserContext.h => parser/htmlparser/CParserContext.h
rename : parser/htmlparser/src/nsElementTable.cpp => parser/htmlparser/nsElementTable.cpp
rename : parser/htmlparser/src/nsElementTable.h => parser/htmlparser/nsElementTable.h
rename : parser/htmlparser/src/nsExpatDriver.cpp => parser/htmlparser/nsExpatDriver.cpp
rename : parser/htmlparser/src/nsExpatDriver.h => parser/htmlparser/nsExpatDriver.h
rename : parser/htmlparser/src/nsHTMLEntities.cpp => parser/htmlparser/nsHTMLEntities.cpp
rename : parser/htmlparser/src/nsHTMLEntities.h => parser/htmlparser/nsHTMLEntities.h
rename : parser/htmlparser/src/nsHTMLEntityList.h => parser/htmlparser/nsHTMLEntityList.h
rename : parser/htmlparser/public/nsHTMLTagList.h => parser/htmlparser/nsHTMLTagList.h
rename : parser/htmlparser/src/nsHTMLTags.cpp => parser/htmlparser/nsHTMLTags.cpp
rename : parser/htmlparser/public/nsHTMLTags.h => parser/htmlparser/nsHTMLTags.h
rename : parser/htmlparser/src/nsHTMLTokenizer.cpp => parser/htmlparser/nsHTMLTokenizer.cpp
rename : parser/htmlparser/src/nsHTMLTokenizer.h => parser/htmlparser/nsHTMLTokenizer.h
rename : parser/htmlparser/public/nsIContentSink.h => parser/htmlparser/nsIContentSink.h
rename : parser/htmlparser/public/nsIDTD.h => parser/htmlparser/nsIDTD.h
rename : parser/htmlparser/public/nsIExpatSink.idl => parser/htmlparser/nsIExpatSink.idl
rename : parser/htmlparser/public/nsIExtendedExpatSink.idl => parser/htmlparser/nsIExtendedExpatSink.idl
rename : parser/htmlparser/public/nsIFragmentContentSink.h => parser/htmlparser/nsIFragmentContentSink.h
rename : parser/htmlparser/public/nsIHTMLContentSink.h => parser/htmlparser/nsIHTMLContentSink.h
rename : parser/htmlparser/public/nsIParser.h => parser/htmlparser/nsIParser.h
rename : parser/htmlparser/public/nsIParserService.h => parser/htmlparser/nsIParserService.h
rename : parser/htmlparser/public/nsITokenizer.h => parser/htmlparser/nsITokenizer.h
rename : parser/htmlparser/src/nsParser.cpp => parser/htmlparser/nsParser.cpp
rename : parser/htmlparser/src/nsParser.h => parser/htmlparser/nsParser.h
rename : parser/htmlparser/public/nsParserBase.h => parser/htmlparser/nsParserBase.h
rename : parser/htmlparser/public/nsParserCIID.h => parser/htmlparser/nsParserCIID.h
rename : parser/htmlparser/public/nsParserConstants.h => parser/htmlparser/nsParserConstants.h
rename : parser/htmlparser/src/nsParserModule.cpp => parser/htmlparser/nsParserModule.cpp
rename : parser/htmlparser/src/nsParserMsgUtils.cpp => parser/htmlparser/nsParserMsgUtils.cpp
rename : parser/htmlparser/src/nsParserMsgUtils.h => parser/htmlparser/nsParserMsgUtils.h
rename : parser/htmlparser/src/nsParserService.cpp => parser/htmlparser/nsParserService.cpp
rename : parser/htmlparser/src/nsParserService.h => parser/htmlparser/nsParserService.h
rename : parser/htmlparser/src/nsScanner.cpp => parser/htmlparser/nsScanner.cpp
rename : parser/htmlparser/src/nsScanner.h => parser/htmlparser/nsScanner.h
rename : parser/htmlparser/src/nsScannerString.cpp => parser/htmlparser/nsScannerString.cpp
rename : parser/htmlparser/public/nsScannerString.h => parser/htmlparser/nsScannerString.h
rename : parser/htmlparser/public/nsToken.h => parser/htmlparser/nsToken.h
2014-08-26 07:10:53 -07:00

90 lines
3.2 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef nsIHTMLContentSink_h___
#define nsIHTMLContentSink_h___
/**
* This interface is OBSOLETE and in the process of being REMOVED.
* Do NOT implement!
*
* This file declares the concrete HTMLContentSink class.
* This class is used during the parsing process as the
* primary interface between the parser and the content
* model.
*
* After the tokenizer completes, the parser iterates over
* the known token list. As the parser identifies valid
* elements, it calls the contentsink interface to notify
* the content model that a new node or child node is being
* created and added to the content model.
*
* The HTMLContentSink interface assumes 4 underlying
* containers: HTML, HEAD, BODY and FRAMESET. Before
* accessing any these, the parser will call the appropriate
* OpennsIHTMLContentSink method: OpenHTML,OpenHead,OpenBody,OpenFrameSet;
* likewise, the ClosensIHTMLContentSink version will be called when the
* parser is done with a given section.
*
* IMPORTANT: The parser may Open each container more than
* once! This is due to the irregular nature of HTML files.
* For example, it is possible to encounter plain text at
* the start of an HTML document (that precedes the HTML tag).
* Such text is treated as if it were part of the body.
* In such cases, the parser will Open the body, pass the text-
* node in and then Close the body. The body will likely be
* re-Opened later when the actual <BODY> tag has been seen.
*
* Containers within the body are Opened and Closed
* using the OpenContainer(...) and CloseContainer(...) calls.
* It is assumed that the document or contentSink is
* maintaining its state to manage where new content should
* be added to the underlying document.
*
* NOTE: OpenHTML() and OpenBody() may get called multiple times
* in the same document. That's fine, and it doesn't mean
* that we have multiple bodies or HTML's.
*
* NOTE: I haven't figured out how sub-documents (non-frames)
* are going to be handled. Stay tuned.
*/
#include "nsIContentSink.h"
#include "nsHTMLTags.h"
#define NS_IHTML_CONTENT_SINK_IID \
{0xefc5af86, 0x5cfd, 0x4918, {0x9d, 0xd3, 0x5f, 0x7a, 0xb2, 0x88, 0xb2, 0x68}}
/**
* This interface is OBSOLETE and in the process of being REMOVED.
* Do NOT implement!
*/
class nsIHTMLContentSink : public nsIContentSink
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTML_CONTENT_SINK_IID)
enum ElementType { eHTML, eBody };
/**
* This method is used to open a generic container in the sink.
*
* @update 4/1/98 gess
*/
NS_IMETHOD OpenContainer(ElementType aNodeType) = 0;
/**
* This method gets called by the parser when a close
* container tag has been consumed and needs to be closed.
*
* @param aTag - The tag to be closed.
*/
NS_IMETHOD CloseContainer(ElementType aTag) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLContentSink, NS_IHTML_CONTENT_SINK_IID)
#endif /* nsIHTMLContentSink_h___ */