Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines
nsIHTMLContentSink.h File Reference
#include "nsIParserNode.h"
#include "nsIContentSink.h"
#include "nsHTMLTags.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  nsIHTMLContentSink


#define NS_IHTML_CONTENT_SINK_IID   { 0x59929de5, 0xe60b, 0x48b1,{0x81, 0x69, 0x48, 0x47, 0xb5, 0xc9, 0x44, 0x29}}
 MODULE NOTES: gess 4/1/98.
#define MAX_REFLOW_DEPTH   200

Define Documentation

Definition at line 96 of file nsIHTMLContentSink.h.

#define NS_IHTML_CONTENT_SINK_IID   { 0x59929de5, 0xe60b, 0x48b1,{0x81, 0x69, 0x48, 0x47, 0xb5, 0xc9, 0x44, 0x29}}

MODULE NOTES: gess 4/1/98.

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 preceeds 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.

Definition at line 88 of file nsIHTMLContentSink.h.