mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Regenerate nsHtml5*.cpp files from java htmlparser sources
This commit is contained in:
parent
0add893f66
commit
4baeeaa8ec
19 changed files with 100 additions and 132 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2014 Mozilla Foundation
|
||||
* Copyright (c) 2020 Moonchild Productions
|
||||
* Copyright (c) 2008-2016 Mozilla Foundation
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2014 Mozilla Foundation
|
||||
* Copyright (c) 2020 Moonchild Productions
|
||||
* Copyright (c) 2008-2016 Mozilla Foundation
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2008-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -59,11 +60,11 @@
|
|||
nsHtml5HtmlAttributes* nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES = nullptr;
|
||||
|
||||
nsHtml5HtmlAttributes::nsHtml5HtmlAttributes(int32_t mode)
|
||||
: mode(mode)
|
||||
, length(0)
|
||||
, names(jArray<nsHtml5AttributeName*, int32_t>::newJArray(8))
|
||||
, values(jArray<nsHtml5String, int32_t>::newJArray(8))
|
||||
, lines(jArray<int32_t, int32_t>::newJArray(8))
|
||||
: mode(mode),
|
||||
length(0),
|
||||
names(jArray<nsHtml5AttributeName*,int32_t>::newJArray(8)),
|
||||
values(jArray<nsHtml5String,int32_t>::newJArray(8)),
|
||||
lines(jArray<int32_t,int32_t>::newJArray(8))
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsHtml5HtmlAttributes);
|
||||
}
|
||||
|
|
@ -146,17 +147,14 @@ nsHtml5HtmlAttributes::getLineNoBoundsCheck(int32_t index)
|
|||
}
|
||||
|
||||
void
|
||||
nsHtml5HtmlAttributes::addAttribute(nsHtml5AttributeName* name,
|
||||
nsHtml5String value,
|
||||
int32_t line)
|
||||
nsHtml5HtmlAttributes::addAttribute(nsHtml5AttributeName* name, nsHtml5String value, int32_t line)
|
||||
{
|
||||
if (names.length == length) {
|
||||
int32_t newLen = length << 1;
|
||||
jArray<nsHtml5AttributeName*,int32_t> newNames = jArray<nsHtml5AttributeName*,int32_t>::newJArray(newLen);
|
||||
nsHtml5ArrayCopy::arraycopy(names, newNames, names.length);
|
||||
names = newNames;
|
||||
jArray<nsHtml5String, int32_t> newValues =
|
||||
jArray<nsHtml5String, int32_t>::newJArray(newLen);
|
||||
jArray<nsHtml5String,int32_t> newValues = jArray<nsHtml5String,int32_t>::newJArray(newLen);
|
||||
nsHtml5ArrayCopy::arraycopy(values, newValues, values.length);
|
||||
values = newValues;
|
||||
jArray<int32_t,int32_t> newLines = jArray<int32_t,int32_t>::newJArray(newLen);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2008-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -65,7 +66,7 @@ class nsHtml5HtmlAttributes
|
|||
int32_t mode;
|
||||
int32_t length;
|
||||
autoJArray<nsHtml5AttributeName*,int32_t> names;
|
||||
autoJArray<nsHtml5String, int32_t> values;
|
||||
autoJArray<nsHtml5String,int32_t> values;
|
||||
autoJArray<int32_t,int32_t> lines;
|
||||
public:
|
||||
explicit nsHtml5HtmlAttributes(int32_t mode);
|
||||
|
|
@ -79,9 +80,7 @@ class nsHtml5HtmlAttributes
|
|||
nsHtml5String getValueNoBoundsCheck(int32_t index);
|
||||
nsHtml5AttributeName* getAttributeNameNoBoundsCheck(int32_t index);
|
||||
int32_t getLineNoBoundsCheck(int32_t index);
|
||||
void addAttribute(nsHtml5AttributeName* name,
|
||||
nsHtml5String value,
|
||||
int32_t line);
|
||||
void addAttribute(nsHtml5AttributeName* name, nsHtml5String value, int32_t line);
|
||||
void clear(int32_t m);
|
||||
void releaseValue(int32_t i);
|
||||
void clearWithoutReleasingContents();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2008-2015 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -787,8 +788,7 @@ nsHtml5MetaScanner::handleTagInner()
|
|||
return true;
|
||||
}
|
||||
if (!!content && httpEquivState == NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE) {
|
||||
nsHtml5String extract =
|
||||
nsHtml5TreeBuilder::extractCharsetFromContent(content, treeBuilder);
|
||||
nsHtml5String extract = nsHtml5TreeBuilder::extractCharsetFromContent(content, treeBuilder);
|
||||
if (!extract) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2008-2015 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2015 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -60,24 +61,16 @@ class nsHtml5Portability
|
|||
{
|
||||
public:
|
||||
static nsIAtom* newLocalNameFromBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5AtomTable* interner);
|
||||
static nsHtml5String newStringFromBuffer(char16_t* buf,
|
||||
int32_t offset,
|
||||
int32_t length,
|
||||
nsHtml5TreeBuilder* treeBuilder);
|
||||
static nsHtml5String newStringFromBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5TreeBuilder* treeBuilder);
|
||||
static nsHtml5String newEmptyString();
|
||||
static nsHtml5String newStringFromLiteral(const char* literal);
|
||||
static nsHtml5String newStringFromString(nsHtml5String string);
|
||||
static nsHtml5String newStringFromLiteral(const char* literal);
|
||||
static nsHtml5String newStringFromString(nsHtml5String string);
|
||||
static jArray<char16_t,int32_t> newCharArrayFromLocal(nsIAtom* local);
|
||||
static jArray<char16_t, int32_t> newCharArrayFromString(
|
||||
nsHtml5String string);
|
||||
static jArray<char16_t,int32_t> newCharArrayFromString(nsHtml5String string);
|
||||
static nsIAtom* newLocalFromLocal(nsIAtom* local, nsHtml5AtomTable* interner);
|
||||
static bool localEqualsBuffer(nsIAtom* local, char16_t* buf, int32_t offset, int32_t length);
|
||||
static bool lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(
|
||||
const char* lowerCaseLiteral,
|
||||
nsHtml5String string);
|
||||
static bool lowerCaseLiteralEqualsIgnoreAsciiCaseString(
|
||||
const char* lowerCaseLiteral,
|
||||
nsHtml5String string);
|
||||
static bool lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(const char* lowerCaseLiteral, nsHtml5String string);
|
||||
static bool lowerCaseLiteralEqualsIgnoreAsciiCaseString(const char* lowerCaseLiteral, nsHtml5String string);
|
||||
static bool literalEqualsString(const char* literal, nsHtml5String string);
|
||||
static bool stringEqualsString(nsHtml5String one, nsHtml5String other);
|
||||
static void initializeStatics();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2011 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2009-2010 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2009-2010 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2005-2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2015 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
* Portions of comments Copyright 2004-2010 Apple Computer, Inc., Mozilla
|
||||
* Foundation, and Opera Software ASA.
|
||||
*
|
||||
|
|
@ -114,8 +115,7 @@ nsHtml5Tokenizer::setInterner(nsHtml5AtomTable* interner)
|
|||
}
|
||||
|
||||
void
|
||||
nsHtml5Tokenizer::initLocation(nsHtml5String newPublicId,
|
||||
nsHtml5String newSystemId)
|
||||
nsHtml5Tokenizer::initLocation(nsHtml5String newPublicId, nsHtml5String newSystemId)
|
||||
{
|
||||
this->systemId = newSystemId;
|
||||
this->publicId = newPublicId;
|
||||
|
|
@ -220,11 +220,10 @@ nsHtml5Tokenizer::emitOrAppendCharRefBuf(int32_t returnState)
|
|||
}
|
||||
}
|
||||
|
||||
nsHtml5String
|
||||
nsHtml5String
|
||||
nsHtml5Tokenizer::strBufToString()
|
||||
{
|
||||
nsHtml5String str =
|
||||
nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen, tokenHandler);
|
||||
nsHtml5String str = nsHtml5Portability::newStringFromBuffer(strBuf, 0, strBufLen, tokenHandler);
|
||||
clearStrBufAfterUse();
|
||||
return str;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2005-2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2015 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
* Portions of comments Copyright 2004-2010 Apple Computer, Inc., Mozilla
|
||||
* Foundation, and Opera Software ASA.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2015 Mozilla Foundation
|
||||
* Copyright (c) 2020 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
* Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
|
||||
* Foundation, and Opera Software ASA.
|
||||
*
|
||||
|
|
@ -131,12 +132,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
|||
formPointer = getFormPointerForContext(contextNode);
|
||||
if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::textarea == 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)) {
|
||||
} 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->setState(NS_HTML5TOKENIZER_PLAINTEXT);
|
||||
|
|
@ -160,10 +156,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
|||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::doctype(nsIAtom* name,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool forceQuirks)
|
||||
nsHtml5TreeBuilder::doctype(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool forceQuirks)
|
||||
{
|
||||
needToDropLF = false;
|
||||
if (!isInForeign() && mode == NS_HTML5TREE_BUILDER_INITIAL) {
|
||||
|
|
@ -2000,8 +1993,7 @@ nsHtml5TreeBuilder::isSpecialParentInForeign(nsHtml5StackNode* stackNode)
|
|||
}
|
||||
|
||||
nsHtml5String
|
||||
nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue,
|
||||
nsHtml5TreeBuilder* tb)
|
||||
nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHtml5TreeBuilder* tb)
|
||||
{
|
||||
int32_t charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
|
||||
int32_t start = -1;
|
||||
|
|
@ -2190,8 +2182,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue,
|
|||
if (end == -1) {
|
||||
end = buffer.length;
|
||||
}
|
||||
charset =
|
||||
nsHtml5Portability::newStringFromBuffer(buffer, start, end - start, tb);
|
||||
charset = nsHtml5Portability::newStringFromBuffer(buffer, start, end - start, tb);
|
||||
}
|
||||
return charset;
|
||||
}
|
||||
|
|
@ -2199,8 +2190,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue,
|
|||
void
|
||||
nsHtml5TreeBuilder::checkMetaCharset(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsHtml5String charset =
|
||||
attributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
|
||||
nsHtml5String charset = attributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
|
||||
if (charset) {
|
||||
if (tokenizer->internalEncodingDeclaration(charset)) {
|
||||
requestSuspension();
|
||||
|
|
@ -2211,11 +2201,9 @@ nsHtml5TreeBuilder::checkMetaCharset(nsHtml5HtmlAttributes* attributes)
|
|||
if (!nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("content-type", attributes->getValue(nsHtml5AttributeName::ATTR_HTTP_EQUIV))) {
|
||||
return;
|
||||
}
|
||||
nsHtml5String content =
|
||||
attributes->getValue(nsHtml5AttributeName::ATTR_CONTENT);
|
||||
nsHtml5String content = attributes->getValue(nsHtml5AttributeName::ATTR_CONTENT);
|
||||
if (content) {
|
||||
nsHtml5String extract =
|
||||
nsHtml5TreeBuilder::extractCharsetFromContent(content, this);
|
||||
nsHtml5String extract = nsHtml5TreeBuilder::extractCharsetFromContent(content, this);
|
||||
if (extract) {
|
||||
if (tokenizer->internalEncodingDeclaration(extract)) {
|
||||
requestSuspension();
|
||||
|
|
@ -3222,11 +3210,7 @@ nsHtml5TreeBuilder::isSecondOnStackBody()
|
|||
}
|
||||
|
||||
void
|
||||
nsHtml5TreeBuilder::documentModeInternal(
|
||||
nsHtml5DocumentMode m,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool html4SpecificAdditionalErrorChecks)
|
||||
nsHtml5TreeBuilder::documentModeInternal(nsHtml5DocumentMode m, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool html4SpecificAdditionalErrorChecks)
|
||||
{
|
||||
if (isSrcdocDocument) {
|
||||
quirks = false;
|
||||
|
|
@ -3238,8 +3222,7 @@ nsHtml5TreeBuilder::documentModeInternal(
|
|||
}
|
||||
|
||||
bool
|
||||
nsHtml5TreeBuilder::isAlmostStandards(nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier)
|
||||
nsHtml5TreeBuilder::isAlmostStandards(nsHtml5String publicIdentifier, nsHtml5String systemIdentifier)
|
||||
{
|
||||
if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd xhtml 1.0 transitional//en", publicIdentifier)) {
|
||||
return true;
|
||||
|
|
@ -3259,10 +3242,7 @@ nsHtml5TreeBuilder::isAlmostStandards(nsHtml5String publicIdentifier,
|
|||
}
|
||||
|
||||
bool
|
||||
nsHtml5TreeBuilder::isQuirky(nsIAtom* name,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool forceQuirks)
|
||||
nsHtml5TreeBuilder::isQuirky(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool forceQuirks)
|
||||
{
|
||||
if (forceQuirks) {
|
||||
return true;
|
||||
|
|
@ -4073,8 +4053,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5Elem
|
|||
bool
|
||||
nsHtml5TreeBuilder::annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attributes)
|
||||
{
|
||||
nsHtml5String encoding =
|
||||
attributes->getValue(nsHtml5AttributeName::ATTR_ENCODING);
|
||||
nsHtml5String encoding = attributes->getValue(nsHtml5AttributeName::ATTR_ENCODING);
|
||||
if (!encoding) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Henri Sivonen
|
||||
* Copyright (c) 2007-2015 Mozilla Foundation
|
||||
* Copyright (c) 2020 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
* Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
|
||||
* Foundation, and Opera Software ASA.
|
||||
*
|
||||
|
|
@ -104,10 +105,7 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
|||
bool isSrcdocDocument;
|
||||
public:
|
||||
void startTokenization(nsHtml5Tokenizer* self);
|
||||
void doctype(nsIAtom* name,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool forceQuirks);
|
||||
void doctype(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool forceQuirks);
|
||||
void comment(char16_t* buf, int32_t start, int32_t length);
|
||||
void characters(const char16_t* buf, int32_t start, int32_t length);
|
||||
void zeroOriginatingReplacementCharacter();
|
||||
|
|
@ -123,8 +121,7 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
|||
bool isTemplateModeStackEmpty();
|
||||
bool isSpecialParentInForeign(nsHtml5StackNode* stackNode);
|
||||
public:
|
||||
static nsHtml5String extractCharsetFromContent(nsHtml5String attributeValue,
|
||||
nsHtml5TreeBuilder* tb);
|
||||
static nsHtml5String extractCharsetFromContent(nsHtml5String attributeValue, nsHtml5TreeBuilder* tb);
|
||||
private:
|
||||
void checkMetaCharset(nsHtml5HtmlAttributes* attributes);
|
||||
public:
|
||||
|
|
@ -141,16 +138,9 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
|||
void generateImpliedEndTagsExceptFor(nsIAtom* name);
|
||||
void generateImpliedEndTags();
|
||||
bool isSecondOnStackBody();
|
||||
void documentModeInternal(nsHtml5DocumentMode m,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool html4SpecificAdditionalErrorChecks);
|
||||
bool isAlmostStandards(nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier);
|
||||
bool isQuirky(nsIAtom* name,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier,
|
||||
bool forceQuirks);
|
||||
void documentModeInternal(nsHtml5DocumentMode m, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool html4SpecificAdditionalErrorChecks);
|
||||
bool isAlmostStandards(nsHtml5String publicIdentifier, nsHtml5String systemIdentifier);
|
||||
bool isQuirky(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool forceQuirks);
|
||||
void closeTheCell(int32_t eltPos);
|
||||
int32_t findLastInTableScopeTdTh();
|
||||
void clearStackBackTo(int32_t eltPos);
|
||||
|
|
@ -236,9 +226,7 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
|
|||
void markMalformedIfScript(nsIContentHandle* elt);
|
||||
void start(bool fragmentMode);
|
||||
void end();
|
||||
void appendDoctypeToDocument(nsIAtom* name,
|
||||
nsHtml5String publicIdentifier,
|
||||
nsHtml5String systemIdentifier);
|
||||
void appendDoctypeToDocument(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier);
|
||||
void elementPushed(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
||||
void elementPopped(int32_t ns, nsIAtom* name, nsIContentHandle* node);
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2010 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2010 Mozilla Foundation
|
||||
* Copyright (c) 2019 Moonchild Productions
|
||||
* Copyright (c) 2018-2020 Moonchild Productions
|
||||
* Copyright (c) 2020 Binary Outcast
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue