Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / parser / htmlparser / nsIHTMLContentSink.h
blob3e81d5d77090ce30025cea0f2036a64facc20e98
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsIHTMLContentSink_h___
6 #define nsIHTMLContentSink_h___
8 /**
9 * This interface is OBSOLETE and in the process of being REMOVED.
10 * Do NOT implement!
12 * This file declares the concrete HTMLContentSink class.
13 * This class is used during the parsing process as the
14 * primary interface between the parser and the content
15 * model.
17 * After the tokenizer completes, the parser iterates over
18 * the known token list. As the parser identifies valid
19 * elements, it calls the contentsink interface to notify
20 * the content model that a new node or child node is being
21 * created and added to the content model.
23 * The HTMLContentSink interface assumes 4 underlying
24 * containers: HTML, HEAD, BODY and FRAMESET. Before
25 * accessing any these, the parser will call the appropriate
26 * OpennsIHTMLContentSink method: OpenHTML,OpenHead,OpenBody,OpenFrameSet;
27 * likewise, the ClosensIHTMLContentSink version will be called when the
28 * parser is done with a given section.
30 * IMPORTANT: The parser may Open each container more than
31 * once! This is due to the irregular nature of HTML files.
32 * For example, it is possible to encounter plain text at
33 * the start of an HTML document (that precedes the HTML tag).
34 * Such text is treated as if it were part of the body.
35 * In such cases, the parser will Open the body, pass the text-
36 * node in and then Close the body. The body will likely be
37 * re-Opened later when the actual <BODY> tag has been seen.
39 * Containers within the body are Opened and Closed
40 * using the OpenContainer(...) and CloseContainer(...) calls.
41 * It is assumed that the document or contentSink is
42 * maintaining its state to manage where new content should
43 * be added to the underlying document.
45 * NOTE: OpenHTML() and OpenBody() may get called multiple times
46 * in the same document. That's fine, and it doesn't mean
47 * that we have multiple bodies or HTML's.
49 * NOTE: I haven't figured out how sub-documents (non-frames)
50 * are going to be handled. Stay tuned.
52 #include "nsIContentSink.h"
53 #include "nsHTMLTags.h"
55 #define NS_IHTML_CONTENT_SINK_IID \
56 { \
57 0xefc5af86, 0x5cfd, 0x4918, { \
58 0x9d, 0xd3, 0x5f, 0x7a, 0xb2, 0x88, 0xb2, 0x68 \
59 } \
62 /**
63 * This interface is OBSOLETE and in the process of being REMOVED.
64 * Do NOT implement!
66 class nsIHTMLContentSink : public nsIContentSink {
67 public:
68 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTML_CONTENT_SINK_IID)
70 enum ElementType { eHTML, eBody };
72 /**
73 * This method is used to open a generic container in the sink.
75 * @update 4/1/98 gess
77 NS_IMETHOD OpenContainer(ElementType aNodeType) = 0;
79 /**
80 * This method gets called by the parser when a close
81 * container tag has been consumed and needs to be closed.
83 * @param aTag - The tag to be closed.
85 NS_IMETHOD CloseContainer(ElementType aTag) = 0;
87 /**
88 * This method returns true if there are more than one
89 * pending style sheets, false otherwise.
91 virtual bool WaitForPendingSheets() = 0;
94 NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLContentSink, NS_IHTML_CONTENT_SINK_IID)
96 #endif /* nsIHTMLContentSink_h___ */