2 * Copyright (c) 2007 Henri Sivonen
3 * Copyright (c) 2007-2009 Mozilla Foundation
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
26 * Please edit StackNode.java instead and regenerate.
29 #define nsHtml5StackNode_cpp__
33 #include "nsHtml5AtomTable.h"
35 #include "nsINameSpaceManager.h"
36 #include "nsIContent.h"
37 #include "nsIDocument.h"
38 #include "nsTraceRefcnt.h"
40 #include "nsHtml5DocumentMode.h"
41 #include "nsHtml5ArrayCopy.h"
42 #include "nsHtml5NamedCharacters.h"
43 #include "nsHtml5NamedCharactersAccel.h"
44 #include "nsHtml5Atoms.h"
45 #include "nsHtml5ByteReadable.h"
46 #include "nsIUnicodeDecoder.h"
47 #include "nsAHtml5TreeBuilderState.h"
48 #include "nsHtml5Macros.h"
50 #include "nsHtml5Tokenizer.h"
51 #include "nsHtml5TreeBuilder.h"
52 #include "nsHtml5MetaScanner.h"
53 #include "nsHtml5AttributeName.h"
54 #include "nsHtml5ElementName.h"
55 #include "nsHtml5HtmlAttributes.h"
56 #include "nsHtml5UTF16Buffer.h"
57 #include "nsHtml5StateSnapshot.h"
58 #include "nsHtml5Portability.h"
60 #include "nsHtml5StackNode.h"
63 nsHtml5StackNode::getGroup()
65 return flags
& NS_HTML5ELEMENT_NAME_GROUP_MASK
;
69 nsHtml5StackNode::isScoping()
71 return (flags
& NS_HTML5ELEMENT_NAME_SCOPING
);
75 nsHtml5StackNode::isSpecial()
77 return (flags
& NS_HTML5ELEMENT_NAME_SPECIAL
);
81 nsHtml5StackNode::isFosterParenting()
83 return (flags
& NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
);
87 nsHtml5StackNode::isHtmlIntegrationPoint()
89 return (flags
& NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
);
93 nsHtml5StackNode::nsHtml5StackNode(PRInt32 flags
, PRInt32 ns
, nsIAtom
* name
, nsIContent
** node
, nsIAtom
* popName
, nsHtml5HtmlAttributes
* attributes
)
99 attributes(attributes
),
102 MOZ_COUNT_CTOR(nsHtml5StackNode
);
106 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
)
107 : flags(elementName
->getFlags()),
108 name(elementName
->name
),
109 popName(elementName
->name
),
110 ns(kNameSpaceID_XHTML
),
115 MOZ_COUNT_CTOR(nsHtml5StackNode
);
120 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsHtml5HtmlAttributes
* attributes
)
121 : flags(elementName
->getFlags()),
122 name(elementName
->name
),
123 popName(elementName
->name
),
124 ns(kNameSpaceID_XHTML
),
126 attributes(attributes
),
129 MOZ_COUNT_CTOR(nsHtml5StackNode
);
134 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsIAtom
* popName
)
135 : flags(elementName
->getFlags()),
136 name(elementName
->name
),
138 ns(kNameSpaceID_XHTML
),
143 MOZ_COUNT_CTOR(nsHtml5StackNode
);
147 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIAtom
* popName
, nsIContent
** node
)
148 : flags(prepareSvgFlags(elementName
->getFlags())),
149 name(elementName
->name
),
151 ns(kNameSpaceID_SVG
),
156 MOZ_COUNT_CTOR(nsHtml5StackNode
);
160 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsIAtom
* popName
, PRBool markAsIntegrationPoint
)
161 : flags(prepareMathFlags(elementName
->getFlags(), markAsIntegrationPoint
)),
162 name(elementName
->name
),
164 ns(kNameSpaceID_MathML
),
169 MOZ_COUNT_CTOR(nsHtml5StackNode
);
173 nsHtml5StackNode::prepareSvgFlags(PRInt32 flags
)
175 flags
&= ~(NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
| NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
);
176 if ((flags
& NS_HTML5ELEMENT_NAME_SCOPING_AS_SVG
)) {
177 flags
|= (NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
| NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
);
183 nsHtml5StackNode::prepareMathFlags(PRInt32 flags
, PRBool markAsIntegrationPoint
)
185 flags
&= ~(NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
| NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
);
186 if ((flags
& NS_HTML5ELEMENT_NAME_SCOPING_AS_MATHML
)) {
187 flags
|= (NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
);
189 if (markAsIntegrationPoint
) {
190 flags
|= NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
;
196 nsHtml5StackNode::~nsHtml5StackNode()
198 MOZ_COUNT_DTOR(nsHtml5StackNode
);
203 nsHtml5StackNode::dropAttributes()
209 nsHtml5StackNode::retain()
215 nsHtml5StackNode::release()
224 nsHtml5StackNode::initializeStatics()
229 nsHtml5StackNode::releaseStatics()