2 * Copyright (c) 2007 Henri Sivonen
3 * Copyright (c) 2007-2011 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__
32 #include "nsHtml5AtomTable.h"
34 #include "nsINameSpaceManager.h"
35 #include "nsIContent.h"
36 #include "nsTraceRefcnt.h"
38 #include "nsHtml5ArrayCopy.h"
39 #include "nsAHtml5TreeBuilderState.h"
40 #include "nsHtml5Atoms.h"
41 #include "nsHtml5ByteReadable.h"
42 #include "nsIUnicodeDecoder.h"
43 #include "nsHtml5Macros.h"
45 #include "nsHtml5Tokenizer.h"
46 #include "nsHtml5TreeBuilder.h"
47 #include "nsHtml5MetaScanner.h"
48 #include "nsHtml5AttributeName.h"
49 #include "nsHtml5ElementName.h"
50 #include "nsHtml5HtmlAttributes.h"
51 #include "nsHtml5UTF16Buffer.h"
52 #include "nsHtml5StateSnapshot.h"
53 #include "nsHtml5Portability.h"
55 #include "nsHtml5StackNode.h"
58 nsHtml5StackNode::getGroup()
60 return flags
& NS_HTML5ELEMENT_NAME_GROUP_MASK
;
64 nsHtml5StackNode::isScoping()
66 return (flags
& NS_HTML5ELEMENT_NAME_SCOPING
);
70 nsHtml5StackNode::isSpecial()
72 return (flags
& NS_HTML5ELEMENT_NAME_SPECIAL
);
76 nsHtml5StackNode::isFosterParenting()
78 return (flags
& NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
);
82 nsHtml5StackNode::isHtmlIntegrationPoint()
84 return (flags
& NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
);
88 nsHtml5StackNode::nsHtml5StackNode(int32_t flags
, int32_t ns
, nsIAtom
* name
, nsIContent
** node
, nsIAtom
* popName
, nsHtml5HtmlAttributes
* attributes
)
94 attributes(attributes
),
97 MOZ_COUNT_CTOR(nsHtml5StackNode
);
101 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
)
102 : flags(elementName
->getFlags()),
103 name(elementName
->name
),
104 popName(elementName
->name
),
105 ns(kNameSpaceID_XHTML
),
110 MOZ_COUNT_CTOR(nsHtml5StackNode
);
111 MOZ_ASSERT(!elementName
->isCustom(), "Don't use this constructor for custom elements.");
115 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsHtml5HtmlAttributes
* attributes
)
116 : flags(elementName
->getFlags()),
117 name(elementName
->name
),
118 popName(elementName
->name
),
119 ns(kNameSpaceID_XHTML
),
121 attributes(attributes
),
124 MOZ_COUNT_CTOR(nsHtml5StackNode
);
125 MOZ_ASSERT(!elementName
->isCustom(), "Don't use this constructor for custom elements.");
129 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsIAtom
* popName
)
130 : flags(elementName
->getFlags()),
131 name(elementName
->name
),
133 ns(kNameSpaceID_XHTML
),
138 MOZ_COUNT_CTOR(nsHtml5StackNode
);
142 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIAtom
* popName
, nsIContent
** node
)
143 : flags(prepareSvgFlags(elementName
->getFlags())),
144 name(elementName
->name
),
146 ns(kNameSpaceID_SVG
),
151 MOZ_COUNT_CTOR(nsHtml5StackNode
);
155 nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName
* elementName
, nsIContent
** node
, nsIAtom
* popName
, bool markAsIntegrationPoint
)
156 : flags(prepareMathFlags(elementName
->getFlags(), markAsIntegrationPoint
)),
157 name(elementName
->name
),
159 ns(kNameSpaceID_MathML
),
164 MOZ_COUNT_CTOR(nsHtml5StackNode
);
168 nsHtml5StackNode::prepareSvgFlags(int32_t flags
)
170 flags
&= ~(NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
| NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
| NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG
);
171 if ((flags
& NS_HTML5ELEMENT_NAME_SCOPING_AS_SVG
)) {
172 flags
|= (NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
| NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
);
178 nsHtml5StackNode::prepareMathFlags(int32_t flags
, bool markAsIntegrationPoint
)
180 flags
&= ~(NS_HTML5ELEMENT_NAME_FOSTER_PARENTING
| NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
| NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG
);
181 if ((flags
& NS_HTML5ELEMENT_NAME_SCOPING_AS_MATHML
)) {
182 flags
|= (NS_HTML5ELEMENT_NAME_SCOPING
| NS_HTML5ELEMENT_NAME_SPECIAL
);
184 if (markAsIntegrationPoint
) {
185 flags
|= NS_HTML5ELEMENT_NAME_HTML_INTEGRATION_POINT
;
191 nsHtml5StackNode::~nsHtml5StackNode()
193 MOZ_COUNT_DTOR(nsHtml5StackNode
);
198 nsHtml5StackNode::dropAttributes()
200 attributes
= nullptr;
204 nsHtml5StackNode::retain()
210 nsHtml5StackNode::release()
219 nsHtml5StackNode::initializeStatics()
224 nsHtml5StackNode::releaseStatics()