mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 959150 part 1 - Represent nodes as void* in the portable part of the parser. r=smaug.
This commit is contained in:
parent
6136d94c75
commit
ccbe381144
@ -44,6 +44,7 @@ EXPORTS += [
|
||||
'nsHtml5UTF16Buffer.h',
|
||||
'nsHtml5UTF16BufferHSupplement.h',
|
||||
'nsHtml5ViewSourceUtils.h',
|
||||
'nsIContentHandle.h',
|
||||
'nsParserUtils.h',
|
||||
]
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef nsAHtml5TreeBuilderState_h
|
||||
#define nsAHtml5TreeBuilderState_h
|
||||
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
/**
|
||||
* Interface for exposing the internal state of the HTML5 tree builder.
|
||||
* For more documentation, please see
|
||||
@ -25,11 +27,11 @@ class nsAHtml5TreeBuilderState {
|
||||
|
||||
virtual int32_t getTemplateModeStackLength() = 0;
|
||||
|
||||
virtual nsIContent** getFormPointer() = 0;
|
||||
virtual nsIContentHandle* getFormPointer() = 0;
|
||||
|
||||
virtual nsIContent** getHeadPointer() = 0;
|
||||
virtual nsIContentHandle* getHeadPointer() = 0;
|
||||
|
||||
virtual nsIContent** getDeepTreeSurrogateParent() = 0;
|
||||
virtual nsIContentHandle* getDeepTreeSurrogateParent() = 0;
|
||||
|
||||
virtual int32_t getMode() = 0;
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -40,6 +40,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -40,6 +40,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -42,6 +42,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -42,6 +42,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
@ -85,7 +86,7 @@ nsHtml5StackNode::isHtmlIntegrationPoint()
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsIContent** node, nsIAtom* popName, nsHtml5HtmlAttributes* attributes)
|
||||
nsHtml5StackNode::nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsIContentHandle* node, nsIAtom* popName, nsHtml5HtmlAttributes* attributes)
|
||||
: flags(flags),
|
||||
name(name),
|
||||
popName(popName),
|
||||
@ -98,7 +99,7 @@ nsHtml5StackNode::nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsI
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node)
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node)
|
||||
: flags(elementName->getFlags()),
|
||||
name(elementName->name),
|
||||
popName(elementName->name),
|
||||
@ -112,7 +113,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent**
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsHtml5HtmlAttributes* attributes)
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsHtml5HtmlAttributes* attributes)
|
||||
: flags(elementName->getFlags()),
|
||||
name(elementName->name),
|
||||
popName(elementName->name),
|
||||
@ -126,7 +127,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent**
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsIAtom* popName)
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName)
|
||||
: flags(elementName->getFlags()),
|
||||
name(elementName->name),
|
||||
popName(popName),
|
||||
@ -139,7 +140,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent**
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContent** node)
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContentHandle* node)
|
||||
: flags(prepareSvgFlags(elementName->getFlags())),
|
||||
name(elementName->name),
|
||||
popName(popName),
|
||||
@ -152,7 +153,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* pop
|
||||
}
|
||||
|
||||
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsIAtom* popName, bool markAsIntegrationPoint)
|
||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName, bool markAsIntegrationPoint)
|
||||
: flags(prepareMathFlags(elementName->getFlags(), markAsIntegrationPoint)),
|
||||
name(elementName->name),
|
||||
popName(popName),
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -42,6 +42,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
@ -63,7 +64,7 @@ class nsHtml5StackNode
|
||||
nsIAtom* name;
|
||||
nsIAtom* popName;
|
||||
int32_t ns;
|
||||
nsIContent** node;
|
||||
nsIContentHandle* node;
|
||||
nsHtml5HtmlAttributes* attributes;
|
||||
private:
|
||||
int32_t refcount;
|
||||
@ -78,12 +79,12 @@ class nsHtml5StackNode
|
||||
bool isSpecial();
|
||||
bool isFosterParenting();
|
||||
bool isHtmlIntegrationPoint();
|
||||
nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsIContent** node, nsIAtom* popName, nsHtml5HtmlAttributes* attributes);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsHtml5HtmlAttributes* attributes);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsIAtom* popName);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContent** node);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContent** node, nsIAtom* popName, bool markAsIntegrationPoint);
|
||||
nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsIContentHandle* node, nsIAtom* popName, nsHtml5HtmlAttributes* attributes);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsHtml5HtmlAttributes* attributes);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContentHandle* node);
|
||||
nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName, bool markAsIntegrationPoint);
|
||||
private:
|
||||
static int32_t prepareSvgFlags(int32_t flags);
|
||||
static int32_t prepareMathFlags(int32_t flags, bool markAsIntegrationPoint);
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -40,6 +40,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
@ -54,7 +55,7 @@
|
||||
#include "nsHtml5StateSnapshot.h"
|
||||
|
||||
|
||||
nsHtml5StateSnapshot::nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContent** formPointer, nsIContent** headPointer, nsIContent** deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks)
|
||||
nsHtml5StateSnapshot::nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContentHandle* formPointer, nsIContentHandle* headPointer, nsIContentHandle* deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks)
|
||||
: stack(stack),
|
||||
listOfActiveFormattingElements(listOfActiveFormattingElements),
|
||||
templateModeStack(templateModeStack),
|
||||
@ -88,19 +89,19 @@ nsHtml5StateSnapshot::getListOfActiveFormattingElements()
|
||||
return listOfActiveFormattingElements;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5StateSnapshot::getFormPointer()
|
||||
{
|
||||
return formPointer;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5StateSnapshot::getHeadPointer()
|
||||
{
|
||||
return headPointer;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5StateSnapshot::getDeepTreeSurrogateParent()
|
||||
{
|
||||
return deepTreeSurrogateParent;
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
@ -60,22 +61,22 @@ class nsHtml5StateSnapshot : public nsAHtml5TreeBuilderState
|
||||
autoJArray<nsHtml5StackNode*,int32_t> stack;
|
||||
autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
|
||||
autoJArray<int32_t,int32_t> templateModeStack;
|
||||
nsIContent** formPointer;
|
||||
nsIContent** headPointer;
|
||||
nsIContent** deepTreeSurrogateParent;
|
||||
nsIContentHandle* formPointer;
|
||||
nsIContentHandle* headPointer;
|
||||
nsIContentHandle* deepTreeSurrogateParent;
|
||||
int32_t mode;
|
||||
int32_t originalMode;
|
||||
bool framesetOk;
|
||||
bool needToDropLF;
|
||||
bool quirks;
|
||||
public:
|
||||
nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContent** formPointer, nsIContent** headPointer, nsIContent** deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks);
|
||||
nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContentHandle* formPointer, nsIContentHandle* headPointer, nsIContentHandle* deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks);
|
||||
jArray<nsHtml5StackNode*,int32_t> getStack();
|
||||
jArray<int32_t,int32_t> getTemplateModeStack();
|
||||
jArray<nsHtml5StackNode*,int32_t> getListOfActiveFormattingElements();
|
||||
nsIContent** getFormPointer();
|
||||
nsIContent** getHeadPointer();
|
||||
nsIContent** getDeepTreeSurrogateParent();
|
||||
nsIContentHandle* getFormPointer();
|
||||
nsIContentHandle* getHeadPointer();
|
||||
nsIContentHandle* getDeepTreeSurrogateParent();
|
||||
int32_t getMode();
|
||||
int32_t getOriginalMode();
|
||||
bool isFramesetOk();
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "nsHtml5AtomTable.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "nsHtml5AtomTable.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
@ -53,6 +53,7 @@
|
||||
#include "nsHtml5PlainTextUtils.h"
|
||||
#include "nsHtml5ViewSourceUtils.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5MetaScanner.h"
|
||||
@ -89,7 +90,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
||||
charBuffer = jArray<char16_t,int32_t>::newJArray(1024);
|
||||
framesetOk = true;
|
||||
if (fragment) {
|
||||
nsIContent** elt;
|
||||
nsIContentHandle* elt;
|
||||
if (contextNode) {
|
||||
elt = contextNode;
|
||||
} else {
|
||||
@ -119,7 +120,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
||||
} else {
|
||||
mode = NS_HTML5TREE_BUILDER_INITIAL;
|
||||
if (tokenizer->isViewingXmlSource()) {
|
||||
nsIContent** elt = createElement(kNameSpaceID_SVG, nsHtml5Atoms::svg, tokenizer->emptyAttributes());
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_SVG, nsHtml5Atoms::svg, tokenizer->emptyAttributes());
|
||||
nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_SVG, nsHtml5Atoms::svg, elt);
|
||||
currentPtr++;
|
||||
stack[currentPtr] = node;
|
||||
@ -3583,7 +3584,7 @@ nsHtml5TreeBuilder::adoptionAgencyEndTag(nsIAtom* name)
|
||||
}
|
||||
MOZ_ASSERT(node == listOfActiveFormattingElements[nodeListPos]);
|
||||
MOZ_ASSERT(node == stack[nodePos]);
|
||||
nsIContent** clone = createElement(kNameSpaceID_XHTML, node->name, node->attributes->cloneAttributes(nullptr));
|
||||
nsIContentHandle* clone = createElement(kNameSpaceID_XHTML, node->name, node->attributes->cloneAttributes(nullptr));
|
||||
nsHtml5StackNode* newNode = new nsHtml5StackNode(node->getFlags(), node->ns, node->name, clone, node->popName, node->attributes);
|
||||
node->dropAttributes();
|
||||
stack[nodePos] = newNode;
|
||||
@ -3604,7 +3605,7 @@ nsHtml5TreeBuilder::adoptionAgencyEndTag(nsIAtom* name)
|
||||
detachFromParent(lastNode->node);
|
||||
appendElement(lastNode->node, commonAncestor->node);
|
||||
}
|
||||
nsIContent** clone = createElement(kNameSpaceID_XHTML, formattingElt->name, formattingElt->attributes->cloneAttributes(nullptr));
|
||||
nsIContentHandle* clone = createElement(kNameSpaceID_XHTML, formattingElt->name, formattingElt->attributes->cloneAttributes(nullptr));
|
||||
nsHtml5StackNode* formattingClone = new nsHtml5StackNode(formattingElt->getFlags(), formattingElt->ns, formattingElt->name, clone, formattingElt->popName, formattingElt->attributes);
|
||||
formattingElt->dropAttributes();
|
||||
appendChildrenToNewParent(furthestBlock->node, clone);
|
||||
@ -3765,7 +3766,7 @@ nsHtml5TreeBuilder::reconstructTheActiveFormattingElements()
|
||||
while (entryPos < listPtr) {
|
||||
entryPos++;
|
||||
nsHtml5StackNode* entry = listOfActiveFormattingElements[entryPos];
|
||||
nsIContent** clone = createElement(kNameSpaceID_XHTML, entry->name, entry->attributes->cloneAttributes(nullptr));
|
||||
nsIContentHandle* clone = createElement(kNameSpaceID_XHTML, entry->name, entry->attributes->cloneAttributes(nullptr));
|
||||
nsHtml5StackNode* entryClone = new nsHtml5StackNode(entry->getFlags(), entry->ns, entry->name, clone, entry->popName, entry->attributes);
|
||||
entry->dropAttributes();
|
||||
nsHtml5StackNode* currentNode = stack[currentPtr];
|
||||
@ -3782,7 +3783,7 @@ nsHtml5TreeBuilder::reconstructTheActiveFormattingElements()
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::insertIntoFosterParent(nsIContent** child)
|
||||
nsHtml5TreeBuilder::insertIntoFosterParent(nsIContentHandle* child)
|
||||
{
|
||||
int32_t tablePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE);
|
||||
int32_t templatePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TEMPLATE);
|
||||
@ -3844,7 +3845,7 @@ nsHtml5TreeBuilder::popOnEof()
|
||||
void
|
||||
nsHtml5TreeBuilder::appendHtmlElementToDocumentAndPush(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createHtmlElementSetAsRoot(attributes);
|
||||
nsIContentHandle* elt = createHtmlElementSetAsRoot(attributes);
|
||||
nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_HTML, elt);
|
||||
push(node);
|
||||
}
|
||||
@ -3858,7 +3859,7 @@ nsHtml5TreeBuilder::appendHtmlElementToDocumentAndPush()
|
||||
void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::head, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::head, attributes);
|
||||
appendElement(elt, stack[currentPtr]->node);
|
||||
headPointer = elt;
|
||||
nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_HEAD, elt);
|
||||
@ -3880,7 +3881,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushBodyElement()
|
||||
void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormElementMayFoster(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::form, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::form, attributes);
|
||||
if (!isTemplateContents()) {
|
||||
formPointer = elt;
|
||||
}
|
||||
@ -3898,7 +3899,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormElementMayFoster(nsHtml5HtmlAt
|
||||
void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -3915,7 +3916,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5
|
||||
void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes);
|
||||
appendElement(elt, stack[currentPtr]->node);
|
||||
if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
|
||||
elt = getDocumentFragmentForTemplate(elt);
|
||||
@ -3928,7 +3929,7 @@ void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->name;
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -3944,7 +3945,7 @@ void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->name;
|
||||
nsIContent** elt = createElement(kNameSpaceID_MathML, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_MathML, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -3974,7 +3975,7 @@ void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->camelCaseName;
|
||||
nsIContent** elt = createElement(kNameSpaceID_SVG, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_SVG, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -3987,9 +3988,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5Element
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContent** form)
|
||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -4002,9 +4003,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementNam
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContent** form)
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -4020,7 +4021,7 @@ void
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->name;
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -4036,7 +4037,7 @@ void
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->camelCaseName;
|
||||
nsIContent** elt = createElement(kNameSpaceID_SVG, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_SVG, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -4052,7 +4053,7 @@ void
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIAtom* popName = elementName->name;
|
||||
nsIContent** elt = createElement(kNameSpaceID_MathML, popName, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_MathML, popName, attributes);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
if (current->isFosterParenting()) {
|
||||
|
||||
@ -4065,9 +4066,9 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContent** form)
|
||||
nsHtml5TreeBuilder::appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, name, attributes, !form || fragment || isTemplateContents() ? nullptr : form);
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
appendElement(elt, current->node);
|
||||
elementPushed(kNameSpaceID_XHTML, name, elt);
|
||||
@ -4077,7 +4078,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttribu
|
||||
void
|
||||
nsHtml5TreeBuilder::appendVoidFormToCurrent(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsIContent** elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::form, attributes);
|
||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::form, attributes);
|
||||
formPointer = elt;
|
||||
nsHtml5StackNode* current = stack[currentPtr];
|
||||
appendElement(elt, current->node);
|
||||
@ -4107,7 +4108,7 @@ nsHtml5TreeBuilder::isInForeignButNotHtmlOrMathTextIntegrationPoint()
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::setFragmentContext(nsIAtom* context, int32_t ns, nsIContent** node, bool quirks)
|
||||
nsHtml5TreeBuilder::setFragmentContext(nsIAtom* context, int32_t ns, nsIContentHandle* node, bool quirks)
|
||||
{
|
||||
this->contextName = context;
|
||||
this->contextNamespace = ns;
|
||||
@ -4116,7 +4117,7 @@ nsHtml5TreeBuilder::setFragmentContext(nsIAtom* context, int32_t ns, nsIContent*
|
||||
this->quirks = quirks;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::currentNode()
|
||||
{
|
||||
return stack[currentPtr]->node;
|
||||
@ -4325,19 +4326,19 @@ nsHtml5TreeBuilder::findInArray(nsHtml5StackNode* node, jArray<nsHtml5StackNode*
|
||||
return -1;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::getFormPointer()
|
||||
{
|
||||
return formPointer;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::getHeadPointer()
|
||||
{
|
||||
return headPointer;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::getDeepTreeSurrogateParent()
|
||||
{
|
||||
return deepTreeSurrogateParent;
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
@ -54,6 +54,7 @@
|
||||
#include "nsHtml5PlainTextUtils.h"
|
||||
#include "nsHtml5ViewSourceUtils.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
@ -83,16 +84,16 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
||||
bool fragment;
|
||||
nsIAtom* contextName;
|
||||
int32_t contextNamespace;
|
||||
nsIContent** contextNode;
|
||||
nsIContentHandle* contextNode;
|
||||
autoJArray<int32_t,int32_t> templateModeStack;
|
||||
int32_t templateModePtr;
|
||||
autoJArray<nsHtml5StackNode*,int32_t> stack;
|
||||
int32_t currentPtr;
|
||||
autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
|
||||
int32_t listPtr;
|
||||
nsIContent** formPointer;
|
||||
nsIContent** headPointer;
|
||||
nsIContent** deepTreeSurrogateParent;
|
||||
nsIContentHandle* formPointer;
|
||||
nsIContentHandle* headPointer;
|
||||
nsIContentHandle* deepTreeSurrogateParent;
|
||||
protected:
|
||||
autoJArray<char16_t,int32_t> charBuffer;
|
||||
int32_t charBufferLen;
|
||||
@ -174,7 +175,7 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
||||
void addAttributesToHtml(nsHtml5HtmlAttributes* attributes);
|
||||
void pushHeadPointerOntoStack();
|
||||
void reconstructTheActiveFormattingElements();
|
||||
void insertIntoFosterParent(nsIContent** child);
|
||||
void insertIntoFosterParent(nsIContentHandle* child);
|
||||
bool isInStack(nsHtml5StackNode* node);
|
||||
void popTemplateMode();
|
||||
void pop();
|
||||
@ -192,36 +193,36 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
||||
void appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
||||
bool annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attributes);
|
||||
void appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
||||
void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContent** form);
|
||||
void appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContent** form);
|
||||
void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
||||
void appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
||||
void appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
||||
void appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
||||
void appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
|
||||
void appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContent** form);
|
||||
void appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
||||
void appendVoidFormToCurrent(nsHtml5HtmlAttributes* attributes);
|
||||
protected:
|
||||
void accumulateCharacters(const char16_t* buf, int32_t start, int32_t length);
|
||||
void requestSuspension();
|
||||
nsIContent** createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes);
|
||||
nsIContent** createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContent** form);
|
||||
nsIContent** createHtmlElementSetAsRoot(nsHtml5HtmlAttributes* attributes);
|
||||
void detachFromParent(nsIContent** element);
|
||||
bool hasChildren(nsIContent** element);
|
||||
void appendElement(nsIContent** child, nsIContent** newParent);
|
||||
void appendChildrenToNewParent(nsIContent** oldParent, nsIContent** newParent);
|
||||
void insertFosterParentedChild(nsIContent** child, nsIContent** table, nsIContent** stackParent);
|
||||
void insertFosterParentedCharacters(char16_t* buf, int32_t start, int32_t length, nsIContent** table, nsIContent** stackParent);
|
||||
void appendCharacters(nsIContent** parent, char16_t* buf, int32_t start, int32_t length);
|
||||
void appendIsindexPrompt(nsIContent** parent);
|
||||
void appendComment(nsIContent** parent, char16_t* buf, int32_t start, int32_t length);
|
||||
nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes);
|
||||
nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
|
||||
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);
|
||||
void insertFosterParentedCharacters(char16_t* buf, int32_t start, int32_t length, nsIContentHandle* table, nsIContentHandle* stackParent);
|
||||
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);
|
||||
void appendCommentToDocument(char16_t* buf, int32_t start, int32_t length);
|
||||
void addAttributesToElement(nsIContent** element, nsHtml5HtmlAttributes* attributes);
|
||||
void markMalformedIfScript(nsIContent** elt);
|
||||
void addAttributesToElement(nsIContentHandle* element, nsHtml5HtmlAttributes* attributes);
|
||||
void markMalformedIfScript(nsIContentHandle* elt);
|
||||
void start(bool fragmentMode);
|
||||
void end();
|
||||
void appendDoctypeToDocument(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier);
|
||||
void elementPushed(int32_t ns, nsIAtom* name, nsIContent** node);
|
||||
void elementPopped(int32_t ns, nsIAtom* name, nsIContent** node);
|
||||
void elementPushed(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
||||
void elementPopped(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
||||
public:
|
||||
inline bool cdataSectionAllowed()
|
||||
{
|
||||
@ -232,9 +233,9 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
||||
bool isInForeign();
|
||||
bool isInForeignButNotHtmlOrMathTextIntegrationPoint();
|
||||
public:
|
||||
void setFragmentContext(nsIAtom* context, int32_t ns, nsIContent** node, bool quirks);
|
||||
void setFragmentContext(nsIAtom* context, int32_t ns, nsIContentHandle* node, bool quirks);
|
||||
protected:
|
||||
nsIContent** currentNode();
|
||||
nsIContentHandle* currentNode();
|
||||
public:
|
||||
bool isScriptingEnabled();
|
||||
void setScriptingEnabled(bool scriptingEnabled);
|
||||
@ -249,9 +250,9 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
||||
private:
|
||||
int32_t findInArray(nsHtml5StackNode* node, jArray<nsHtml5StackNode*,int32_t> arr);
|
||||
public:
|
||||
nsIContent** getFormPointer();
|
||||
nsIContent** getHeadPointer();
|
||||
nsIContent** getDeepTreeSurrogateParent();
|
||||
nsIContentHandle* getFormPointer();
|
||||
nsIContentHandle* getHeadPointer();
|
||||
nsIContentHandle* getDeepTreeSurrogateParent();
|
||||
jArray<nsHtml5StackNode*,int32_t> getListOfActiveFormattingElements();
|
||||
jArray<nsHtml5StackNode*,int32_t> getStack();
|
||||
jArray<int32_t,int32_t> getTemplateModeStack();
|
||||
|
@ -41,7 +41,7 @@ nsHtml5TreeBuilder::~nsHtml5TreeBuilder()
|
||||
mOpQueue.Clear();
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5HtmlAttributes* aAttributes)
|
||||
{
|
||||
NS_PRECONDITION(aAttributes, "Got null attributes.");
|
||||
@ -51,7 +51,7 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5Htm
|
||||
aNamespace == kNameSpaceID_MathML,
|
||||
"Bogus namespace.");
|
||||
|
||||
nsIContent** content = AllocateContentHandle();
|
||||
nsIContentHandle* content = AllocateContentHandle();
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(aNamespace,
|
||||
@ -209,10 +209,10 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5Htm
|
||||
return content;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5HtmlAttributes* aAttributes, nsIContent** aFormElement)
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5HtmlAttributes* aAttributes, nsIContentHandle* aFormElement)
|
||||
{
|
||||
nsIContent** content = createElement(aNamespace, aName, aAttributes);
|
||||
nsIContentHandle* content = createElement(aNamespace, aName, aAttributes);
|
||||
if (aFormElement) {
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
@ -221,10 +221,10 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, nsHtml5Htm
|
||||
return content;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::createHtmlElementSetAsRoot(nsHtml5HtmlAttributes* aAttributes)
|
||||
{
|
||||
nsIContent** content = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::html, aAttributes);
|
||||
nsIContentHandle* content = createElement(kNameSpaceID_XHTML, nsHtml5Atoms::html, aAttributes);
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(eTreeOpAppendToDocument, content);
|
||||
@ -232,7 +232,7 @@ nsHtml5TreeBuilder::createHtmlElementSetAsRoot(nsHtml5HtmlAttributes* aAttribute
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::detachFromParent(nsIContent** aElement)
|
||||
nsHtml5TreeBuilder::detachFromParent(nsIContentHandle* aElement)
|
||||
{
|
||||
NS_PRECONDITION(aElement, "Null element");
|
||||
|
||||
@ -242,7 +242,7 @@ nsHtml5TreeBuilder::detachFromParent(nsIContent** aElement)
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendElement(nsIContent** aChild, nsIContent** aParent)
|
||||
nsHtml5TreeBuilder::appendElement(nsIContentHandle* aChild, nsIContentHandle* aParent)
|
||||
{
|
||||
NS_PRECONDITION(aChild, "Null child");
|
||||
NS_PRECONDITION(aParent, "Null parent");
|
||||
@ -255,7 +255,7 @@ nsHtml5TreeBuilder::appendElement(nsIContent** aChild, nsIContent** aParent)
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendChildrenToNewParent(nsIContent** aOldParent, nsIContent** aNewParent)
|
||||
nsHtml5TreeBuilder::appendChildrenToNewParent(nsIContentHandle* aOldParent, nsIContentHandle* aNewParent)
|
||||
{
|
||||
NS_PRECONDITION(aOldParent, "Null old parent");
|
||||
NS_PRECONDITION(aNewParent, "Null new parent");
|
||||
@ -266,7 +266,7 @@ nsHtml5TreeBuilder::appendChildrenToNewParent(nsIContent** aOldParent, nsIConten
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::insertFosterParentedCharacters(char16_t* aBuffer, int32_t aStart, int32_t aLength, nsIContent** aTable, nsIContent** aStackParent)
|
||||
nsHtml5TreeBuilder::insertFosterParentedCharacters(char16_t* aBuffer, int32_t aStart, int32_t aLength, nsIContentHandle* aTable, nsIContentHandle* aStackParent)
|
||||
{
|
||||
NS_PRECONDITION(aBuffer, "Null buffer");
|
||||
NS_PRECONDITION(aTable, "Null table");
|
||||
@ -281,7 +281,7 @@ nsHtml5TreeBuilder::insertFosterParentedCharacters(char16_t* aBuffer, int32_t aS
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::insertFosterParentedChild(nsIContent** aChild, nsIContent** aTable, nsIContent** aStackParent)
|
||||
nsHtml5TreeBuilder::insertFosterParentedChild(nsIContentHandle* aChild, nsIContentHandle* aTable, nsIContentHandle* aStackParent)
|
||||
{
|
||||
NS_PRECONDITION(aChild, "Null child");
|
||||
NS_PRECONDITION(aTable, "Null table");
|
||||
@ -293,7 +293,7 @@ nsHtml5TreeBuilder::insertFosterParentedChild(nsIContent** aChild, nsIContent**
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendCharacters(nsIContent** aParent, char16_t* aBuffer, int32_t aStart, int32_t aLength)
|
||||
nsHtml5TreeBuilder::appendCharacters(nsIContentHandle* aParent, char16_t* aBuffer, int32_t aStart, int32_t aLength)
|
||||
{
|
||||
NS_PRECONDITION(aBuffer, "Null buffer");
|
||||
NS_PRECONDITION(aParent, "Null parent");
|
||||
@ -308,7 +308,7 @@ nsHtml5TreeBuilder::appendCharacters(nsIContent** aParent, char16_t* aBuffer, in
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendIsindexPrompt(nsIContent** aParent)
|
||||
nsHtml5TreeBuilder::appendIsindexPrompt(nsIContentHandle* aParent)
|
||||
{
|
||||
NS_PRECONDITION(aParent, "Null parent");
|
||||
|
||||
@ -318,7 +318,7 @@ nsHtml5TreeBuilder::appendIsindexPrompt(nsIContent** aParent)
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::appendComment(nsIContent** aParent, char16_t* aBuffer, int32_t aStart, int32_t aLength)
|
||||
nsHtml5TreeBuilder::appendComment(nsIContentHandle* aParent, char16_t* aBuffer, int32_t aStart, int32_t aLength)
|
||||
{
|
||||
NS_PRECONDITION(aBuffer, "Null buffer");
|
||||
NS_PRECONDITION(aParent, "Null parent");
|
||||
@ -348,7 +348,7 @@ nsHtml5TreeBuilder::appendCommentToDocument(char16_t* aBuffer, int32_t aStart, i
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::addAttributesToElement(nsIContent** aElement, nsHtml5HtmlAttributes* aAttributes)
|
||||
nsHtml5TreeBuilder::addAttributesToElement(nsIContentHandle* aElement, nsHtml5HtmlAttributes* aAttributes)
|
||||
{
|
||||
NS_PRECONDITION(aElement, "Null element");
|
||||
NS_PRECONDITION(aAttributes, "Null attributes");
|
||||
@ -362,7 +362,7 @@ nsHtml5TreeBuilder::addAttributesToElement(nsIContent** aElement, nsHtml5HtmlAtt
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::markMalformedIfScript(nsIContent** aElement)
|
||||
nsHtml5TreeBuilder::markMalformedIfScript(nsIContentHandle* aElement)
|
||||
{
|
||||
NS_PRECONDITION(aElement, "Null element");
|
||||
|
||||
@ -403,7 +403,7 @@ nsHtml5TreeBuilder::appendDoctypeToDocument(nsIAtom* aName, nsString* aPublicId,
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::elementPushed(int32_t aNamespace, nsIAtom* aName, nsIContent** aElement)
|
||||
nsHtml5TreeBuilder::elementPushed(int32_t aNamespace, nsIAtom* aName, nsIContentHandle* aElement)
|
||||
{
|
||||
NS_ASSERTION(aNamespace == kNameSpaceID_XHTML || aNamespace == kNameSpaceID_SVG || aNamespace == kNameSpaceID_MathML, "Element isn't HTML, SVG or MathML!");
|
||||
NS_ASSERTION(aName, "Element doesn't have local name!");
|
||||
@ -467,7 +467,7 @@ nsHtml5TreeBuilder::elementPushed(int32_t aNamespace, nsIAtom* aName, nsIContent
|
||||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsIAtom* aName, nsIContent** aElement)
|
||||
nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsIAtom* aName, nsIContentHandle* aElement)
|
||||
{
|
||||
NS_ASSERTION(aNamespace == kNameSpaceID_XHTML || aNamespace == kNameSpaceID_SVG || aNamespace == kNameSpaceID_MathML, "Element isn't HTML, SVG or MathML!");
|
||||
NS_ASSERTION(aName, "Element doesn't have local name!");
|
||||
@ -568,7 +568,7 @@ nsHtml5TreeBuilder::accumulateCharacters(const char16_t* aBuf, int32_t aStart, i
|
||||
charBufferLen = newFillLen;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::AllocateContentHandle()
|
||||
{
|
||||
if (mHandlesUsed == NS_HTML5_TREE_BUILDER_HANDLE_ARRAY_LENGTH) {
|
||||
@ -751,18 +751,18 @@ nsHtml5TreeBuilder::documentMode(nsHtml5DocumentMode m)
|
||||
treeOp->Init(m);
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsHtml5TreeBuilder::getDocumentFragmentForTemplate(nsIContent** aTemplate)
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::getDocumentFragmentForTemplate(nsIContentHandle* aTemplate)
|
||||
{
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
nsIContent** fragHandle = AllocateContentHandle();
|
||||
nsIContentHandle* fragHandle = AllocateContentHandle();
|
||||
treeOp->Init(eTreeOpGetDocumentFragmentForTemplate, aTemplate, fragHandle);
|
||||
return fragHandle;
|
||||
}
|
||||
|
||||
nsIContent**
|
||||
nsHtml5TreeBuilder::getFormPointerForContext(nsIContent** aContext)
|
||||
nsIContentHandle*
|
||||
nsHtml5TreeBuilder::getFormPointerForContext(nsIContentHandle* aContext)
|
||||
{
|
||||
if (!aContext) {
|
||||
return nullptr;
|
||||
@ -772,7 +772,7 @@ nsHtml5TreeBuilder::getFormPointerForContext(nsIContent** aContext)
|
||||
|
||||
// aContext must always be a handle to an element that already exists
|
||||
// in the document. It must never be an empty handle.
|
||||
nsIContent* contextNode = *aContext;
|
||||
nsIContent* contextNode = *(static_cast<nsIContent**>(aContext));
|
||||
nsIContent* currentAncestor = contextNode;
|
||||
|
||||
// We traverse the ancestors of the context node to find the nearest
|
||||
@ -790,8 +790,8 @@ nsHtml5TreeBuilder::getFormPointerForContext(nsIContent** aContext)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIContent** formPointer = AllocateContentHandle();
|
||||
*formPointer = nearestForm;
|
||||
nsIContentHandle* formPointer = AllocateContentHandle();
|
||||
*(static_cast<nsIContent**>(formPointer)) = nearestForm;
|
||||
return formPointer;
|
||||
}
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
||||
*/
|
||||
void documentMode(nsHtml5DocumentMode m);
|
||||
|
||||
nsIContent** getDocumentFragmentForTemplate(nsIContent** aTemplate);
|
||||
nsIContentHandle* getDocumentFragmentForTemplate(nsIContentHandle* aTemplate);
|
||||
|
||||
nsIContent** getFormPointerForContext(nsIContent** aContext);
|
||||
nsIContentHandle* getFormPointerForContext(nsIContentHandle* aContext);
|
||||
|
||||
/**
|
||||
* Using nsIContent** instead of nsIContent* is the parser deals with DOM
|
||||
@ -49,11 +49,11 @@
|
||||
* run before tree ops that try to further operate on the node that the
|
||||
* nsIContent** is a handle to.
|
||||
*
|
||||
* On-the-main-thread parts of the parser use the same mechanism in order
|
||||
* to avoid having to have duplicate code paths for on-the-main-thread and
|
||||
* off-the-main-thread tree builder instances.)
|
||||
* On-the-main-thread parts of the parser use nsIContent* instead of
|
||||
* nsIContent**. Since both cases share the same parser core, the parser
|
||||
* core casts both to nsIContentHandle*.
|
||||
*/
|
||||
nsIContent** AllocateContentHandle();
|
||||
nsIContentHandle* AllocateContentHandle();
|
||||
|
||||
void accumulateCharactersForced(const char16_t* aBuf, int32_t aStart, int32_t aLength)
|
||||
{
|
||||
|
@ -98,24 +98,24 @@ class nsHtml5TreeOperation {
|
||||
mOpCode = aOpCode;
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode, nsIContent** aNode) {
|
||||
inline void Init(eHtml5TreeOperation aOpCode, nsIContentHandle* aNode) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aNode;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
nsIContent** aNode,
|
||||
nsIContent** aParent) {
|
||||
nsIContentHandle* aNode,
|
||||
nsIContentHandle* aParent) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
NS_PRECONDITION(aParent, "Initialized tree op with null parent.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aNode;
|
||||
mTwo.node = aParent;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mTwo.node = static_cast<nsIContent**>(aParent);
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
@ -146,18 +146,18 @@ class nsHtml5TreeOperation {
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
nsIContent** aNode,
|
||||
nsIContent** aParent,
|
||||
nsIContent** aTable) {
|
||||
nsIContentHandle* aNode,
|
||||
nsIContentHandle* aParent,
|
||||
nsIContentHandle* aTable) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
NS_PRECONDITION(aParent, "Initialized tree op with null parent.");
|
||||
NS_PRECONDITION(aTable, "Initialized tree op with null table.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aNode;
|
||||
mTwo.node = aParent;
|
||||
mThree.node = aTable;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mTwo.node = static_cast<nsIContent**>(aParent);
|
||||
mThree.node = static_cast<nsIContent**>(aTable);
|
||||
}
|
||||
|
||||
inline void Init(nsHtml5DocumentMode aMode) {
|
||||
@ -167,19 +167,19 @@ class nsHtml5TreeOperation {
|
||||
mOne.mode = aMode;
|
||||
}
|
||||
|
||||
inline void InitScript(nsIContent** aNode) {
|
||||
inline void InitScript(nsIContentHandle* aNode) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
mOpCode = eTreeOpRunScript;
|
||||
mOne.node = aNode;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mTwo.state = nullptr;
|
||||
}
|
||||
|
||||
inline void Init(int32_t aNamespace,
|
||||
nsIAtom* aName,
|
||||
nsHtml5HtmlAttributes* aAttributes,
|
||||
nsIContent** aTarget,
|
||||
nsIContentHandle* aTarget,
|
||||
bool aFromNetwork) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
@ -189,7 +189,7 @@ class nsHtml5TreeOperation {
|
||||
eTreeOpCreateElementNetwork :
|
||||
eTreeOpCreateElementNotNetwork;
|
||||
mFour.integer = aNamespace;
|
||||
mOne.node = aTarget;
|
||||
mOne.node = static_cast<nsIContent**>(aTarget);
|
||||
mTwo.atom = aName;
|
||||
if (aAttributes == nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES) {
|
||||
mThree.attributes = nullptr;
|
||||
@ -201,27 +201,27 @@ class nsHtml5TreeOperation {
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
char16_t* aBuffer,
|
||||
int32_t aLength,
|
||||
nsIContent** aStackParent,
|
||||
nsIContent** aTable) {
|
||||
nsIContentHandle* aStackParent,
|
||||
nsIContentHandle* aTable) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aBuffer, "Initialized tree op with null buffer.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aStackParent;
|
||||
mOne.node = static_cast<nsIContent**>(aStackParent);
|
||||
mTwo.unicharPtr = aBuffer;
|
||||
mThree.node = aTable;
|
||||
mThree.node = static_cast<nsIContent**>(aTable);
|
||||
mFour.integer = aLength;
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
char16_t* aBuffer,
|
||||
int32_t aLength,
|
||||
nsIContent** aParent) {
|
||||
nsIContentHandle* aParent) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aBuffer, "Initialized tree op with null buffer.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aParent;
|
||||
mOne.node = static_cast<nsIContent**>(aParent);
|
||||
mTwo.unicharPtr = aBuffer;
|
||||
mFour.integer = aLength;
|
||||
}
|
||||
@ -237,13 +237,13 @@ class nsHtml5TreeOperation {
|
||||
mFour.integer = aLength;
|
||||
}
|
||||
|
||||
inline void Init(nsIContent** aElement,
|
||||
inline void Init(nsIContentHandle* aElement,
|
||||
nsHtml5HtmlAttributes* aAttributes) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aElement, "Initialized tree op with null element.");
|
||||
mOpCode = eTreeOpAddAttributes;
|
||||
mOne.node = aElement;
|
||||
mOne.node = static_cast<nsIContent**>(aElement);
|
||||
mTwo.attributes = aAttributes;
|
||||
}
|
||||
|
||||
@ -257,26 +257,26 @@ class nsHtml5TreeOperation {
|
||||
mTwo.stringPair = new nsHtml5TreeOperationStringPair(aPublicId, aSystemId);
|
||||
}
|
||||
|
||||
inline void Init(nsIContent** aElement,
|
||||
inline void Init(nsIContentHandle* aElement,
|
||||
const char* aMsgId,
|
||||
nsIAtom* aAtom,
|
||||
nsIAtom* aOtherAtom) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
mOpCode = eTreeOpAddError;
|
||||
mOne.node = aElement;
|
||||
mOne.node = static_cast<nsIContent**>(aElement);
|
||||
mTwo.charPtr = (char*)aMsgId;
|
||||
mThree.atom = aAtom;
|
||||
mFour.atom = aOtherAtom;
|
||||
}
|
||||
|
||||
inline void Init(nsIContent** aElement,
|
||||
inline void Init(nsIContentHandle* aElement,
|
||||
const char* aMsgId,
|
||||
nsIAtom* aAtom) {
|
||||
Init(aElement, aMsgId, aAtom, nullptr);
|
||||
}
|
||||
|
||||
inline void Init(nsIContent** aElement,
|
||||
inline void Init(nsIContentHandle* aElement,
|
||||
const char* aMsgId) {
|
||||
Init(aElement, aMsgId, nullptr, nullptr);
|
||||
}
|
||||
@ -302,28 +302,28 @@ class nsHtml5TreeOperation {
|
||||
}
|
||||
|
||||
inline void Init(eHtml5TreeOperation aOpCode,
|
||||
nsIContent** aNode,
|
||||
nsIContentHandle* aNode,
|
||||
int32_t aInt) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
mOpCode = aOpCode;
|
||||
mOne.node = aNode;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mFour.integer = aInt;
|
||||
}
|
||||
|
||||
inline void InitAddClass(nsIContent** aNode, const char16_t* aClass) {
|
||||
inline void InitAddClass(nsIContentHandle* aNode, const char16_t* aClass) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
NS_PRECONDITION(aNode, "Initialized tree op with null node.");
|
||||
NS_PRECONDITION(aClass, "Initialized tree op with null string.");
|
||||
// aClass must be a literal string that does not need freeing
|
||||
mOpCode = eTreeOpAddClass;
|
||||
mOne.node = aNode;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mTwo.unicharPtr = (char16_t*)aClass;
|
||||
}
|
||||
|
||||
inline void InitAddLineNumberId(nsIContent** aNode,
|
||||
inline void InitAddLineNumberId(nsIContentHandle* aNode,
|
||||
const int32_t aLineNumber) {
|
||||
NS_PRECONDITION(mOpCode == eTreeOpUninitialized,
|
||||
"Op code must be uninitialized when initializing.");
|
||||
@ -331,7 +331,7 @@ class nsHtml5TreeOperation {
|
||||
NS_PRECONDITION(aLineNumber > 0, "Initialized tree op with line number.");
|
||||
// aClass must be a literal string that does not need freeing
|
||||
mOpCode = eTreeOpAddLineNumberId;
|
||||
mOne.node = aNode;
|
||||
mOne.node = static_cast<nsIContent**>(aNode);
|
||||
mFour.integer = aLineNumber;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -40,6 +40,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsTraceRefcnt.h"
|
||||
#include "jArray.h"
|
||||
#include "nsHtml5ArrayCopy.h"
|
||||
#include "nsAHtml5TreeBuilderState.h"
|
||||
@ -41,6 +41,7 @@
|
||||
#include "nsHtml5ByteReadable.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsHtml5Macros.h"
|
||||
#include "nsIContentHandle.h"
|
||||
|
||||
class nsHtml5StreamParser;
|
||||
|
||||
|
5
parser/html/nsIContentHandle.h
Normal file
5
parser/html/nsIContentHandle.h
Normal file
@ -0,0 +1,5 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
typedef void nsIContentHandle;
|
Loading…
x
Reference in New Issue
Block a user