diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-09-04 15:27:40 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-09-04 15:27:40 +0200 |
commit | 0ce08b418d84a57bae22a0aa395fecb7412ed931 (patch) | |
tree | 7d46a9b019e57aee76879290695ce2173a8891af /parser/html/nsHtml5TreeBuilder.cpp | |
parent | cc60a093cb65745602dc1f5eab9f5e328ddaad15 (diff) | |
download | UXP-0ce08b418d84a57bae22a0aa395fecb7412ed931.tar UXP-0ce08b418d84a57bae22a0aa395fecb7412ed931.tar.gz UXP-0ce08b418d84a57bae22a0aa395fecb7412ed931.tar.lz UXP-0ce08b418d84a57bae22a0aa395fecb7412ed931.tar.xz UXP-0ce08b418d84a57bae22a0aa395fecb7412ed931.zip |
Fix an issue with the html5 tokenizer and tree builder.
Diffstat (limited to 'parser/html/nsHtml5TreeBuilder.cpp')
-rw-r--r-- | parser/html/nsHtml5TreeBuilder.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp index 457c7deb1..e5040d050 100644 --- a/parser/html/nsHtml5TreeBuilder.cpp +++ b/parser/html/nsHtml5TreeBuilder.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2015 Mozilla Foundation + * Copyright (c) 2019 Moonchild Productions * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * @@ -105,7 +106,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->camelCaseName, elt); currentPtr++; stack[currentPtr] = node; - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); mode = NS_HTML5TREE_BUILDER_FRAMESET_OK; } else if (contextNamespace == kNameSpaceID_MathML) { nsHtml5ElementName* elementName = nsHtml5ElementName::ELT_MATH; @@ -117,7 +118,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->name, false); currentPtr++; stack[currentPtr] = node; - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); mode = NS_HTML5TREE_BUILDER_FRAMESET_OK; } else { nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_HTML, elt); @@ -129,15 +130,20 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) resetTheInsertionMode(); formPointer = getFormPointerForContext(contextNode); if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::textarea == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RCDATA, contextName); - } else if (nsHtml5Atoms::style == contextName || nsHtml5Atoms::xmp == contextName || nsHtml5Atoms::iframe == contextName || nsHtml5Atoms::noembed == contextName || nsHtml5Atoms::noframes == contextName || (scriptingEnabled && nsHtml5Atoms::noscript == contextName)) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_RCDATA); + } else if (nsHtml5Atoms::style == contextName || + nsHtml5Atoms::xmp == contextName || + nsHtml5Atoms::iframe == contextName || + nsHtml5Atoms::noembed == contextName || + nsHtml5Atoms::noframes == contextName || + (scriptingEnabled && nsHtml5Atoms::noscript == contextName)) { + tokenizer->setState(NS_HTML5TOKENIZER_RAWTEXT); } else if (nsHtml5Atoms::plaintext == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_PLAINTEXT, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_PLAINTEXT); } else if (nsHtml5Atoms::script == contextName) { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_SCRIPT_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_SCRIPT_DATA); } else { - tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_DATA, contextName); + tokenizer->setState(NS_HTML5TOKENIZER_DATA); } } contextName = nullptr; |