Bug 788829 - Call SetSizeConstraints even if a popup is not open. r=enndeakin
[gecko.git] / parser / html / nsHtml5StringParser.h
blobacd23bba922a64b3c96f1f33fd1d552d72e0049a
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsHtml5StringParser_h_
6 #define nsHtml5StringParser_h_
8 #include "nsHtml5AtomTable.h"
9 #include "nsParserBase.h"
11 class nsHtml5TreeOpExecutor;
12 class nsHtml5TreeBuilder;
13 class nsHtml5Tokenizer;
14 class nsIContent;
15 class nsIDocument;
17 class nsHtml5StringParser : public nsParserBase
19 public:
21 NS_DECL_ISUPPORTS
23 /**
24 * Constructor for use ONLY by nsContentUtils. Others, please call the
25 * nsContentUtils statics that wrap this.
27 nsHtml5StringParser();
28 virtual ~nsHtml5StringParser();
30 /**
31 * Invoke the fragment parsing algorithm (innerHTML).
32 * DO NOT CALL from outside nsContentUtils.cpp.
34 * @param aSourceBuffer the string being set as innerHTML
35 * @param aTargetNode the target container
36 * @param aContextLocalName local name of context node
37 * @param aContextNamespace namespace of context node
38 * @param aQuirks true to make <table> not close <p>
39 * @param aPreventScriptExecution true to prevent scripts from executing;
40 * don't set to false when parsing into a target node that has been bound
41 * to tree.
43 nsresult ParseFragment(const nsAString& aSourceBuffer,
44 nsIContent* aTargetNode,
45 nsIAtom* aContextLocalName,
46 int32_t aContextNamespace,
47 bool aQuirks,
48 bool aPreventScriptExecution);
50 /**
51 * Parse an entire HTML document from a source string.
52 * DO NOT CALL from outside nsContentUtils.cpp.
55 nsresult ParseDocument(const nsAString& aSourceBuffer,
56 nsIDocument* aTargetDoc,
57 bool aScriptingEnabledForNoscriptParsing);
59 private:
61 void Tokenize(const nsAString& aSourceBuffer,
62 nsIDocument* aDocument,
63 bool aScriptingEnabledForNoscriptParsing);
65 /**
66 * The tree operation executor
68 nsRefPtr<nsHtml5TreeOpExecutor> mExecutor;
70 /**
71 * The HTML5 tree builder
73 const nsAutoPtr<nsHtml5TreeBuilder> mTreeBuilder;
75 /**
76 * The HTML5 tokenizer
78 const nsAutoPtr<nsHtml5Tokenizer> mTokenizer;
80 /**
81 * The scoped atom table
83 nsHtml5AtomTable mAtomTable;
87 #endif // nsHtml5StringParser_h_