summaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorHenri Sivonen <hsivonen@hsivonen.fi>2020-02-14 13:24:59 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-02-14 13:24:59 +0100
commite7e0f4a0ce9c908caab4b7623f0303aa38aacf26 (patch)
treea97aa03c1ca9b2f75449140d60e2640643459dfe /parser
parentbdb5f4668a75a25b998d8636c1d3c32d37b38321 (diff)
downloaduxp-e7e0f4a0ce9c908caab4b7623f0303aa38aacf26.tar.gz
[Parser] Move setting context to null to the correct location.
Diffstat (limited to 'parser')
-rw-r--r--parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java4
-rw-r--r--parser/html/nsHtml5TreeBuilder.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
index d77715a3e1..cc60f4c4bb 100644
--- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
+++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
@@ -717,8 +717,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
tokenizer.setState(Tokenizer.DATA);
}
}
- contextName = null;
- contextNode = null;
} else {
mode = INITIAL;
// If we are viewing XML source, put a foreign element permanently
@@ -1627,6 +1625,8 @@ public abstract class TreeBuilder<T> implements TokenHandler,
public final void endTokenization() throws SAXException {
formPointer = null;
headPointer = null;
+ contextName = null;
+ contextNode = null;
deepTreeSurrogateParent = null;
templateModeStack = null;
if (stack != null) {
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp
index 050df1f941..efbc339675 100644
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -141,8 +141,6 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
tokenizer->setState(nsHtml5Tokenizer::DATA);
}
}
- contextName = nullptr;
- contextNode = nullptr;
} else {
mode = INITIAL;
if (tokenizer->isViewingXmlSource()) {
@@ -578,6 +576,8 @@ nsHtml5TreeBuilder::endTokenization()
{
formPointer = nullptr;
headPointer = nullptr;
+ contextName = nullptr;
+ contextNode = nullptr;
deepTreeSurrogateParent = nullptr;
templateModeStack = nullptr;
if (stack) {