From 5d4200f56df55774dcc94df431cc67fe65b674ed Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 18 Jan 2020 16:32:18 -0500 Subject: Bug 1358037 - Inline the methods of nsHtml5ElementName and nsHtml5AttributeName. Manual changes Tag UXP Issue #1344 --- parser/html/moz.build | 1 + parser/html/nsHtml5Highlighter.cpp | 240 +++++++++++++------------- parser/html/nsHtml5HtmlAttributes.cpp | 20 +-- parser/html/nsHtml5TokenizerCppSupplement.h | 2 +- parser/html/nsHtml5TreeBuilderCppSupplement.h | 4 +- 5 files changed, 134 insertions(+), 133 deletions(-) diff --git a/parser/html/moz.build b/parser/html/moz.build index e9bfdbbb9..12809fe8d 100644 --- a/parser/html/moz.build +++ b/parser/html/moz.build @@ -36,6 +36,7 @@ EXPORTS += [ 'nsHtml5OwningUTF16Buffer.h', 'nsHtml5Parser.h', 'nsHtml5PlainTextUtils.h', + 'nsHtml5Portability.h', 'nsHtml5RefPtr.h', 'nsHtml5Speculation.h', 'nsHtml5SpeculativeLoad.h', diff --git a/parser/html/nsHtml5Highlighter.cpp b/parser/html/nsHtml5Highlighter.cpp index 23cdf7d84..92e4b0373 100644 --- a/parser/html/nsHtml5Highlighter.cpp +++ b/parser/html/nsHtml5Highlighter.cpp @@ -48,7 +48,7 @@ char16_t nsHtml5Highlighter::sPi[] = { 'p', 'i', 0 }; nsHtml5Highlighter::nsHtml5Highlighter(nsAHtml5TreeOpSink* aOpSink) - : mState(NS_HTML5TOKENIZER_DATA) + : mState(nsHtml5Tokenizer::DATA) , mCStart(INT32_MAX) , mPos(0) , mLineNumber(1) @@ -119,13 +119,13 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) { mPos = aPos; switch (mState) { - case NS_HTML5TOKENIZER_SCRIPT_DATA: - case NS_HTML5TOKENIZER_RAWTEXT: - case NS_HTML5TOKENIZER_RCDATA: - case NS_HTML5TOKENIZER_DATA: + case nsHtml5Tokenizer::SCRIPT_DATA: + case nsHtml5Tokenizer::RAWTEXT: + case nsHtml5Tokenizer::RCDATA: + case nsHtml5Tokenizer::DATA: // We can transition on < and on &. Either way, we don't yet know the // role of the token, so open a span without class. - if (aState == NS_HTML5TOKENIZER_CONSUME_CHARACTER_REFERENCE) { + if (aState == nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE) { StartSpan(); // Start another span for highlighting the ampersand StartSpan(); @@ -134,26 +134,26 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) EndCharactersAndStartMarkupRun(); } break; - case NS_HTML5TOKENIZER_TAG_OPEN: + case nsHtml5Tokenizer::TAG_OPEN: switch (aState) { - case NS_HTML5TOKENIZER_TAG_NAME: + case nsHtml5Tokenizer::TAG_NAME: StartSpan(sStartTag); break; - case NS_HTML5TOKENIZER_DATA: + case nsHtml5Tokenizer::DATA: FinishTag(); // DATA break; - case NS_HTML5TOKENIZER_PROCESSING_INSTRUCTION: + case nsHtml5Tokenizer::PROCESSING_INSTRUCTION: AddClass(sPi); break; } break; - case NS_HTML5TOKENIZER_TAG_NAME: + case nsHtml5Tokenizer::TAG_NAME: switch (aState) { - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: - EndSpanOrA(); // NS_HTML5TOKENIZER_TAG_NAME + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: + EndSpanOrA(); // nsHtml5Tokenizer::TAG_NAME break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: - EndSpanOrA(); // NS_HTML5TOKENIZER_TAG_NAME + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: + EndSpanOrA(); // nsHtml5Tokenizer::TAG_NAME StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; @@ -162,12 +162,12 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: switch (aState) { - case NS_HTML5TOKENIZER_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::ATTRIBUTE_NAME: StartSpan(sAttributeName); break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; @@ -176,14 +176,14 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::ATTRIBUTE_NAME: switch (aState) { - case NS_HTML5TOKENIZER_AFTER_ATTRIBUTE_NAME: - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_VALUE: - EndSpanOrA(); // NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME + case nsHtml5Tokenizer::AFTER_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_VALUE: + EndSpanOrA(); // nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: - EndSpanOrA(); // NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: + EndSpanOrA(); // nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; @@ -192,14 +192,14 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_VALUE: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_VALUE: switch (aState) { - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_SINGLE_QUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_DOUBLE_QUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_SINGLE_QUOTED: FlushCurrent(); StartA(); break; - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_UNQUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_UNQUOTED: StartA(); break; default: @@ -207,13 +207,13 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_SINGLE_QUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_DOUBLE_QUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_SINGLE_QUOTED: switch (aState) { - case NS_HTML5TOKENIZER_AFTER_ATTRIBUTE_VALUE_QUOTED: + case nsHtml5Tokenizer::AFTER_ATTRIBUTE_VALUE_QUOTED: EndSpanOrA(); break; - case NS_HTML5TOKENIZER_CONSUME_CHARACTER_REFERENCE: + case nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE: StartSpan(); StartSpan(); // for ampersand itself mAmpersand = CurrentNode(); @@ -223,11 +223,11 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_AFTER_ATTRIBUTE_VALUE_QUOTED: + case nsHtml5Tokenizer::AFTER_ATTRIBUTE_VALUE_QUOTED: switch (aState) { - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; @@ -236,22 +236,22 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: EndSpanOrA(); // end the slash highlight switch (aState) { - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: break; default: FinishTag(); break; } break; - case NS_HTML5TOKENIZER_ATTRIBUTE_VALUE_UNQUOTED: + case nsHtml5Tokenizer::ATTRIBUTE_VALUE_UNQUOTED: switch (aState) { - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: EndSpanOrA(); break; - case NS_HTML5TOKENIZER_CONSUME_CHARACTER_REFERENCE: + case nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE: StartSpan(); StartSpan(); // for ampersand itself mAmpersand = CurrentNode(); @@ -261,15 +261,15 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_AFTER_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::AFTER_ATTRIBUTE_NAME: switch (aState) { - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_VALUE: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_VALUE: break; - case NS_HTML5TOKENIZER_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::ATTRIBUTE_NAME: StartSpan(sAttributeName); break; default: @@ -279,30 +279,30 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; // most comment states are omitted, because they don't matter to // highlighting - case NS_HTML5TOKENIZER_COMMENT_START: - case NS_HTML5TOKENIZER_COMMENT_END: - case NS_HTML5TOKENIZER_COMMENT_END_BANG: - case NS_HTML5TOKENIZER_COMMENT_START_DASH: - case NS_HTML5TOKENIZER_BOGUS_COMMENT: - case NS_HTML5TOKENIZER_BOGUS_COMMENT_HYPHEN: - if (aState == NS_HTML5TOKENIZER_DATA) { + case nsHtml5Tokenizer::COMMENT_START: + case nsHtml5Tokenizer::COMMENT_END: + case nsHtml5Tokenizer::COMMENT_END_BANG: + case nsHtml5Tokenizer::COMMENT_START_DASH: + case nsHtml5Tokenizer::BOGUS_COMMENT: + case nsHtml5Tokenizer::BOGUS_COMMENT_HYPHEN: + if (aState == nsHtml5Tokenizer::DATA) { AddClass(sComment); FinishTag(); } break; // most cdata states are omitted, because they don't matter to // highlighting - case NS_HTML5TOKENIZER_CDATA_RSQB_RSQB: - if (aState == NS_HTML5TOKENIZER_DATA) { + case nsHtml5Tokenizer::CDATA_RSQB_RSQB: + if (aState == nsHtml5Tokenizer::DATA) { AddClass(sCdata); FinishTag(); } break; - case NS_HTML5TOKENIZER_CONSUME_CHARACTER_REFERENCE: + case nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE: EndSpanOrA(); // the span for the ampersand switch (aState) { - case NS_HTML5TOKENIZER_CONSUME_NCR: - case NS_HTML5TOKENIZER_CHARACTER_REFERENCE_HILO_LOOKUP: + case nsHtml5Tokenizer::CONSUME_NCR: + case nsHtml5Tokenizer::CHARACTER_REFERENCE_HILO_LOOKUP: break; default: // not actually a character reference @@ -310,44 +310,44 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_CHARACTER_REFERENCE_HILO_LOOKUP: - if (aState == NS_HTML5TOKENIZER_CHARACTER_REFERENCE_TAIL) { + case nsHtml5Tokenizer::CHARACTER_REFERENCE_HILO_LOOKUP: + if (aState == nsHtml5Tokenizer::CHARACTER_REFERENCE_TAIL) { break; } // not actually a character reference EndSpanOrA(); break; - case NS_HTML5TOKENIZER_CHARACTER_REFERENCE_TAIL: + case nsHtml5Tokenizer::CHARACTER_REFERENCE_TAIL: if (!aReconsume) { FlushCurrent(); } EndSpanOrA(); break; - case NS_HTML5TOKENIZER_DECIMAL_NRC_LOOP: - case NS_HTML5TOKENIZER_HEX_NCR_LOOP: + case nsHtml5Tokenizer::DECIMAL_NRC_LOOP: + case nsHtml5Tokenizer::HEX_NCR_LOOP: switch (aState) { - case NS_HTML5TOKENIZER_HANDLE_NCR_VALUE: + case nsHtml5Tokenizer::HANDLE_NCR_VALUE: AddClass(sEntity); FlushCurrent(); break; - case NS_HTML5TOKENIZER_HANDLE_NCR_VALUE_RECONSUME: + case nsHtml5Tokenizer::HANDLE_NCR_VALUE_RECONSUME: AddClass(sEntity); break; } EndSpanOrA(); break; - case NS_HTML5TOKENIZER_CLOSE_TAG_OPEN: + case nsHtml5Tokenizer::CLOSE_TAG_OPEN: switch (aState) { - case NS_HTML5TOKENIZER_DATA: + case nsHtml5Tokenizer::DATA: FinishTag(); break; - case NS_HTML5TOKENIZER_TAG_NAME: + case nsHtml5Tokenizer::TAG_NAME: StartSpan(sEndTag); break; } break; - case NS_HTML5TOKENIZER_RAWTEXT_RCDATA_LESS_THAN_SIGN: - if (aState == NS_HTML5TOKENIZER_NON_DATA_END_TAG_NAME) { + case nsHtml5Tokenizer::RAWTEXT_RCDATA_LESS_THAN_SIGN: + if (aState == nsHtml5Tokenizer::NON_DATA_END_TAG_NAME) { FlushCurrent(); StartSpan(); // don't know if it is "end-tag" yet :-( break; @@ -355,19 +355,19 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) EndSpanOrA(); StartCharacters(); break; - case NS_HTML5TOKENIZER_NON_DATA_END_TAG_NAME: + case nsHtml5Tokenizer::NON_DATA_END_TAG_NAME: switch (aState) { - case NS_HTML5TOKENIZER_BEFORE_ATTRIBUTE_NAME: + case nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME: AddClass(sEndTag); EndSpanOrA(); break; - case NS_HTML5TOKENIZER_SELF_CLOSING_START_TAG: + case nsHtml5Tokenizer::SELF_CLOSING_START_TAG: AddClass(sEndTag); EndSpanOrA(); StartSpan(); // for highlighting the slash mSlash = CurrentNode(); break; - case NS_HTML5TOKENIZER_DATA: // yes, as a result of emitting the token + case nsHtml5Tokenizer::DATA: // yes, as a result of emitting the token AddClass(sEndTag); FinishTag(); break; @@ -376,47 +376,47 @@ nsHtml5Highlighter::Transition(int32_t aState, bool aReconsume, int32_t aPos) break; } break; - case NS_HTML5TOKENIZER_SCRIPT_DATA_LESS_THAN_SIGN: - case NS_HTML5TOKENIZER_SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: - if (aState == NS_HTML5TOKENIZER_NON_DATA_END_TAG_NAME) { + case nsHtml5Tokenizer::SCRIPT_DATA_LESS_THAN_SIGN: + case nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: + if (aState == nsHtml5Tokenizer::NON_DATA_END_TAG_NAME) { FlushCurrent(); StartSpan(); // don't know if it is "end-tag" yet :-( break; } FinishTag(); break; - case NS_HTML5TOKENIZER_SCRIPT_DATA_ESCAPED_DASH_DASH: - case NS_HTML5TOKENIZER_SCRIPT_DATA_ESCAPED: - case NS_HTML5TOKENIZER_SCRIPT_DATA_ESCAPED_DASH: - if (aState == NS_HTML5TOKENIZER_SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN) { + case nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_DASH_DASH: + case nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED: + case nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_DASH: + if (aState == nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN) { EndCharactersAndStartMarkupRun(); } break; // Lots of double escape states omitted, because they don't highlight. // Likewise, only doctype states that can emit the doctype are of // interest. Otherwise, the transition out of bogus comment deals. - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_PUBLIC_KEYWORD: - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: - case NS_HTML5TOKENIZER_DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_PUBLIC_IDENTIFIER: - case NS_HTML5TOKENIZER_BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: - case NS_HTML5TOKENIZER_DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_SYSTEM_IDENTIFIER: - case NS_HTML5TOKENIZER_BOGUS_DOCTYPE: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_SYSTEM_KEYWORD: - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: - case NS_HTML5TOKENIZER_DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: - case NS_HTML5TOKENIZER_DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: - if (aState == NS_HTML5TOKENIZER_DATA) { + case nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME: + case nsHtml5Tokenizer::DOCTYPE_NAME: + case nsHtml5Tokenizer::AFTER_DOCTYPE_NAME: + case nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_KEYWORD: + case nsHtml5Tokenizer::BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: + case nsHtml5Tokenizer::DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: + case nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_IDENTIFIER: + case nsHtml5Tokenizer::BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: + case nsHtml5Tokenizer::DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: + case nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_IDENTIFIER: + case nsHtml5Tokenizer::BOGUS_DOCTYPE: + case nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_KEYWORD: + case nsHtml5Tokenizer::BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: + case nsHtml5Tokenizer::DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: + case nsHtml5Tokenizer::DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: + if (aState == nsHtml5Tokenizer::DATA) { AddClass(sDoctype); FinishTag(); } break; - case NS_HTML5TOKENIZER_PROCESSING_INSTRUCTION_QUESTION_MARK: - if (aState == NS_HTML5TOKENIZER_DATA) { + case nsHtml5Tokenizer::PROCESSING_INSTRUCTION_QUESTION_MARK: + if (aState == nsHtml5Tokenizer::DATA) { FinishTag(); } break; @@ -431,35 +431,35 @@ void nsHtml5Highlighter::End() { switch (mState) { - case NS_HTML5TOKENIZER_COMMENT_END: - case NS_HTML5TOKENIZER_COMMENT_END_BANG: - case NS_HTML5TOKENIZER_COMMENT_START_DASH: - case NS_HTML5TOKENIZER_BOGUS_COMMENT: - case NS_HTML5TOKENIZER_BOGUS_COMMENT_HYPHEN: + case nsHtml5Tokenizer::COMMENT_END: + case nsHtml5Tokenizer::COMMENT_END_BANG: + case nsHtml5Tokenizer::COMMENT_START_DASH: + case nsHtml5Tokenizer::BOGUS_COMMENT: + case nsHtml5Tokenizer::BOGUS_COMMENT_HYPHEN: AddClass(sComment); break; - case NS_HTML5TOKENIZER_CDATA_RSQB_RSQB: + case nsHtml5Tokenizer::CDATA_RSQB_RSQB: AddClass(sCdata); break; - case NS_HTML5TOKENIZER_DECIMAL_NRC_LOOP: - case NS_HTML5TOKENIZER_HEX_NCR_LOOP: + case nsHtml5Tokenizer::DECIMAL_NRC_LOOP: + case nsHtml5Tokenizer::HEX_NCR_LOOP: // XXX need tokenizer help here break; - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_NAME: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_PUBLIC_KEYWORD: - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: - case NS_HTML5TOKENIZER_DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_PUBLIC_IDENTIFIER: - case NS_HTML5TOKENIZER_BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: - case NS_HTML5TOKENIZER_DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_SYSTEM_IDENTIFIER: - case NS_HTML5TOKENIZER_BOGUS_DOCTYPE: - case NS_HTML5TOKENIZER_AFTER_DOCTYPE_SYSTEM_KEYWORD: - case NS_HTML5TOKENIZER_BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: - case NS_HTML5TOKENIZER_DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: - case NS_HTML5TOKENIZER_DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: + case nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME: + case nsHtml5Tokenizer::DOCTYPE_NAME: + case nsHtml5Tokenizer::AFTER_DOCTYPE_NAME: + case nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_KEYWORD: + case nsHtml5Tokenizer::BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: + case nsHtml5Tokenizer::DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: + case nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_IDENTIFIER: + case nsHtml5Tokenizer::BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: + case nsHtml5Tokenizer::DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: + case nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_IDENTIFIER: + case nsHtml5Tokenizer::BOGUS_DOCTYPE: + case nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_KEYWORD: + case nsHtml5Tokenizer::BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: + case nsHtml5Tokenizer::DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: + case nsHtml5Tokenizer::DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: AddClass(sDoctype); break; default: diff --git a/parser/html/nsHtml5HtmlAttributes.cpp b/parser/html/nsHtml5HtmlAttributes.cpp index bdccd8145..d8f59d22c 100644 --- a/parser/html/nsHtml5HtmlAttributes.cpp +++ b/parser/html/nsHtml5HtmlAttributes.cpp @@ -71,8 +71,8 @@ int32_t nsHtml5HtmlAttributes::getIndex(nsHtml5AttributeName* aName) { for (size_t i = 0; i < mStorage.Length(); i++) { - if (mStorage[i].GetLocal(NS_HTML5ATTRIBUTE_NAME_HTML) == - aName->getLocal(NS_HTML5ATTRIBUTE_NAME_HTML)) { + if (mStorage[i].GetLocal(nsHtml5AttributeName::HTML) == + aName->getLocal(nsHtml5AttributeName::HTML)) { // It's release asserted elsewhere that i can't be too large. return i; } @@ -184,8 +184,8 @@ bool nsHtml5HtmlAttributes::contains(nsHtml5AttributeName* aName) { for (size_t i = 0; i < mStorage.Length(); i++) { - if (mStorage[i].GetLocal(NS_HTML5ATTRIBUTE_NAME_HTML) == - aName->getLocal(NS_HTML5ATTRIBUTE_NAME_HTML)) { + if (mStorage[i].GetLocal(nsHtml5AttributeName::HTML) == + aName->getLocal(nsHtml5AttributeName::HTML)) { return true; } } @@ -195,13 +195,13 @@ nsHtml5HtmlAttributes::contains(nsHtml5AttributeName* aName) void nsHtml5HtmlAttributes::adjustForMath() { - mMode = NS_HTML5ATTRIBUTE_NAME_MATHML; + mMode = nsHtml5AttributeName::MATHML; } void nsHtml5HtmlAttributes::adjustForSvg() { - mMode = NS_HTML5ATTRIBUTE_NAME_SVG; + mMode = nsHtml5AttributeName::SVG; } nsHtml5HtmlAttributes* @@ -209,7 +209,7 @@ nsHtml5HtmlAttributes::cloneAttributes(nsHtml5AtomTable* aInterner) { MOZ_ASSERT(mStorage.IsEmpty() || !mMode); nsHtml5HtmlAttributes* clone = - new nsHtml5HtmlAttributes(NS_HTML5ATTRIBUTE_NAME_HTML); + new nsHtml5HtmlAttributes(nsHtml5AttributeName::HTML); for (nsHtml5AttributeEntry& entry : mStorage) { clone->AddEntry(entry.Clone(aInterner)); } @@ -225,9 +225,9 @@ nsHtml5HtmlAttributes::equalsAnother(nsHtml5HtmlAttributes* aOther) } for (nsHtml5AttributeEntry& entry : mStorage) { bool found = false; - nsIAtom* ownLocal = entry.GetLocal(NS_HTML5ATTRIBUTE_NAME_HTML); + nsIAtom* ownLocal = entry.GetLocal(nsHtml5AttributeName::HTML); for (nsHtml5AttributeEntry& otherEntry : aOther->mStorage) { - if (ownLocal == otherEntry.GetLocal(NS_HTML5ATTRIBUTE_NAME_HTML)) { + if (ownLocal == otherEntry.GetLocal(nsHtml5AttributeName::HTML)) { found = true; if (!entry.GetValue().Equals(otherEntry.GetValue())) { return false; @@ -251,7 +251,7 @@ nsHtml5HtmlAttributes::AddEntry(nsHtml5AttributeEntry&& aEntry) void nsHtml5HtmlAttributes::initializeStatics() { - EMPTY_ATTRIBUTES = new nsHtml5HtmlAttributes(NS_HTML5ATTRIBUTE_NAME_HTML); + EMPTY_ATTRIBUTES = new nsHtml5HtmlAttributes(nsHtml5AttributeName::HTML); } void diff --git a/parser/html/nsHtml5TokenizerCppSupplement.h b/parser/html/nsHtml5TokenizerCppSupplement.h index b8a9bce0e..343fceadd 100644 --- a/parser/html/nsHtml5TokenizerCppSupplement.h +++ b/parser/html/nsHtml5TokenizerCppSupplement.h @@ -62,7 +62,7 @@ nsHtml5Tokenizer::EnsureBufferSpace(int32_t aLength) void nsHtml5Tokenizer::StartPlainText() { - stateSave = NS_HTML5TOKENIZER_PLAINTEXT; + stateSave = nsHtml5Tokenizer::PLAINTEXT; } void diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index aacc5a3e0..6121c6186 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -173,7 +173,7 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, type, crossOrigin, integrity, - mode == NS_HTML5TREE_BUILDER_IN_HEAD); + mode == nsHtml5TreeBuilder::IN_HEAD); mCurrentHtmlScriptIsAsyncOrDefer = aAttributes->contains(nsHtml5AttributeName::ATTR_ASYNC) || aAttributes->contains(nsHtml5AttributeName::ATTR_DEFER); @@ -279,7 +279,7 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName, type, crossOrigin, integrity, - mode == NS_HTML5TREE_BUILDER_IN_HEAD); + mode == nsHtml5TreeBuilder::IN_HEAD); } } else if (nsHtml5Atoms::style == aName) { nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement(); -- cgit v1.2.3