diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-18 16:08:45 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:36 -0500 |
commit | e5557d43d6934918c018a527f3bae1f7049b9ef1 (patch) | |
tree | ff494bb15bd1031f8c5b3a2d6550f6d9b5304e33 /parser/html/nsHtml5TreeBuilder.cpp | |
parent | 650f6b5eb31dfe6c60da16d1498f8cc3efac4dfa (diff) | |
download | UXP-e5557d43d6934918c018a527f3bae1f7049b9ef1.tar UXP-e5557d43d6934918c018a527f3bae1f7049b9ef1.tar.gz UXP-e5557d43d6934918c018a527f3bae1f7049b9ef1.tar.lz UXP-e5557d43d6934918c018a527f3bae1f7049b9ef1.tar.xz UXP-e5557d43d6934918c018a527f3bae1f7049b9ef1.zip |
Bug 1355479 - Flatten attribute storage in the HTML parser to AutoTArray to avoid malloc.
HTML Regen.
Tag UXP Issue #1344
Diffstat (limited to 'parser/html/nsHtml5TreeBuilder.cpp')
-rw-r--r-- | parser/html/nsHtml5TreeBuilder.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp index 23e874d96..d909c223c 100644 --- a/parser/html/nsHtml5TreeBuilder.cpp +++ b/parser/html/nsHtml5TreeBuilder.cpp @@ -62,7 +62,6 @@ #include "nsHtml5MetaScanner.h" #include "nsHtml5AttributeName.h" #include "nsHtml5ElementName.h" -#include "nsHtml5HtmlAttributes.h" #include "nsHtml5StackNode.h" #include "nsHtml5UTF16Buffer.h" #include "nsHtml5StateSnapshot.h" @@ -1260,11 +1259,11 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu nsHtml5HtmlAttributes* inputAttributes = new nsHtml5HtmlAttributes(0); inputAttributes->addAttribute(nsHtml5AttributeName::ATTR_NAME, nsHtml5Portability::newStringFromLiteral("isindex"), tokenizer->getLineNumber()); for (int32_t i = 0; i < attributes->getLength(); i++) { - nsHtml5AttributeName* attributeQName = attributes->getAttributeNameNoBoundsCheck(i); - if (nsHtml5AttributeName::ATTR_NAME == attributeQName || nsHtml5AttributeName::ATTR_PROMPT == attributeQName) { + nsIAtom* attributeQName = attributes->getLocalNameNoBoundsCheck(i); + if (nsHtml5Atoms::name == attributeQName || nsHtml5Atoms::prompt == attributeQName) { attributes->releaseValue(i); - } else if (nsHtml5AttributeName::ATTR_ACTION != attributeQName) { - inputAttributes->addAttribute(attributeQName, attributes->getValueNoBoundsCheck(i), attributes->getLineNoBoundsCheck(i)); + } else if (nsHtml5Atoms::action != attributeQName) { + inputAttributes->AddAttributeWithLocal(attributeQName, attributes->getValueNoBoundsCheck(i), attributes->getLineNoBoundsCheck(i)); } } attributes->clearWithoutReleasingContents(); |