2009-06-28 22:44:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Henri Sivonen
|
2015-08-25 15:05:46 +00:00
|
|
|
* Copyright (c) 2007-2015 Mozilla Foundation
|
2013-03-26 07:15:23 +00:00
|
|
|
* Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
|
2009-06-28 22:44:22 +00:00
|
|
|
* Foundation, and Opera Software ASA.
|
|
|
|
*
|
2013-03-26 07:15:23 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
2009-06-28 22:44:22 +00:00
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
2013-03-26 07:15:23 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
2009-06-28 22:44:22 +00:00
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
2013-03-26 07:15:23 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
2009-06-28 22:44:22 +00:00
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
|
|
|
* Please edit TreeBuilder.java instead and regenerate.
|
|
|
|
*/
|
|
|
|
|
2013-08-23 15:07:10 +00:00
|
|
|
#ifndef nsHtml5TreeBuilder_h
|
|
|
|
#define nsHtml5TreeBuilder_h
|
2009-06-28 22:44:22 +00:00
|
|
|
|
2014-03-05 19:38:50 +00:00
|
|
|
#include "nsContentUtils.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
#include "nsIAtom.h"
|
2009-09-21 13:18:20 +00:00
|
|
|
#include "nsHtml5AtomTable.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
#include "nsITimer.h"
|
|
|
|
#include "nsString.h"
|
2014-02-27 23:04:46 +00:00
|
|
|
#include "nsNameSpaceManager.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
#include "nsIContent.h"
|
2014-03-05 19:38:49 +00:00
|
|
|
#include "nsTraceRefcnt.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
#include "jArray.h"
|
|
|
|
#include "nsHtml5DocumentMode.h"
|
|
|
|
#include "nsHtml5ArrayCopy.h"
|
|
|
|
#include "nsHtml5Parser.h"
|
|
|
|
#include "nsHtml5Atoms.h"
|
|
|
|
#include "nsHtml5TreeOperation.h"
|
|
|
|
#include "nsHtml5StateSnapshot.h"
|
|
|
|
#include "nsHtml5StackNode.h"
|
2009-09-18 09:21:47 +00:00
|
|
|
#include "nsHtml5TreeOpExecutor.h"
|
|
|
|
#include "nsHtml5StreamParser.h"
|
2009-09-21 13:18:20 +00:00
|
|
|
#include "nsAHtml5TreeBuilderState.h"
|
2011-11-01 11:33:11 +00:00
|
|
|
#include "nsHtml5Highlighter.h"
|
2013-03-07 04:45:08 +00:00
|
|
|
#include "nsHtml5PlainTextUtils.h"
|
2011-11-30 17:44:31 +00:00
|
|
|
#include "nsHtml5ViewSourceUtils.h"
|
2012-11-09 09:04:28 +00:00
|
|
|
#include "mozilla/Likely.h"
|
2014-03-05 19:38:49 +00:00
|
|
|
#include "nsIContentHandle.h"
|
2014-03-05 19:38:50 +00:00
|
|
|
#include "nsHtml5OplessBuilder.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
|
2009-09-18 09:21:47 +00:00
|
|
|
class nsHtml5StreamParser;
|
2009-06-28 22:44:22 +00:00
|
|
|
|
|
|
|
class nsHtml5Tokenizer;
|
|
|
|
class nsHtml5MetaScanner;
|
|
|
|
class nsHtml5AttributeName;
|
|
|
|
class nsHtml5ElementName;
|
|
|
|
class nsHtml5HtmlAttributes;
|
|
|
|
class nsHtml5UTF16Buffer;
|
|
|
|
class nsHtml5StateSnapshot;
|
|
|
|
class nsHtml5Portability;
|
|
|
|
|
|
|
|
|
2009-09-21 13:18:20 +00:00
|
|
|
class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
2009-06-28 22:44:22 +00:00
|
|
|
{
|
|
|
|
private:
|
2014-01-04 15:02:17 +00:00
|
|
|
static char16_t REPLACEMENT_CHARACTER[];
|
2012-08-22 15:56:38 +00:00
|
|
|
static staticJArray<const char*,int32_t> QUIRKY_PUBLIC_IDS;
|
|
|
|
int32_t mode;
|
|
|
|
int32_t originalMode;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool framesetOk;
|
2009-06-28 22:44:22 +00:00
|
|
|
protected:
|
|
|
|
nsHtml5Tokenizer* tokenizer;
|
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool scriptingEnabled;
|
|
|
|
bool needToDropLF;
|
|
|
|
bool fragment;
|
2009-06-28 22:44:22 +00:00
|
|
|
nsIAtom* contextName;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t contextNamespace;
|
2014-03-05 19:38:49 +00:00
|
|
|
nsIContentHandle* contextNode;
|
2013-03-26 07:15:23 +00:00
|
|
|
autoJArray<int32_t,int32_t> templateModeStack;
|
|
|
|
int32_t templateModePtr;
|
2012-08-22 15:56:38 +00:00
|
|
|
autoJArray<nsHtml5StackNode*,int32_t> stack;
|
|
|
|
int32_t currentPtr;
|
|
|
|
autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
|
|
|
|
int32_t listPtr;
|
2014-03-05 19:38:49 +00:00
|
|
|
nsIContentHandle* formPointer;
|
|
|
|
nsIContentHandle* headPointer;
|
|
|
|
nsIContentHandle* deepTreeSurrogateParent;
|
2009-06-28 22:44:22 +00:00
|
|
|
protected:
|
2014-01-04 15:02:17 +00:00
|
|
|
autoJArray<char16_t,int32_t> charBuffer;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t charBufferLen;
|
2009-06-28 22:44:22 +00:00
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool quirks;
|
2013-06-29 03:13:23 +00:00
|
|
|
bool isSrcdocDocument;
|
2009-06-28 22:44:22 +00:00
|
|
|
public:
|
|
|
|
void startTokenization(nsHtml5Tokenizer* self);
|
2011-09-29 06:19:26 +00:00
|
|
|
void doctype(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier, bool forceQuirks);
|
2014-01-04 15:02:17 +00:00
|
|
|
void comment(char16_t* buf, int32_t start, int32_t length);
|
|
|
|
void characters(const char16_t* buf, int32_t start, int32_t length);
|
2010-06-09 06:45:32 +00:00
|
|
|
void zeroOriginatingReplacementCharacter();
|
2009-06-28 22:44:22 +00:00
|
|
|
void eof();
|
|
|
|
void endTokenization();
|
2011-09-29 06:19:26 +00:00
|
|
|
void startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, bool selfClosing);
|
2010-09-15 08:37:55 +00:00
|
|
|
private:
|
2013-08-12 21:46:12 +00:00
|
|
|
void startTagTitleInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
2013-03-26 07:15:23 +00:00
|
|
|
void startTagGenericRawText(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void startTagScriptInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void startTagTemplateInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
bool isTemplateContents();
|
2013-08-12 21:46:12 +00:00
|
|
|
bool isTemplateModeStackEmpty();
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isSpecialParentInForeign(nsHtml5StackNode* stackNode);
|
2010-09-15 08:37:55 +00:00
|
|
|
public:
|
2015-08-25 15:05:46 +00:00
|
|
|
static nsString* extractCharsetFromContent(nsString* attributeValue, nsHtml5TreeBuilder* tb);
|
2009-06-28 22:44:22 +00:00
|
|
|
private:
|
|
|
|
void checkMetaCharset(nsHtml5HtmlAttributes* attributes);
|
|
|
|
public:
|
|
|
|
void endTag(nsHtml5ElementName* elementName);
|
|
|
|
private:
|
2013-08-12 21:46:12 +00:00
|
|
|
void endTagTemplateInHead();
|
2013-03-26 07:15:23 +00:00
|
|
|
int32_t findLastInTableScopeOrRootTemplateTbodyTheadTfoot();
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t findLast(nsIAtom* name);
|
|
|
|
int32_t findLastInTableScope(nsIAtom* name);
|
|
|
|
int32_t findLastInButtonScope(nsIAtom* name);
|
|
|
|
int32_t findLastInScope(nsIAtom* name);
|
|
|
|
int32_t findLastInListScope(nsIAtom* name);
|
|
|
|
int32_t findLastInScopeHn();
|
2009-06-28 22:44:22 +00:00
|
|
|
void generateImpliedEndTagsExceptFor(nsIAtom* name);
|
|
|
|
void generateImpliedEndTags();
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isSecondOnStackBody();
|
|
|
|
void documentModeInternal(nsHtml5DocumentMode m, nsString* publicIdentifier, nsString* systemIdentifier, bool html4SpecificAdditionalErrorChecks);
|
|
|
|
bool isAlmostStandards(nsString* publicIdentifier, nsString* systemIdentifier);
|
|
|
|
bool isQuirky(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier, bool forceQuirks);
|
2012-08-22 15:56:38 +00:00
|
|
|
void closeTheCell(int32_t eltPos);
|
|
|
|
int32_t findLastInTableScopeTdTh();
|
|
|
|
void clearStackBackTo(int32_t eltPos);
|
2009-06-28 22:44:22 +00:00
|
|
|
void resetTheInsertionMode();
|
|
|
|
void implicitlyCloseP();
|
2012-10-01 08:52:32 +00:00
|
|
|
bool debugOnlyClearLastStackSlot();
|
|
|
|
bool debugOnlyClearLastListSlot();
|
2013-03-26 07:15:23 +00:00
|
|
|
void pushTemplateMode(int32_t mode);
|
2009-06-28 22:44:22 +00:00
|
|
|
void push(nsHtml5StackNode* node);
|
2009-12-11 00:27:48 +00:00
|
|
|
void silentPush(nsHtml5StackNode* node);
|
2009-06-28 22:44:22 +00:00
|
|
|
void append(nsHtml5StackNode* node);
|
|
|
|
inline void insertMarker()
|
|
|
|
{
|
2012-07-30 14:20:58 +00:00
|
|
|
append(nullptr);
|
2009-06-28 22:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void clearTheListOfActiveFormattingElementsUpToTheLastMarker();
|
2011-09-29 06:19:26 +00:00
|
|
|
inline bool isCurrent(nsIAtom* name)
|
2009-06-28 22:44:22 +00:00
|
|
|
{
|
2013-08-12 21:46:12 +00:00
|
|
|
return stack[currentPtr]->ns == kNameSpaceID_XHTML && name == stack[currentPtr]->name;
|
2009-06-28 22:44:22 +00:00
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
void removeFromStack(int32_t pos);
|
2009-06-28 22:44:22 +00:00
|
|
|
void removeFromStack(nsHtml5StackNode* node);
|
2012-08-22 15:56:38 +00:00
|
|
|
void removeFromListOfActiveFormattingElements(int32_t pos);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool adoptionAgencyEndTag(nsIAtom* name);
|
2012-08-22 15:56:38 +00:00
|
|
|
void insertIntoStack(nsHtml5StackNode* node, int32_t position);
|
|
|
|
void insertIntoListOfActiveFormattingElements(nsHtml5StackNode* formattingClone, int32_t bookmark);
|
|
|
|
int32_t findInListOfActiveFormattingElements(nsHtml5StackNode* node);
|
|
|
|
int32_t findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(nsIAtom* name);
|
2010-10-15 09:23:42 +00:00
|
|
|
void maybeForgetEarlierDuplicateFormattingElement(nsIAtom* name, nsHtml5HtmlAttributes* attributes);
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t findLastOrRoot(nsIAtom* name);
|
|
|
|
int32_t findLastOrRoot(int32_t group);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool addAttributesToBody(nsHtml5HtmlAttributes* attributes);
|
2009-06-28 22:44:22 +00:00
|
|
|
void addAttributesToHtml(nsHtml5HtmlAttributes* attributes);
|
|
|
|
void pushHeadPointerOntoStack();
|
|
|
|
void reconstructTheActiveFormattingElements();
|
2014-03-05 19:38:49 +00:00
|
|
|
void insertIntoFosterParent(nsIContentHandle* child);
|
2014-11-10 06:50:18 +00:00
|
|
|
nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes);
|
|
|
|
nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isInStack(nsHtml5StackNode* node);
|
2013-03-26 07:15:23 +00:00
|
|
|
void popTemplateMode();
|
2009-06-28 22:44:22 +00:00
|
|
|
void pop();
|
2009-12-11 00:27:48 +00:00
|
|
|
void silentPop();
|
2009-06-28 22:44:22 +00:00
|
|
|
void popOnEof();
|
|
|
|
void appendHtmlElementToDocumentAndPush(nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendHtmlElementToDocumentAndPush();
|
|
|
|
void appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendToCurrentNodeAndPushBodyElement(nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendToCurrentNodeAndPushBodyElement();
|
|
|
|
void appendToCurrentNodeAndPushFormElementMayFoster(nsHtml5HtmlAttributes* attributes);
|
2010-12-09 09:27:58 +00:00
|
|
|
void appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
2011-09-29 06:19:26 +00:00
|
|
|
bool annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attributes);
|
2010-12-09 09:27:58 +00:00
|
|
|
void appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
2014-03-05 19:38:49 +00:00
|
|
|
void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
|
|
|
void appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
2010-12-09 09:27:58 +00:00
|
|
|
void appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
2014-03-05 19:38:49 +00:00
|
|
|
void appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
2009-12-16 14:07:06 +00:00
|
|
|
void appendVoidFormToCurrent(nsHtml5HtmlAttributes* attributes);
|
2009-06-28 22:44:22 +00:00
|
|
|
protected:
|
2014-01-04 15:02:17 +00:00
|
|
|
void accumulateCharacters(const char16_t* buf, int32_t start, int32_t length);
|
2009-06-28 22:44:22 +00:00
|
|
|
void requestSuspension();
|
2014-11-10 06:50:18 +00:00
|
|
|
nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* intendedParent);
|
|
|
|
nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsIContentHandle* intendedParent);
|
2014-03-05 19:38:49 +00:00
|
|
|
nsIContentHandle* createHtmlElementSetAsRoot(nsHtml5HtmlAttributes* attributes);
|
|
|
|
void detachFromParent(nsIContentHandle* element);
|
|
|
|
bool hasChildren(nsIContentHandle* element);
|
|
|
|
void appendElement(nsIContentHandle* child, nsIContentHandle* newParent);
|
|
|
|
void appendChildrenToNewParent(nsIContentHandle* oldParent, nsIContentHandle* newParent);
|
|
|
|
void insertFosterParentedChild(nsIContentHandle* child, nsIContentHandle* table, nsIContentHandle* stackParent);
|
2014-11-10 06:50:18 +00:00
|
|
|
nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsIContentHandle* table, nsIContentHandle* stackParent);
|
|
|
|
;void insertFosterParentedCharacters(char16_t* buf, int32_t start, int32_t length, nsIContentHandle* table, nsIContentHandle* stackParent);
|
2014-03-05 19:38:49 +00:00
|
|
|
void appendCharacters(nsIContentHandle* parent, char16_t* buf, int32_t start, int32_t length);
|
|
|
|
void appendIsindexPrompt(nsIContentHandle* parent);
|
|
|
|
void appendComment(nsIContentHandle* parent, char16_t* buf, int32_t start, int32_t length);
|
2014-01-04 15:02:17 +00:00
|
|
|
void appendCommentToDocument(char16_t* buf, int32_t start, int32_t length);
|
2014-03-05 19:38:49 +00:00
|
|
|
void addAttributesToElement(nsIContentHandle* element, nsHtml5HtmlAttributes* attributes);
|
|
|
|
void markMalformedIfScript(nsIContentHandle* elt);
|
2011-09-29 06:19:26 +00:00
|
|
|
void start(bool fragmentMode);
|
2009-06-28 22:44:22 +00:00
|
|
|
void end();
|
|
|
|
void appendDoctypeToDocument(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier);
|
2014-03-05 19:38:49 +00:00
|
|
|
void elementPushed(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
|
|
|
void elementPopped(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
2009-06-28 22:44:22 +00:00
|
|
|
public:
|
2011-09-29 06:19:26 +00:00
|
|
|
inline bool cdataSectionAllowed()
|
2010-12-09 09:27:58 +00:00
|
|
|
{
|
|
|
|
return isInForeign();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isInForeign();
|
2012-01-02 14:18:29 +00:00
|
|
|
bool isInForeignButNotHtmlOrMathTextIntegrationPoint();
|
2010-12-09 09:27:58 +00:00
|
|
|
public:
|
2014-03-05 19:38:49 +00:00
|
|
|
void setFragmentContext(nsIAtom* context, int32_t ns, nsIContentHandle* node, bool quirks);
|
2009-06-28 22:44:22 +00:00
|
|
|
protected:
|
2014-03-05 19:38:49 +00:00
|
|
|
nsIContentHandle* currentNode();
|
2009-06-28 22:44:22 +00:00
|
|
|
public:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isScriptingEnabled();
|
|
|
|
void setScriptingEnabled(bool scriptingEnabled);
|
2013-06-29 03:13:23 +00:00
|
|
|
void setIsSrcdocDocument(bool isSrcdocDocument);
|
2009-06-28 22:44:22 +00:00
|
|
|
void flushCharacters();
|
2009-09-21 13:18:20 +00:00
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool charBufferContainsNonWhitespace();
|
2009-06-28 22:44:22 +00:00
|
|
|
public:
|
2009-09-21 13:18:20 +00:00
|
|
|
nsAHtml5TreeBuilderState* newSnapshot();
|
2011-09-29 06:19:26 +00:00
|
|
|
bool snapshotMatches(nsAHtml5TreeBuilderState* snapshot);
|
2009-09-21 13:18:20 +00:00
|
|
|
void loadState(nsAHtml5TreeBuilderState* snapshot, nsHtml5AtomTable* interner);
|
|
|
|
private:
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t findInArray(nsHtml5StackNode* node, jArray<nsHtml5StackNode*,int32_t> arr);
|
2009-09-21 13:18:20 +00:00
|
|
|
public:
|
2014-03-05 19:38:49 +00:00
|
|
|
nsIContentHandle* getFormPointer();
|
|
|
|
nsIContentHandle* getHeadPointer();
|
|
|
|
nsIContentHandle* getDeepTreeSurrogateParent();
|
2012-08-22 15:56:38 +00:00
|
|
|
jArray<nsHtml5StackNode*,int32_t> getListOfActiveFormattingElements();
|
|
|
|
jArray<nsHtml5StackNode*,int32_t> getStack();
|
2013-08-12 21:46:12 +00:00
|
|
|
jArray<int32_t,int32_t> getTemplateModeStack();
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t getMode();
|
|
|
|
int32_t getOriginalMode();
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isFramesetOk();
|
|
|
|
bool isNeedToDropLF();
|
|
|
|
bool isQuirks();
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t getListOfActiveFormattingElementsLength();
|
|
|
|
int32_t getStackLength();
|
2013-08-12 21:46:12 +00:00
|
|
|
int32_t getTemplateModeStackLength();
|
2009-06-28 22:44:22 +00:00
|
|
|
static void initializeStatics();
|
|
|
|
static void releaseStatics();
|
|
|
|
|
|
|
|
#include "nsHtml5TreeBuilderHSupplement.h"
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_HTML5TREE_BUILDER_OTHER 0
|
|
|
|
#define NS_HTML5TREE_BUILDER_A 1
|
|
|
|
#define NS_HTML5TREE_BUILDER_BASE 2
|
|
|
|
#define NS_HTML5TREE_BUILDER_BODY 3
|
|
|
|
#define NS_HTML5TREE_BUILDER_BR 4
|
|
|
|
#define NS_HTML5TREE_BUILDER_BUTTON 5
|
|
|
|
#define NS_HTML5TREE_BUILDER_CAPTION 6
|
|
|
|
#define NS_HTML5TREE_BUILDER_COL 7
|
|
|
|
#define NS_HTML5TREE_BUILDER_COLGROUP 8
|
|
|
|
#define NS_HTML5TREE_BUILDER_FORM 9
|
|
|
|
#define NS_HTML5TREE_BUILDER_FRAME 10
|
|
|
|
#define NS_HTML5TREE_BUILDER_FRAMESET 11
|
|
|
|
#define NS_HTML5TREE_BUILDER_IMAGE 12
|
|
|
|
#define NS_HTML5TREE_BUILDER_INPUT 13
|
|
|
|
#define NS_HTML5TREE_BUILDER_ISINDEX 14
|
|
|
|
#define NS_HTML5TREE_BUILDER_LI 15
|
2010-06-11 15:08:13 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND 16
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_MATH 17
|
|
|
|
#define NS_HTML5TREE_BUILDER_META 18
|
|
|
|
#define NS_HTML5TREE_BUILDER_SVG 19
|
|
|
|
#define NS_HTML5TREE_BUILDER_HEAD 20
|
|
|
|
#define NS_HTML5TREE_BUILDER_HR 22
|
|
|
|
#define NS_HTML5TREE_BUILDER_HTML 23
|
|
|
|
#define NS_HTML5TREE_BUILDER_NOBR 24
|
|
|
|
#define NS_HTML5TREE_BUILDER_NOFRAMES 25
|
|
|
|
#define NS_HTML5TREE_BUILDER_NOSCRIPT 26
|
|
|
|
#define NS_HTML5TREE_BUILDER_OPTGROUP 27
|
|
|
|
#define NS_HTML5TREE_BUILDER_OPTION 28
|
|
|
|
#define NS_HTML5TREE_BUILDER_P 29
|
|
|
|
#define NS_HTML5TREE_BUILDER_PLAINTEXT 30
|
|
|
|
#define NS_HTML5TREE_BUILDER_SCRIPT 31
|
|
|
|
#define NS_HTML5TREE_BUILDER_SELECT 32
|
|
|
|
#define NS_HTML5TREE_BUILDER_STYLE 33
|
|
|
|
#define NS_HTML5TREE_BUILDER_TABLE 34
|
|
|
|
#define NS_HTML5TREE_BUILDER_TEXTAREA 35
|
|
|
|
#define NS_HTML5TREE_BUILDER_TITLE 36
|
|
|
|
#define NS_HTML5TREE_BUILDER_TR 37
|
|
|
|
#define NS_HTML5TREE_BUILDER_XMP 38
|
|
|
|
#define NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT 39
|
|
|
|
#define NS_HTML5TREE_BUILDER_TD_OR_TH 40
|
|
|
|
#define NS_HTML5TREE_BUILDER_DD_OR_DT 41
|
|
|
|
#define NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 42
|
|
|
|
#define NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET 43
|
|
|
|
#define NS_HTML5TREE_BUILDER_PRE_OR_LISTING 44
|
|
|
|
#define NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U 45
|
|
|
|
#define NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL 46
|
|
|
|
#define NS_HTML5TREE_BUILDER_IFRAME 47
|
2013-06-06 08:02:30 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_EMBED 48
|
2010-09-15 08:37:55 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_AREA_OR_WBR 49
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU 50
|
2013-01-29 12:31:45 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY 51
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR 52
|
2014-08-19 05:33:45 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_RB_OR_RTC 53
|
2011-01-12 08:05:09 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK 55
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK 56
|
|
|
|
#define NS_HTML5TREE_BUILDER_MI_MO_MN_MS_MTEXT 57
|
|
|
|
#define NS_HTML5TREE_BUILDER_ANNOTATION_XML 58
|
|
|
|
#define NS_HTML5TREE_BUILDER_FOREIGNOBJECT_OR_DESC 59
|
|
|
|
#define NS_HTML5TREE_BUILDER_NOEMBED 60
|
|
|
|
#define NS_HTML5TREE_BUILDER_FIELDSET 61
|
2016-05-26 23:39:03 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_OUTPUT 62
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_OBJECT 63
|
|
|
|
#define NS_HTML5TREE_BUILDER_FONT 64
|
|
|
|
#define NS_HTML5TREE_BUILDER_KEYGEN 65
|
2011-08-06 06:41:36 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_MENUITEM 66
|
2013-03-26 07:15:23 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_TEMPLATE 67
|
2013-06-06 08:02:30 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IMG 68
|
2014-08-19 05:33:45 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_RT_OR_RP 69
|
2012-11-09 09:04:28 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_ROW 0
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_TABLE_BODY 1
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_TABLE 2
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_CAPTION 3
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_CELL 4
|
|
|
|
#define NS_HTML5TREE_BUILDER_FRAMESET_OK 5
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_BODY 6
|
2012-11-09 09:04:28 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_HEAD 7
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT 8
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP 9
|
2012-11-09 09:04:28 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE 10
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_SELECT 11
|
|
|
|
#define NS_HTML5TREE_BUILDER_AFTER_BODY 12
|
|
|
|
#define NS_HTML5TREE_BUILDER_IN_FRAMESET 13
|
|
|
|
#define NS_HTML5TREE_BUILDER_AFTER_FRAMESET 14
|
|
|
|
#define NS_HTML5TREE_BUILDER_INITIAL 15
|
|
|
|
#define NS_HTML5TREE_BUILDER_BEFORE_HTML 16
|
|
|
|
#define NS_HTML5TREE_BUILDER_BEFORE_HEAD 17
|
|
|
|
#define NS_HTML5TREE_BUILDER_AFTER_HEAD 18
|
|
|
|
#define NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY 19
|
|
|
|
#define NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET 20
|
|
|
|
#define NS_HTML5TREE_BUILDER_TEXT 21
|
2013-08-12 21:46:12 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_IN_TEMPLATE 22
|
2009-06-28 22:44:22 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_INITIAL 0
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_C 1
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_H 2
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_A 3
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_R 4
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_S 5
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_E 6
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_T 7
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_EQUALS 8
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_SINGLE_QUOTED 9
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_DOUBLE_QUOTED 10
|
|
|
|
#define NS_HTML5TREE_BUILDER_CHARSET_UNQUOTED 11
|
2012-09-28 06:57:33 +00:00
|
|
|
#define NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK INT32_MAX
|
2009-06-28 22:44:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|