Reverted leftovers from commit "ported mozilla upstream change: Bug 1355441 - Reuse StackNode in TreeBuilder to avoid malloc. r=hsivonen."

This commit is contained in:
Roy Tam 2020-01-31 08:16:35 +08:00
commit d39d2b841f
2 changed files with 2 additions and 32 deletions

View file

@ -163,11 +163,11 @@ nsHtml5StateSnapshot::~nsHtml5StateSnapshot()
{
MOZ_COUNT_DTOR(nsHtml5StateSnapshot);
for (int32_t i = 0; i < stack.length; i++) {
stack[i]->release(nullptr);
stack[i]->release();
}
for (int32_t i = 0; i < listOfActiveFormattingElements.length; i++) {
if (listOfActiveFormattingElements[i]) {
listOfActiveFormattingElements[i]->release(nullptr);
listOfActiveFormattingElements[i]->release();
}
}
}

View file

@ -299,9 +299,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
nsIContentHandle* contextNode;
autoJArray<int32_t,int32_t> templateModeStack;
int32_t templateModePtr;
autoJArray<nsHtml5StackNode*, int32_t> stackNodes;
int32_t stackNodesIdx;
int32_t numStackNodes;
autoJArray<nsHtml5StackNode*,int32_t> stack;
int32_t currentPtr;
autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
@ -404,33 +401,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
void addAttributesToHtml(nsHtml5HtmlAttributes* attributes);
void pushHeadPointerOntoStack();
void reconstructTheActiveFormattingElements();
public:
void notifyUnusedStackNode(int32_t idxInStackNodes);
private:
nsHtml5StackNode* getUnusedStackNode();
nsHtml5StackNode* createStackNode(int32_t flags,
int32_t ns,
nsIAtom* name,
nsIContentHandle* node,
nsIAtom* popName,
nsHtml5HtmlAttributes* attributes);
nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName,
nsIContentHandle* node);
nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName,
nsIContentHandle* node,
nsHtml5HtmlAttributes* attributes);
nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName,
nsIContentHandle* node,
nsIAtom* popName);
nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName,
nsIAtom* popName,
nsIContentHandle* node);
nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName,
nsIContentHandle* node,
nsIAtom* popName,
bool markAsIntegrationPoint);
void insertIntoFosterParent(nsIContentHandle* child);
nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsHtml5ContentCreatorFunction creator);
nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsHtml5ContentCreatorFunction creator);