Title: [280199] trunk/Source/WebCore
Revision
280199
Author
[email protected]
Date
2021-07-22 15:07:52 -0700 (Thu, 22 Jul 2021)

Log Message

Rename AtomicHTMLToken to AtomHTMLToken
https://bugs.webkit.org/show_bug.cgi?id=228196

Reviewed by Geoffrey Garen.

We should rename AtomicHTMLToken to AtomHTMLToken as we did for AtomString (AtomicString => AtomString).

* WebCore.xcodeproj/project.pbxproj:
* html/parser/AtomHTMLToken.h: Renamed from Source/WebCore/html/parser/AtomicHTMLToken.h.
(WebCore::AtomHTMLToken::AtomHTMLToken):
(WebCore::AtomHTMLToken::type const):
(WebCore::AtomHTMLToken::name const):
(WebCore::AtomHTMLToken::setName):
(WebCore::AtomHTMLToken::selfClosing const):
(WebCore::AtomHTMLToken::attributes):
(WebCore::AtomHTMLToken::attributes const):
(WebCore::AtomHTMLToken::characters const):
(WebCore::AtomHTMLToken::charactersLength const):
(WebCore::AtomHTMLToken::charactersIsAll8BitData const):
(WebCore::AtomHTMLToken::comment const):
(WebCore::AtomHTMLToken::forceQuirks const):
(WebCore::AtomHTMLToken::publicIdentifier const):
(WebCore::AtomHTMLToken::systemIdentifier const):
(WebCore::AtomHTMLToken::initializeAttributes):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::setAttributes):
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
(WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
(WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
(WebCore::HTMLConstructionSite::insertDoctype):
(WebCore::HTMLConstructionSite::insertComment):
(WebCore::HTMLConstructionSite::insertCommentOnDocument):
(WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
(WebCore::HTMLConstructionSite::insertHTMLHeadElement):
(WebCore::HTMLConstructionSite::insertHTMLBodyElement):
(WebCore::HTMLConstructionSite::insertHTMLFormElement):
(WebCore::HTMLConstructionSite::insertHTMLElement):
(WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
(WebCore::HTMLConstructionSite::insertFormattingElement):
(WebCore::HTMLConstructionSite::insertScriptElement):
(WebCore::HTMLConstructionSite::insertForeignElement):
(WebCore::HTMLConstructionSite::createElement):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::createHTMLElement):
(WebCore::HTMLConstructionSite::createElementFromSavedToken):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::constructTreeFromHTMLToken):
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::HTMLStackItem):
(WebCore::HTMLStackItem::create):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer):
(WebCore::HTMLTreeBuilder::constructTree):
(WebCore::HTMLTreeBuilder::processToken):
(WebCore::HTMLTreeBuilder::processDoctypeToken):
(WebCore::HTMLTreeBuilder::processFakeStartTag):
(WebCore::HTMLTreeBuilder::processFakeEndTag):
(WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
(WebCore::shouldClose):
(WebCore::adjustSVGTagNameCase):
(WebCore::adjustAttributes):
(WebCore::adjustSVGAttributes):
(WebCore::adjustMathMLAttributes):
(WebCore::adjustForeignAttributes):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
(WebCore::HTMLTreeBuilder::processTemplateStartTag):
(WebCore::HTMLTreeBuilder::processTemplateEndTag):
(WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
(WebCore::HTMLTreeBuilder::processStartTagForInTable):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
(WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
(WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
(WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
(WebCore::HTMLTreeBuilder::processEndTagForInRow):
(WebCore::HTMLTreeBuilder::processEndTagForInCell):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
(WebCore::HTMLTreeBuilder::processEndTagForInTable):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processComment):
(WebCore::HTMLTreeBuilder::processCharacter):
(WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
(WebCore::HTMLTreeBuilder::processEndOfFile):
(WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
(WebCore::HTMLTreeBuilder::defaultForBeforeHead):
(WebCore::HTMLTreeBuilder::defaultForInHead):
(WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
(WebCore::HTMLTreeBuilder::defaultForAfterHead):
(WebCore::HTMLTreeBuilder::processStartTagForInHead):
(WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
(WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
(WebCore::HTMLTreeBuilder::processScriptStartTag):
(WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent):
(WebCore::hasAttribute):
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):
(WebCore::HTMLTreeBuilder::parseError):
* html/parser/HTMLTreeBuilder.h:
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::insertFakePreElement):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280198 => 280199)


--- trunk/Source/WebCore/ChangeLog	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/ChangeLog	2021-07-22 22:07:52 UTC (rev 280199)
@@ -1,5 +1,112 @@
 2021-07-22  Yusuke Suzuki  <[email protected]>
 
+        Rename AtomicHTMLToken to AtomHTMLToken
+        https://bugs.webkit.org/show_bug.cgi?id=228196
+
+        Reviewed by Geoffrey Garen.
+
+        We should rename AtomicHTMLToken to AtomHTMLToken as we did for AtomString (AtomicString => AtomString).
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/parser/AtomHTMLToken.h: Renamed from Source/WebCore/html/parser/AtomicHTMLToken.h.
+        (WebCore::AtomHTMLToken::AtomHTMLToken):
+        (WebCore::AtomHTMLToken::type const):
+        (WebCore::AtomHTMLToken::name const):
+        (WebCore::AtomHTMLToken::setName):
+        (WebCore::AtomHTMLToken::selfClosing const):
+        (WebCore::AtomHTMLToken::attributes):
+        (WebCore::AtomHTMLToken::attributes const):
+        (WebCore::AtomHTMLToken::characters const):
+        (WebCore::AtomHTMLToken::charactersLength const):
+        (WebCore::AtomHTMLToken::charactersIsAll8BitData const):
+        (WebCore::AtomHTMLToken::comment const):
+        (WebCore::AtomHTMLToken::forceQuirks const):
+        (WebCore::AtomHTMLToken::publicIdentifier const):
+        (WebCore::AtomHTMLToken::systemIdentifier const):
+        (WebCore::AtomHTMLToken::initializeAttributes):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::setAttributes):
+        (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
+        (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
+        (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
+        (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
+        (WebCore::HTMLConstructionSite::insertDoctype):
+        (WebCore::HTMLConstructionSite::insertComment):
+        (WebCore::HTMLConstructionSite::insertCommentOnDocument):
+        (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
+        (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
+        (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
+        (WebCore::HTMLConstructionSite::insertHTMLFormElement):
+        (WebCore::HTMLConstructionSite::insertHTMLElement):
+        (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
+        (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
+        (WebCore::HTMLConstructionSite::insertFormattingElement):
+        (WebCore::HTMLConstructionSite::insertScriptElement):
+        (WebCore::HTMLConstructionSite::insertForeignElement):
+        (WebCore::HTMLConstructionSite::createElement):
+        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
+        (WebCore::HTMLConstructionSite::createHTMLElement):
+        (WebCore::HTMLConstructionSite::createElementFromSavedToken):
+        * html/parser/HTMLConstructionSite.h:
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken):
+        * html/parser/HTMLStackItem.h:
+        (WebCore::HTMLStackItem::HTMLStackItem):
+        (WebCore::HTMLStackItem::create):
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::ExternalCharacterTokenBuffer):
+        (WebCore::HTMLTreeBuilder::constructTree):
+        (WebCore::HTMLTreeBuilder::processToken):
+        (WebCore::HTMLTreeBuilder::processDoctypeToken):
+        (WebCore::HTMLTreeBuilder::processFakeStartTag):
+        (WebCore::HTMLTreeBuilder::processFakeEndTag):
+        (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
+        (WebCore::shouldClose):
+        (WebCore::adjustSVGTagNameCase):
+        (WebCore::adjustAttributes):
+        (WebCore::adjustSVGAttributes):
+        (WebCore::adjustMathMLAttributes):
+        (WebCore::adjustForeignAttributes):
+        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+        (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
+        (WebCore::HTMLTreeBuilder::processTemplateStartTag):
+        (WebCore::HTMLTreeBuilder::processTemplateEndTag):
+        (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
+        (WebCore::HTMLTreeBuilder::processStartTagForInTable):
+        (WebCore::HTMLTreeBuilder::processStartTag):
+        (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
+        (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
+        (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
+        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+        (WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
+        (WebCore::HTMLTreeBuilder::processEndTagForInRow):
+        (WebCore::HTMLTreeBuilder::processEndTagForInCell):
+        (WebCore::HTMLTreeBuilder::processEndTagForInBody):
+        (WebCore::HTMLTreeBuilder::processEndTagForInTable):
+        (WebCore::HTMLTreeBuilder::processEndTag):
+        (WebCore::HTMLTreeBuilder::processComment):
+        (WebCore::HTMLTreeBuilder::processCharacter):
+        (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
+        (WebCore::HTMLTreeBuilder::processEndOfFile):
+        (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
+        (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
+        (WebCore::HTMLTreeBuilder::defaultForInHead):
+        (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
+        (WebCore::HTMLTreeBuilder::defaultForAfterHead):
+        (WebCore::HTMLTreeBuilder::processStartTagForInHead):
+        (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
+        (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
+        (WebCore::HTMLTreeBuilder::processScriptStartTag):
+        (WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent):
+        (WebCore::hasAttribute):
+        (WebCore::HTMLTreeBuilder::processTokenInForeignContent):
+        (WebCore::HTMLTreeBuilder::parseError):
+        * html/parser/HTMLTreeBuilder.h:
+        * html/parser/TextDocumentParser.cpp:
+        (WebCore::TextDocumentParser::insertFakePreElement):
+
+2021-07-22  Yusuke Suzuki  <[email protected]>
+
         Micro-optimize innerHTML
         https://bugs.webkit.org/show_bug.cgi?id=228142
 

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (280198 => 280199)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-07-22 22:07:52 UTC (rev 280199)
@@ -12204,7 +12204,7 @@
 		97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; };
 		97C1F552122855CB00EDE615 /* HTMLStackItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLStackItem.h; sourceTree = "<group>"; };
 		97C1F552122855CB00EDE616 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLToken.h; sourceTree = "<group>"; };
-		97C1F552122855CB00EDE617 /* AtomicHTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtomicHTMLToken.h; sourceTree = "<group>"; };
+		97C1F552122855CB00EDE617 /* AtomHTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtomHTMLToken.h; sourceTree = "<group>"; };
 		97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContentSecurityPolicy.cpp; path = csp/ContentSecurityPolicy.cpp; sourceTree = "<group>"; };
 		97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContentSecurityPolicy.h; path = csp/ContentSecurityPolicy.h; sourceTree = "<group>"; };
 		97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowProperty.cpp; sourceTree = "<group>"; };
@@ -24593,7 +24593,7 @@
 		97C1F5511228558800EDE616 /* parser */ = {
 			isa = PBXGroup;
 			children = (
-				97C1F552122855CB00EDE617 /* AtomicHTMLToken.h */,
+				97C1F552122855CB00EDE617 /* AtomHTMLToken.h */,
 				977B3849122883E900B81FF8 /* CSSPreloadScanner.cpp */,
 				977B384A122883E900B81FF8 /* CSSPreloadScanner.h */,
 				977B384B122883E900B81FF8 /* HTMLConstructionSite.cpp */,

Copied: trunk/Source/WebCore/html/parser/AtomHTMLToken.h (from rev 280198, trunk/Source/WebCore/html/parser/AtomicHTMLToken.h) (0 => 280199)


--- trunk/Source/WebCore/html/parser/AtomHTMLToken.h	                        (rev 0)
+++ trunk/Source/WebCore/html/parser/AtomHTMLToken.h	2021-07-22 22:07:52 UTC (rev 280199)
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2013 Google, Inc. All Rights Reserved.
+ * Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#pragma once
+
+#include "HTMLToken.h"
+
+namespace WebCore {
+
+class AtomHTMLToken {
+public:
+    explicit AtomHTMLToken(HTMLToken&);
+    AtomHTMLToken(HTMLToken::Type, const AtomString& name, Vector<Attribute>&& = { }); // Only StartTag or EndTag.
+
+    AtomHTMLToken(const AtomHTMLToken&) = delete;
+    AtomHTMLToken(AtomHTMLToken&&) = default;
+
+    HTMLToken::Type type() const;
+
+    // StartTag, EndTag, DOCTYPE.
+
+    void setName(const AtomString&);
+
+    const AtomString& name() const;
+
+    // DOCTYPE.
+
+    bool forceQuirks() const;
+    String publicIdentifier() const;
+    String systemIdentifier() const;
+
+    // StartTag, EndTag.
+
+    Vector<Attribute>& attributes();
+
+    bool selfClosing() const;
+    const Vector<Attribute>& attributes() const;
+
+    // Characters
+
+    const UChar* characters() const;
+    unsigned charactersLength() const;
+    bool charactersIsAll8BitData() const;
+
+    // Comment
+
+    const String& comment() const;
+
+private:
+    HTMLToken::Type m_type;
+
+    void initializeAttributes(const HTMLToken::AttributeList& attributes);
+
+    AtomString m_name; // StartTag, EndTag, DOCTYPE.
+
+    String m_data; // Comment
+
+    // We don't want to copy the characters out of the HTMLToken, so we keep a pointer to its buffer instead.
+    // This buffer is owned by the HTMLToken and causes a lifetime dependence between these objects.
+    // FIXME: Add a mechanism for "internalizing" the characters when the HTMLToken is destroyed.
+    const UChar* m_externalCharacters; // Character
+    unsigned m_externalCharactersLength; // Character
+    bool m_externalCharactersIsAll8BitData; // Character
+
+    std::unique_ptr<DoctypeData> m_doctypeData; // DOCTYPE.
+
+    bool m_selfClosing; // StartTag, EndTag.
+    Vector<Attribute> m_attributes; // StartTag, EndTag.
+};
+
+const Attribute* findAttribute(const Vector<Attribute>&, const QualifiedName&);
+bool hasAttribute(const Vector<Attribute>&, const AtomString& localName);
+
+inline HTMLToken::Type AtomHTMLToken::type() const
+{
+    return m_type;
+}
+
+inline const AtomString& AtomHTMLToken::name() const
+{
+    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE);
+    return m_name;
+}
+
+inline void AtomHTMLToken::setName(const AtomString& name)
+{
+    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE);
+    m_name = name;
+}
+
+inline bool AtomHTMLToken::selfClosing() const
+{
+    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
+    return m_selfClosing;
+}
+
+inline Vector<Attribute>& AtomHTMLToken::attributes()
+{
+    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
+    return m_attributes;
+}
+
+inline const Vector<Attribute>& AtomHTMLToken::attributes() const
+{
+    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
+    return m_attributes;
+}
+
+inline const UChar* AtomHTMLToken::characters() const
+{
+    ASSERT(m_type == HTMLToken::Character);
+    return m_externalCharacters;
+}
+
+inline unsigned AtomHTMLToken::charactersLength() const
+{
+    ASSERT(m_type == HTMLToken::Character);
+    return m_externalCharactersLength;
+}
+
+inline bool AtomHTMLToken::charactersIsAll8BitData() const
+{
+    return m_externalCharactersIsAll8BitData;
+}
+
+inline const String& AtomHTMLToken::comment() const
+{
+    ASSERT(m_type == HTMLToken::Comment);
+    return m_data;
+}
+
+inline bool AtomHTMLToken::forceQuirks() const
+{
+    ASSERT(m_type == HTMLToken::DOCTYPE);
+    return m_doctypeData->forceQuirks;
+}
+
+inline String AtomHTMLToken::publicIdentifier() const
+{
+    ASSERT(m_type == HTMLToken::DOCTYPE);
+    if (!m_doctypeData->hasPublicIdentifier)
+        return String();
+    return StringImpl::create8BitIfPossible(m_doctypeData->publicIdentifier);
+}
+
+inline String AtomHTMLToken::systemIdentifier() const
+{
+    if (!m_doctypeData->hasSystemIdentifier)
+        return String();
+    return StringImpl::create8BitIfPossible(m_doctypeData->systemIdentifier);
+}
+
+inline const Attribute* findAttribute(const Vector<Attribute>& attributes, const QualifiedName& name)
+{
+    for (auto& attribute : attributes) {
+        if (attribute.name().matches(name))
+            return &attribute;
+    }
+    return nullptr;
+}
+
+inline bool hasAttribute(const Vector<Attribute>& attributes, const AtomString& localName)
+{
+    for (auto& attribute : attributes) {
+        if (attribute.localName() == localName)
+            return true;
+    }
+    return false;
+}
+
+inline void AtomHTMLToken::initializeAttributes(const HTMLToken::AttributeList& attributes)
+{
+    unsigned size = attributes.size();
+    if (!size)
+        return;
+
+    m_attributes.reserveInitialCapacity(size);
+    for (auto& attribute : attributes) {
+        if (attribute.name.isEmpty())
+            continue;
+
+        AtomString localName(attribute.name);
+
+        // FIXME: This is N^2 for the number of attributes.
+        if (!hasAttribute(m_attributes, localName))
+            m_attributes.uncheckedAppend(Attribute(QualifiedName(nullAtom(), localName, nullAtom()), AtomString(attribute.value)));
+    }
+}
+
+inline AtomHTMLToken::AtomHTMLToken(HTMLToken& token)
+    : m_type(token.type())
+{
+    switch (m_type) {
+    case HTMLToken::Uninitialized:
+        ASSERT_NOT_REACHED();
+        return;
+    case HTMLToken::DOCTYPE:
+        m_name = AtomString(token.name());
+        m_doctypeData = token.releaseDoctypeData();
+        return;
+    case HTMLToken::EndOfFile:
+        return;
+    case HTMLToken::StartTag:
+    case HTMLToken::EndTag:
+        m_selfClosing = token.selfClosing();
+        m_name = AtomString(token.name());
+        initializeAttributes(token.attributes());
+        return;
+    case HTMLToken::Comment:
+        if (token.commentIsAll8BitData())
+            m_data = String::make8BitFrom16BitSource(token.comment());
+        else
+            m_data = String(token.comment());
+        return;
+    case HTMLToken::Character:
+        m_externalCharacters = token.characters().data();
+        m_externalCharactersLength = token.characters().size();
+        m_externalCharactersIsAll8BitData = token.charactersIsAll8BitData();
+        return;
+    }
+    ASSERT_NOT_REACHED();
+}
+
+inline AtomHTMLToken::AtomHTMLToken(HTMLToken::Type type, const AtomString& name, Vector<Attribute>&& attributes)
+    : m_type(type)
+    , m_name(name)
+    , m_selfClosing(false)
+    , m_attributes(WTFMove(attributes))
+{
+    ASSERT(type == HTMLToken::StartTag || type == HTMLToken::EndTag);
+}
+
+} // namespace WebCore

Deleted: trunk/Source/WebCore/html/parser/AtomicHTMLToken.h (280198 => 280199)


--- trunk/Source/WebCore/html/parser/AtomicHTMLToken.h	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/AtomicHTMLToken.h	2021-07-22 22:07:52 UTC (rev 280199)
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2013 Google, Inc. All Rights Reserved.
- * Copyright (C) 2015 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#pragma once
-
-#include "HTMLToken.h"
-
-namespace WebCore {
-
-class AtomicHTMLToken {
-public:
-    explicit AtomicHTMLToken(HTMLToken&);
-    AtomicHTMLToken(HTMLToken::Type, const AtomString& name, Vector<Attribute>&& = { }); // Only StartTag or EndTag.
-
-    AtomicHTMLToken(const AtomicHTMLToken&) = delete;
-    AtomicHTMLToken(AtomicHTMLToken&&) = default;
-
-    HTMLToken::Type type() const;
-
-    // StartTag, EndTag, DOCTYPE.
-
-    void setName(const AtomString&);
-
-    const AtomString& name() const;
-
-    // DOCTYPE.
-
-    bool forceQuirks() const;
-    String publicIdentifier() const;
-    String systemIdentifier() const;
-
-    // StartTag, EndTag.
-
-    Vector<Attribute>& attributes();
-
-    bool selfClosing() const;
-    const Vector<Attribute>& attributes() const;
-
-    // Characters
-
-    const UChar* characters() const;
-    unsigned charactersLength() const;
-    bool charactersIsAll8BitData() const;
-
-    // Comment
-
-    const String& comment() const;
-
-private:
-    HTMLToken::Type m_type;
-
-    void initializeAttributes(const HTMLToken::AttributeList& attributes);
-
-    AtomString m_name; // StartTag, EndTag, DOCTYPE.
-
-    String m_data; // Comment
-
-    // We don't want to copy the characters out of the HTMLToken, so we keep a pointer to its buffer instead.
-    // This buffer is owned by the HTMLToken and causes a lifetime dependence between these objects.
-    // FIXME: Add a mechanism for "internalizing" the characters when the HTMLToken is destroyed.
-    const UChar* m_externalCharacters; // Character
-    unsigned m_externalCharactersLength; // Character
-    bool m_externalCharactersIsAll8BitData; // Character
-
-    std::unique_ptr<DoctypeData> m_doctypeData; // DOCTYPE.
-
-    bool m_selfClosing; // StartTag, EndTag.
-    Vector<Attribute> m_attributes; // StartTag, EndTag.
-};
-
-const Attribute* findAttribute(const Vector<Attribute>&, const QualifiedName&);
-bool hasAttribute(const Vector<Attribute>&, const AtomString& localName);
-
-inline HTMLToken::Type AtomicHTMLToken::type() const
-{
-    return m_type;
-}
-
-inline const AtomString& AtomicHTMLToken::name() const
-{
-    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE);
-    return m_name;
-}
-
-inline void AtomicHTMLToken::setName(const AtomString& name)
-{
-    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE);
-    m_name = name;
-}
-
-inline bool AtomicHTMLToken::selfClosing() const
-{
-    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
-    return m_selfClosing;
-}
-
-inline Vector<Attribute>& AtomicHTMLToken::attributes()
-{
-    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
-    return m_attributes;
-}
-
-inline const Vector<Attribute>& AtomicHTMLToken::attributes() const
-{
-    ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
-    return m_attributes;
-}
-
-inline const UChar* AtomicHTMLToken::characters() const
-{
-    ASSERT(m_type == HTMLToken::Character);
-    return m_externalCharacters;
-}
-
-inline unsigned AtomicHTMLToken::charactersLength() const
-{
-    ASSERT(m_type == HTMLToken::Character);
-    return m_externalCharactersLength;
-}
-
-inline bool AtomicHTMLToken::charactersIsAll8BitData() const
-{
-    return m_externalCharactersIsAll8BitData;
-}
-
-inline const String& AtomicHTMLToken::comment() const
-{
-    ASSERT(m_type == HTMLToken::Comment);
-    return m_data;
-}
-
-inline bool AtomicHTMLToken::forceQuirks() const
-{
-    ASSERT(m_type == HTMLToken::DOCTYPE);
-    return m_doctypeData->forceQuirks;
-}
-
-inline String AtomicHTMLToken::publicIdentifier() const
-{
-    ASSERT(m_type == HTMLToken::DOCTYPE);
-    if (!m_doctypeData->hasPublicIdentifier)
-        return String();
-    return StringImpl::create8BitIfPossible(m_doctypeData->publicIdentifier);
-}
-
-inline String AtomicHTMLToken::systemIdentifier() const
-{
-    if (!m_doctypeData->hasSystemIdentifier)
-        return String();
-    return StringImpl::create8BitIfPossible(m_doctypeData->systemIdentifier);
-}
-
-inline const Attribute* findAttribute(const Vector<Attribute>& attributes, const QualifiedName& name)
-{
-    for (auto& attribute : attributes) {
-        if (attribute.name().matches(name))
-            return &attribute;
-    }
-    return nullptr;
-}
-
-inline bool hasAttribute(const Vector<Attribute>& attributes, const AtomString& localName)
-{
-    for (auto& attribute : attributes) {
-        if (attribute.localName() == localName)
-            return true;
-    }
-    return false;
-}
-
-inline void AtomicHTMLToken::initializeAttributes(const HTMLToken::AttributeList& attributes)
-{
-    unsigned size = attributes.size();
-    if (!size)
-        return;
-
-    m_attributes.reserveInitialCapacity(size);
-    for (auto& attribute : attributes) {
-        if (attribute.name.isEmpty())
-            continue;
-
-        AtomString localName(attribute.name);
-
-        // FIXME: This is N^2 for the number of attributes.
-        if (!hasAttribute(m_attributes, localName))
-            m_attributes.uncheckedAppend(Attribute(QualifiedName(nullAtom(), localName, nullAtom()), AtomString(attribute.value)));
-    }
-}
-
-inline AtomicHTMLToken::AtomicHTMLToken(HTMLToken& token)
-    : m_type(token.type())
-{
-    switch (m_type) {
-    case HTMLToken::Uninitialized:
-        ASSERT_NOT_REACHED();
-        return;
-    case HTMLToken::DOCTYPE:
-        m_name = AtomString(token.name());
-        m_doctypeData = token.releaseDoctypeData();
-        return;
-    case HTMLToken::EndOfFile:
-        return;
-    case HTMLToken::StartTag:
-    case HTMLToken::EndTag:
-        m_selfClosing = token.selfClosing();
-        m_name = AtomString(token.name());
-        initializeAttributes(token.attributes());
-        return;
-    case HTMLToken::Comment:
-        if (token.commentIsAll8BitData())
-            m_data = String::make8BitFrom16BitSource(token.comment());
-        else
-            m_data = String(token.comment());
-        return;
-    case HTMLToken::Character:
-        m_externalCharacters = token.characters().data();
-        m_externalCharactersLength = token.characters().size();
-        m_externalCharactersIsAll8BitData = token.charactersIsAll8BitData();
-        return;
-    }
-    ASSERT_NOT_REACHED();
-}
-
-inline AtomicHTMLToken::AtomicHTMLToken(HTMLToken::Type type, const AtomString& name, Vector<Attribute>&& attributes)
-    : m_type(type)
-    , m_name(name)
-    , m_selfClosing(false)
-    , m_attributes(WTFMove(attributes))
-{
-    ASSERT(type == HTMLToken::StartTag || type == HTMLToken::EndTag);
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2021-07-22 22:07:52 UTC (rev 280199)
@@ -62,7 +62,7 @@
     element.parserSetAttributes(attributes);
 }
 
-static inline void setAttributes(Element& element, AtomicHTMLToken& token, ParserContentPolicy parserContentPolicy)
+static inline void setAttributes(Element& element, AtomHTMLToken& token, ParserContentPolicy parserContentPolicy)
 {
     setAttributes(element, token.attributes(), parserContentPolicy);
 }
@@ -273,7 +273,7 @@
         frame->injectUserScripts(UserScriptInjectionTime::DocumentStart);
 }
 
-void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomHTMLToken&& token)
 {
     auto element = HTMLHtmlElement::create(m_document);
     setAttributes(element, token, m_parserContentPolicy);
@@ -285,7 +285,7 @@
     dispatchDocumentElementAvailableIfNeeded();
 }
 
-void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomicHTMLToken&& token, Element& element)
+void HTMLConstructionSite::mergeAttributesFromTokenIntoElement(AtomHTMLToken&& token, Element& element)
 {
     if (token.attributes().isEmpty())
         return;
@@ -296,7 +296,7 @@
     }
 }
 
-void HTMLConstructionSite::insertHTMLHtmlStartTagInBody(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLHtmlStartTagInBody(AtomHTMLToken&& token)
 {
     // Fragments do not have a root HTML element, so any additional HTML elements
     // encountered during fragment parsing should be ignored.
@@ -306,7 +306,7 @@
     mergeAttributesFromTokenIntoElement(WTFMove(token), m_openElements.htmlElement());
 }
 
-void HTMLConstructionSite::insertHTMLBodyStartTagInBody(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLBodyStartTagInBody(AtomHTMLToken&& token)
 {
     mergeAttributesFromTokenIntoElement(WTFMove(token), m_openElements.bodyElement());
 }
@@ -419,7 +419,7 @@
     m_document.finishedParsing();
 }
 
-void HTMLConstructionSite::insertDoctype(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertDoctype(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::DOCTYPE);
 
@@ -443,19 +443,19 @@
         setCompatibilityModeFromDoctype(token.name(), publicId, systemId);
 }
 
-void HTMLConstructionSite::insertComment(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertComment(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::Comment);
     attachLater(currentNode(), Comment::create(ownerDocumentForCurrentNode(), token.comment()));
 }
 
-void HTMLConstructionSite::insertCommentOnDocument(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertCommentOnDocument(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::Comment);
     attachLater(m_attachmentRoot, Comment::create(m_document, token.comment()));
 }
 
-void HTMLConstructionSite::insertCommentOnHTMLHtmlElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertCommentOnHTMLHtmlElement(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::Comment);
     ContainerNode& parent = m_openElements.rootNode();
@@ -462,7 +462,7 @@
     attachLater(parent, Comment::create(parent.document(), token.comment()));
 }
 
-void HTMLConstructionSite::insertHTMLHeadElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLHeadElement(AtomHTMLToken&& token)
 {
     ASSERT(!shouldFosterParent());
     m_head = HTMLStackItem::create(createHTMLElement(token), WTFMove(token));
@@ -470,7 +470,7 @@
     m_openElements.pushHTMLHeadElement(*m_head);
 }
 
-void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLBodyElement(AtomHTMLToken&& token)
 {
     ASSERT(!shouldFosterParent());
     auto body = createHTMLElement(token);
@@ -478,7 +478,7 @@
     m_openElements.pushHTMLBodyElement(HTMLStackItem::create(WTFMove(body), WTFMove(token)));
 }
 
-void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken&& token, bool isDemoted)
+void HTMLConstructionSite::insertHTMLFormElement(AtomHTMLToken&& token, bool isDemoted)
 {
     auto element = createHTMLElement(token);
     auto& formElement = downcast<HTMLFormElement>(element.get());
@@ -491,7 +491,7 @@
     m_openElements.push(HTMLStackItem::create(formElement, WTFMove(token)));
 }
 
-void HTMLConstructionSite::insertHTMLElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertHTMLElement(AtomHTMLToken&& token)
 {
     auto element = createHTMLElement(token);
     attachLater(currentNode(), element.copyRef());
@@ -498,7 +498,7 @@
     m_openElements.push(HTMLStackItem::create(WTFMove(element), WTFMove(token)));
 }
 
-std::unique_ptr<CustomElementConstructionData> HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface(AtomicHTMLToken&& token)
+std::unique_ptr<CustomElementConstructionData> HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface(AtomHTMLToken&& token)
 {
     JSCustomElementInterface* elementInterface = nullptr;
     RefPtr<Element> element = createHTMLElementOrFindCustomElementInterface(token, &elementInterface);
@@ -517,7 +517,7 @@
     executeQueuedTasks();
 }
 
-void HTMLConstructionSite::insertSelfClosingHTMLElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertSelfClosingHTMLElement(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     // Normally HTMLElementStack is responsible for calling finishParsingChildren,
@@ -528,7 +528,7 @@
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#acknowledge-self-closing-flag
 }
 
-void HTMLConstructionSite::insertFormattingElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertFormattingElement(AtomHTMLToken&& token)
 {
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#the-stack-of-open-elements
     // Possible active formatting elements include:
@@ -538,7 +538,7 @@
     m_activeFormattingElements.append(currentStackItem());
 }
 
-void HTMLConstructionSite::insertScriptElement(AtomicHTMLToken&& token)
+void HTMLConstructionSite::insertScriptElement(AtomHTMLToken&& token)
 {
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#already-started
     // http://html5.org/specs/dom-parsing.html#dom-range-createcontextualfragment
@@ -554,7 +554,7 @@
     m_openElements.push(HTMLStackItem::create(WTFMove(element), WTFMove(token)));
 }
 
-void HTMLConstructionSite::insertForeignElement(AtomicHTMLToken&& token, const AtomString& namespaceURI)
+void HTMLConstructionSite::insertForeignElement(AtomHTMLToken&& token, const AtomString& namespaceURI)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     notImplemented(); // parseError when xmlns or xmlns:xlink are wrong.
@@ -635,7 +635,7 @@
     m_taskQueue.append(WTFMove(task));
 }
 
-Ref<Element> HTMLConstructionSite::createElement(AtomicHTMLToken& token, const AtomString& namespaceURI)
+Ref<Element> HTMLConstructionSite::createElement(AtomHTMLToken& token, const AtomString& namespaceURI)
 {
     QualifiedName tagName(nullAtom(), token.name(), namespaceURI);
     auto element = ownerDocumentForCurrentNode().createElement(tagName, true);
@@ -663,7 +663,7 @@
     return registry->findInterface(localName);
 }
 
-RefPtr<Element> HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface(AtomicHTMLToken& token, JSCustomElementInterface** customElementInterface)
+RefPtr<Element> HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface(AtomHTMLToken& token, JSCustomElementInterface** customElementInterface)
 {
     auto& localName = token.name();
     // FIXME: This can't use HTMLConstructionSite::createElement because we
@@ -706,7 +706,7 @@
     return element;
 }
 
-Ref<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& token)
+Ref<Element> HTMLConstructionSite::createHTMLElement(AtomHTMLToken& token)
 {
     RefPtr<Element> element = createHTMLElementOrFindCustomElementInterface(token, nullptr);
     ASSERT(element);
@@ -716,7 +716,7 @@
 Ref<HTMLStackItem> HTMLConstructionSite::createElementFromSavedToken(HTMLStackItem& item)
 {
     // NOTE: Moving from item -> token -> item copies the Attribute vector twice!
-    AtomicHTMLToken fakeToken(HTMLToken::StartTag, item.localName(), Vector<Attribute>(item.attributes()));
+    AtomHTMLToken fakeToken(HTMLToken::StartTag, item.localName(), Vector<Attribute>(item.attributes()));
     ASSERT(item.namespaceURI() == HTMLNames::xhtmlNamespaceURI);
     ASSERT(isFormattingTag(item.localName()));
     return HTMLStackItem::create(createHTMLElement(fakeToken), WTFMove(fakeToken), item.namespaceURI());

Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.h (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2021-07-22 22:07:52 UTC (rev 280199)
@@ -79,7 +79,7 @@
     WhitespaceUnknown
 };
 
-class AtomicHTMLToken;
+class AtomHTMLToken;
 struct CustomElementConstructionData;
 class Document;
 class Element;
@@ -98,25 +98,25 @@
     void setDefaultCompatibilityMode();
     void finishedParsing();
 
-    void insertDoctype(AtomicHTMLToken&&);
-    void insertComment(AtomicHTMLToken&&);
-    void insertCommentOnDocument(AtomicHTMLToken&&);
-    void insertCommentOnHTMLHtmlElement(AtomicHTMLToken&&);
-    void insertHTMLElement(AtomicHTMLToken&&);
-    std::unique_ptr<CustomElementConstructionData> insertHTMLElementOrFindCustomElementInterface(AtomicHTMLToken&&);
+    void insertDoctype(AtomHTMLToken&&);
+    void insertComment(AtomHTMLToken&&);
+    void insertCommentOnDocument(AtomHTMLToken&&);
+    void insertCommentOnHTMLHtmlElement(AtomHTMLToken&&);
+    void insertHTMLElement(AtomHTMLToken&&);
+    std::unique_ptr<CustomElementConstructionData> insertHTMLElementOrFindCustomElementInterface(AtomHTMLToken&&);
     void insertCustomElement(Ref<Element>&&, const AtomString& localName, Vector<Attribute>&&);
-    void insertSelfClosingHTMLElement(AtomicHTMLToken&&);
-    void insertFormattingElement(AtomicHTMLToken&&);
-    void insertHTMLHeadElement(AtomicHTMLToken&&);
-    void insertHTMLBodyElement(AtomicHTMLToken&&);
-    void insertHTMLFormElement(AtomicHTMLToken&&, bool isDemoted = false);
-    void insertScriptElement(AtomicHTMLToken&&);
+    void insertSelfClosingHTMLElement(AtomHTMLToken&&);
+    void insertFormattingElement(AtomHTMLToken&&);
+    void insertHTMLHeadElement(AtomHTMLToken&&);
+    void insertHTMLBodyElement(AtomHTMLToken&&);
+    void insertHTMLFormElement(AtomHTMLToken&&, bool isDemoted = false);
+    void insertScriptElement(AtomHTMLToken&&);
     void insertTextNode(String&&, WhitespaceMode = WhitespaceUnknown);
-    void insertForeignElement(AtomicHTMLToken&&, const AtomString& namespaceURI);
+    void insertForeignElement(AtomHTMLToken&&, const AtomString& namespaceURI);
 
-    void insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken&&);
-    void insertHTMLHtmlStartTagInBody(AtomicHTMLToken&&);
-    void insertHTMLBodyStartTagInBody(AtomicHTMLToken&&);
+    void insertHTMLHtmlStartTagBeforeHTML(AtomHTMLToken&&);
+    void insertHTMLHtmlStartTagInBody(AtomHTMLToken&&);
+    void insertHTMLBodyStartTagInBody(AtomHTMLToken&&);
 
     void reparent(HTMLElementStack::ElementRecord& newParent, HTMLElementStack::ElementRecord& child);
     // insertAlreadyParsedChild assumes that |child| has already been parsed (i.e., we're just
@@ -186,11 +186,11 @@
 
     void findFosterSite(HTMLConstructionSiteTask&);
 
-    RefPtr<Element> createHTMLElementOrFindCustomElementInterface(AtomicHTMLToken&, JSCustomElementInterface**);
-    Ref<Element> createHTMLElement(AtomicHTMLToken&);
-    Ref<Element> createElement(AtomicHTMLToken&, const AtomString& namespaceURI);
+    RefPtr<Element> createHTMLElementOrFindCustomElementInterface(AtomHTMLToken&, JSCustomElementInterface**);
+    Ref<Element> createHTMLElement(AtomHTMLToken&);
+    Ref<Element> createElement(AtomHTMLToken&, const AtomString& namespaceURI);
 
-    void mergeAttributesFromTokenIntoElement(AtomicHTMLToken&&, Element&);
+    void mergeAttributesFromTokenIntoElement(AtomHTMLToken&&, Element&);
     void dispatchDocumentElementAvailableIfNeeded();
 
     Document& m_document;

Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2021-07-22 22:07:52 UTC (rev 280199)
@@ -353,11 +353,11 @@
 
 void HTMLDocumentParser::constructTreeFromHTMLToken(HTMLTokenizer::TokenPtr& rawToken)
 {
-    AtomicHTMLToken token(*rawToken);
+    AtomHTMLToken token(*rawToken);
 
     // We clear the rawToken in case constructTree
     // synchronously re-enters the parser. We don't clear the token immedately
-    // for Character tokens because the AtomicHTMLToken avoids copying the
+    // for Character tokens because the AtomHTMLToken avoids copying the
     // characters by keeping a pointer to the underlying buffer in the
     // HTMLToken. Fortunately, Character tokens can't cause us to re-enter
     // the parser.

Modified: trunk/Source/WebCore/html/parser/HTMLStackItem.h (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLStackItem.h	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLStackItem.h	2021-07-22 22:07:52 UTC (rev 280199)
@@ -26,7 +26,7 @@
 
 #pragma once
 
-#include "AtomicHTMLToken.h"
+#include "AtomHTMLToken.h"
 #include "DocumentFragment.h"
 #include "Element.h"
 #include "HTMLNames.h"
@@ -38,7 +38,7 @@
 class HTMLStackItem : public RefCounted<HTMLStackItem> {
 public:
     // Normal HTMLElementStack and HTMLFormattingElementList items.
-    static Ref<HTMLStackItem> create(Ref<Element>&&, AtomicHTMLToken&&, const AtomString& namespaceURI = HTMLNames::xhtmlNamespaceURI);
+    static Ref<HTMLStackItem> create(Ref<Element>&&, AtomHTMLToken&&, const AtomString& namespaceURI = HTMLNames::xhtmlNamespaceURI);
     static Ref<HTMLStackItem> create(Ref<Element>&&, const AtomString&, Vector<Attribute>&&);
 
     // Document fragment or element for parsing context.
@@ -61,7 +61,7 @@
     bool matchesHTMLTag(const AtomString&) const;
 
 private:
-    HTMLStackItem(Ref<Element>&&, AtomicHTMLToken&&, const AtomString& namespaceURI);
+    HTMLStackItem(Ref<Element>&&, AtomHTMLToken&&, const AtomString& namespaceURI);
     HTMLStackItem(Ref<Element>&&, const AtomString& localName, const AtomString& namespaceURI, Vector<Attribute>&&);
     explicit HTMLStackItem(Element&);
     explicit HTMLStackItem(DocumentFragment&);
@@ -76,7 +76,7 @@
 bool isNumberedHeaderElement(const HTMLStackItem&);
 bool isSpecialNode(const HTMLStackItem&);
 
-inline HTMLStackItem::HTMLStackItem(Ref<Element>&& element, AtomicHTMLToken&& token, const AtomString& namespaceURI = HTMLNames::xhtmlNamespaceURI)
+inline HTMLStackItem::HTMLStackItem(Ref<Element>&& element, AtomHTMLToken&& token, const AtomString& namespaceURI = HTMLNames::xhtmlNamespaceURI)
     : m_node(WTFMove(element))
     , m_namespaceURI(namespaceURI)
     , m_localName(token.name())
@@ -84,7 +84,7 @@
 {
 }
 
-inline Ref<HTMLStackItem> HTMLStackItem::create(Ref<Element>&& element, AtomicHTMLToken&& token, const AtomString& namespaceURI)
+inline Ref<HTMLStackItem> HTMLStackItem::create(Ref<Element>&& element, AtomHTMLToken&& token, const AtomString& namespaceURI)
 {
     return adoptRef(*new HTMLStackItem(WTFMove(element), WTFMove(token), namespaceURI));
 }

Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2021-07-22 22:07:52 UTC (rev 280199)
@@ -144,7 +144,7 @@
 
 class HTMLTreeBuilder::ExternalCharacterTokenBuffer {
 public:
-    explicit ExternalCharacterTokenBuffer(AtomicHTMLToken& token)
+    explicit ExternalCharacterTokenBuffer(AtomHTMLToken& token)
         : m_text(token.characters(), token.charactersLength())
         , m_isAll8BitData(token.charactersIsAll8BitData())
     {
@@ -333,7 +333,7 @@
     return WTFMove(m_scriptToProcess);
 }
 
-void HTMLTreeBuilder::constructTree(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::constructTree(AtomHTMLToken&& token)
 {
 #if ASSERT_ENABLED
     ASSERT(!m_destroyed);
@@ -362,7 +362,7 @@
     // The tree builder might have been destroyed as an indirect result of executing the queued tasks.
 }
 
-void HTMLTreeBuilder::processToken(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processToken(AtomHTMLToken&& token)
 {
     switch (token.type()) {
     case HTMLToken::Uninitialized:
@@ -394,7 +394,7 @@
     }
 }
 
-void HTMLTreeBuilder::processDoctypeToken(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processDoctypeToken(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::DOCTYPE);
     if (m_insertionMode == InsertionMode::Initial) {
@@ -413,13 +413,13 @@
 void HTMLTreeBuilder::processFakeStartTag(const QualifiedName& tagName, Vector<Attribute>&& attributes)
 {
     // FIXME: We'll need a fancier conversion than just "localName" for SVG/MathML tags.
-    AtomicHTMLToken fakeToken(HTMLToken::StartTag, tagName.localName(), WTFMove(attributes));
+    AtomHTMLToken fakeToken(HTMLToken::StartTag, tagName.localName(), WTFMove(attributes));
     processStartTag(WTFMove(fakeToken));
 }
 
 void HTMLTreeBuilder::processFakeEndTag(const AtomString& tagName)
 {
-    AtomicHTMLToken fakeToken(HTMLToken::EndTag, tagName);
+    AtomHTMLToken fakeToken(HTMLToken::EndTag, tagName);
     processEndTag(WTFMove(fakeToken));
 }
 
@@ -433,7 +433,7 @@
 {
     if (!m_tree.openElements().inButtonScope(pTag->localName()))
         return;
-    AtomicHTMLToken endP(HTMLToken::EndTag, pTag->localName());
+    AtomHTMLToken endP(HTMLToken::EndTag, pTag->localName());
     processEndTag(WTFMove(endP));
 }
 
@@ -451,7 +451,7 @@
 
 }
 
-template <bool shouldClose(const HTMLStackItem&)> void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken&& token)
+template <bool shouldClose(const HTMLStackItem&)> void HTMLTreeBuilder::processCloseWhenNestedTag(AtomHTMLToken&& token)
 {
     m_framesetOk = false;
     for (auto* nodeRecord = &m_tree.openElements().topRecord(); ; nodeRecord = nodeRecord->next()) {
@@ -481,7 +481,7 @@
     return map;
 }
 
-static void adjustSVGTagNameCase(AtomicHTMLToken& token)
+static void adjustSVGTagNameCase(AtomHTMLToken& token)
 {
     static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, QualifiedName>> map = createCaseMap(SVGNames::getSVGTags(), SVGNames::SVGTagsCount);
     const QualifiedName& casedName = map.get().get(token.name());
@@ -490,7 +490,7 @@
     token.setName(casedName.localName());
 }
 
-static inline void adjustAttributes(const MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, QualifiedName>& map, AtomicHTMLToken& token)
+static inline void adjustAttributes(const MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, QualifiedName>& map, AtomHTMLToken& token)
 {
     for (auto& attribute : token.attributes()) {
         const QualifiedName& casedName = map.get(attribute.localName());
@@ -499,18 +499,18 @@
     }
 }
 
-template<const QualifiedName* const* attributesTable(), unsigned attributesTableLength> static void adjustAttributes(AtomicHTMLToken& token)
+template<const QualifiedName* const* attributesTable(), unsigned attributesTableLength> static void adjustAttributes(AtomHTMLToken& token)
 {
     static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, QualifiedName>> map = createCaseMap(attributesTable(), attributesTableLength);
     adjustAttributes(map, token);
 }
 
-static inline void adjustSVGAttributes(AtomicHTMLToken& token)
+static inline void adjustSVGAttributes(AtomHTMLToken& token)
 {
     adjustAttributes<SVGNames::getSVGAttrs, SVGNames::SVGAttrsCount>(token);
 }
 
-static inline void adjustMathMLAttributes(AtomicHTMLToken& token)
+static inline void adjustMathMLAttributes(AtomHTMLToken& token)
 {
     adjustAttributes<MathMLNames::getMathMLAttrs, MathMLNames::MathMLAttrsCount>(token);
 }
@@ -537,13 +537,13 @@
     return map;
 }
 
-static void adjustForeignAttributes(AtomicHTMLToken& token)
+static void adjustForeignAttributes(AtomHTMLToken& token)
 {
     static NeverDestroyed<MemoryCompactLookupOnlyRobinHoodHashMap<AtomString, QualifiedName>> map = createForeignAttributesMap();
     adjustAttributes(map, token);
 }
 
-void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processStartTagForInBody(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     if (token.name() == htmlTag) {
@@ -801,7 +801,7 @@
     }
     if (token.name() == optgroupTag || token.name() == optionTag) {
         if (is<HTMLOptionElement>(m_tree.currentStackItem().node())) {
-            AtomicHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
+            AtomHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
             processEndTag(WTFMove(endOption));
         }
         m_tree.reconstructTheActiveFormattingElements();
@@ -858,7 +858,7 @@
     insertGenericHTMLElement(WTFMove(token));
 }
 
-inline void HTMLTreeBuilder::insertGenericHTMLElement(AtomicHTMLToken&& token)
+inline void HTMLTreeBuilder::insertGenericHTMLElement(AtomHTMLToken&& token)
 {
     m_customElementToConstruct = m_tree.insertHTMLElementOrFindCustomElementInterface(WTFMove(token));
 }
@@ -868,7 +868,7 @@
     m_tree.insertCustomElement(WTFMove(element), data.name, WTFMove(data.attributes));
 }
 
-void HTMLTreeBuilder::processTemplateStartTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processTemplateStartTag(AtomHTMLToken&& token)
 {
     m_tree.activeFormattingElements().appendMarker();
     m_tree.insertHTMLElement(WTFMove(token));
@@ -876,7 +876,7 @@
     m_insertionMode = InsertionMode::TemplateContents;
 }
 
-bool HTMLTreeBuilder::processTemplateEndTag(AtomicHTMLToken&& token)
+bool HTMLTreeBuilder::processTemplateEndTag(AtomHTMLToken&& token)
 {
     ASSERT(token.name() == templateTag->localName());
     if (!m_tree.openElements().hasTemplateInHTMLScope()) {
@@ -894,9 +894,9 @@
     return true;
 }
 
-bool HTMLTreeBuilder::processEndOfFileForInTemplateContents(AtomicHTMLToken&& token)
+bool HTMLTreeBuilder::processEndOfFileForInTemplateContents(AtomHTMLToken&& token)
 {
-    AtomicHTMLToken endTemplate(HTMLToken::EndTag, templateTag->localName());
+    AtomHTMLToken endTemplate(HTMLToken::EndTag, templateTag->localName());
     if (!processTemplateEndTag(WTFMove(endTemplate)))
         return false;
 
@@ -932,7 +932,7 @@
     ASSERT(m_insertionMode == InsertionMode::InRow);
 }
 
-void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processStartTagForInTable(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     if (token.name() == captionTag) {
@@ -1005,7 +1005,7 @@
     processStartTagForInBody(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processStartTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processStartTag(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     switch (m_insertionMode) {
@@ -1257,7 +1257,7 @@
             || token.name() == trTag
             || isTableCellContextTag(token.name())) {
             parseError(token);
-            AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
+            AtomHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
             processEndTag(WTFMove(endSelect));
             processStartTag(WTFMove(token));
             return;
@@ -1270,7 +1270,7 @@
         }
         if (token.name() == optionTag) {
             if (is<HTMLOptionElement>(m_tree.currentStackItem().node())) {
-                AtomicHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
+                AtomHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
                 processEndTag(WTFMove(endOption));
             }
             m_tree.insertHTMLElement(WTFMove(token));
@@ -1278,11 +1278,11 @@
         }
         if (token.name() == optgroupTag) {
             if (is<HTMLOptionElement>(m_tree.currentStackItem().node())) {
-                AtomicHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
+                AtomHTMLToken endOption(HTMLToken::EndTag, optionTag->localName());
                 processEndTag(WTFMove(endOption));
             }
             if (is<HTMLOptGroupElement>(m_tree.currentStackItem().node())) {
-                AtomicHTMLToken endOptgroup(HTMLToken::EndTag, optgroupTag->localName());
+                AtomHTMLToken endOptgroup(HTMLToken::EndTag, optgroupTag->localName());
                 processEndTag(WTFMove(endOptgroup));
             }
             m_tree.insertHTMLElement(WTFMove(token));
@@ -1290,7 +1290,7 @@
         }
         if (token.name() == selectTag) {
             parseError(token);
-            AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
+            AtomHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
             processEndTag(WTFMove(endSelect));
             return;
         }
@@ -1300,7 +1300,7 @@
                 ASSERT(isParsingFragment());
                 return;
             }
-            AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
+            AtomHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
             processEndTag(WTFMove(endSelect));
             processStartTag(WTFMove(token));
             return;
@@ -1358,7 +1358,7 @@
     }
 }
 
-void HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processHtmlStartTagForInBody(AtomHTMLToken&& token)
 {
     parseError(token);
     if (m_tree.openElements().hasTemplateInHTMLScope()) {
@@ -1368,7 +1368,7 @@
     m_tree.insertHTMLHtmlStartTagInBody(WTFMove(token));
 }
 
-bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomicHTMLToken&& token)
+bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     ASSERT(token.name() == bodyTag);
@@ -1381,7 +1381,7 @@
     return true;
 }
 
-void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     for (auto* record = &m_tree.openElements().topRecord(); ; record = record->next()) {
@@ -1401,7 +1401,7 @@
 }
 
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
-void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
+void HTMLTreeBuilder::callTheAdoptionAgency(AtomHTMLToken& token)
 {
     // The adoption agency algorithm is N^2. We limit the number of iterations
     // to stop from hanging the whole browser. This limit is specified in the
@@ -1583,7 +1583,7 @@
     }
 }
 
-void HTMLTreeBuilder::processEndTagForInTableBody(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTagForInTableBody(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     if (isTableBodyContextTag(token.name())) {
@@ -1620,7 +1620,7 @@
     processEndTagForInTable(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processEndTagForInRow(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTagForInRow(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     if (token.name() == trTag) {
@@ -1656,7 +1656,7 @@
     processEndTagForInTable(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTagForInCell(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     if (isTableCellContextTag(token.name())) {
@@ -1693,7 +1693,7 @@
     processEndTagForInBody(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTagForInBody(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     if (token.name() == bodyTag) {
@@ -1701,7 +1701,7 @@
         return;
     }
     if (token.name() == htmlTag) {
-        AtomicHTMLToken endBody(HTMLToken::EndTag, bodyTag->localName());
+        AtomHTMLToken endBody(HTMLToken::EndTag, bodyTag->localName());
         if (processBodyEndTagForInBody(WTFMove(endBody)))
             processEndTag(WTFMove(token));
         return;
@@ -1879,7 +1879,7 @@
     return true;
 }
 
-void HTMLTreeBuilder::processEndTagForInTable(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTagForInTable(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     if (token.name() == tableTag) {
@@ -1901,7 +1901,7 @@
     processEndTagForInBody(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processEndTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndTag(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndTag);
     switch (m_insertionMode) {
@@ -2096,7 +2096,7 @@
             || isTableCellContextTag(token.name())) {
             parseError(token);
             if (m_tree.openElements().inTableScope(token.name())) {
-                AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
+                AtomHTMLToken endSelect(HTMLToken::EndTag, selectTag->localName());
                 processEndTag(WTFMove(endSelect));
                 processEndTag(WTFMove(token));
             }
@@ -2151,7 +2151,7 @@
     }
 }
 
-void HTMLTreeBuilder::processComment(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processComment(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::Comment);
     if (m_insertionMode == InsertionMode::Initial
@@ -2173,7 +2173,7 @@
     m_tree.insertComment(WTFMove(token));
 }
 
-void HTMLTreeBuilder::processCharacter(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processCharacter(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::Character);
     ExternalCharacterTokenBuffer buffer(token);
@@ -2190,8 +2190,8 @@
     attributes.append(Attribute(HTMLNames::hrefAttr, makeString("tel:"_s, string)));
 
     const AtomString& aTagLocalName = aTag->localName();
-    AtomicHTMLToken aStartToken(HTMLToken::StartTag, aTagLocalName, WTFMove(attributes));
-    AtomicHTMLToken aEndToken(HTMLToken::EndTag, aTagLocalName);
+    AtomHTMLToken aStartToken(HTMLToken::StartTag, aTagLocalName, WTFMove(attributes));
+    AtomHTMLToken aEndToken(HTMLToken::EndTag, aTagLocalName);
 
     processStartTag(WTFMove(aStartToken));
     m_tree.executeQueuedTasks();
@@ -2432,7 +2432,7 @@
 #endif
 }
 
-void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processEndOfFile(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::EndOfFile);
     switch (m_insertionMode) {
@@ -2528,7 +2528,7 @@
 
 void HTMLTreeBuilder::defaultForBeforeHTML()
 {
-    AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag->localName());
+    AtomHTMLToken startHTML(HTMLToken::StartTag, htmlTag->localName());
     m_tree.insertHTMLHtmlStartTagBeforeHTML(WTFMove(startHTML));
     m_insertionMode = InsertionMode::BeforeHead;
 }
@@ -2535,25 +2535,25 @@
 
 void HTMLTreeBuilder::defaultForBeforeHead()
 {
-    AtomicHTMLToken startHead(HTMLToken::StartTag, headTag->localName());
+    AtomHTMLToken startHead(HTMLToken::StartTag, headTag->localName());
     processStartTag(WTFMove(startHead));
 }
 
 void HTMLTreeBuilder::defaultForInHead()
 {
-    AtomicHTMLToken endHead(HTMLToken::EndTag, headTag->localName());
+    AtomHTMLToken endHead(HTMLToken::EndTag, headTag->localName());
     processEndTag(WTFMove(endHead));
 }
 
 void HTMLTreeBuilder::defaultForInHeadNoscript()
 {
-    AtomicHTMLToken endNoscript(HTMLToken::EndTag, noscriptTag->localName());
+    AtomHTMLToken endNoscript(HTMLToken::EndTag, noscriptTag->localName());
     processEndTag(WTFMove(endNoscript));
 }
 
 void HTMLTreeBuilder::defaultForAfterHead()
 {
-    AtomicHTMLToken startBody(HTMLToken::StartTag, bodyTag->localName());
+    AtomHTMLToken startBody(HTMLToken::StartTag, bodyTag->localName());
     processStartTag(WTFMove(startBody));
     m_framesetOk = true;
 }
@@ -2575,7 +2575,7 @@
     m_insertionMode = m_originalInsertionMode;
 }
 
-bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken&& token)
+bool HTMLTreeBuilder::processStartTagForInHead(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     if (token.name() == htmlTag) {
@@ -2628,7 +2628,7 @@
     return false;
 }
 
-void HTMLTreeBuilder::processGenericRCDATAStartTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processGenericRCDATAStartTag(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     m_tree.insertHTMLElement(WTFMove(token));
@@ -2637,7 +2637,7 @@
     m_insertionMode = InsertionMode::Text;
 }
 
-void HTMLTreeBuilder::processGenericRawTextStartTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processGenericRawTextStartTag(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     m_tree.insertHTMLElement(WTFMove(token));
@@ -2646,7 +2646,7 @@
     m_insertionMode = InsertionMode::Text;
 }
 
-void HTMLTreeBuilder::processScriptStartTag(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processScriptStartTag(AtomHTMLToken&& token)
 {
     ASSERT(token.type() == HTMLToken::StartTag);
     m_tree.insertScriptElement(WTFMove(token));
@@ -2671,7 +2671,7 @@
 }
 
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#tree-construction
-bool HTMLTreeBuilder::shouldProcessTokenInForeignContent(const AtomicHTMLToken& token)
+bool HTMLTreeBuilder::shouldProcessTokenInForeignContent(const AtomHTMLToken& token)
 {
     if (m_tree.isEmpty())
         return false;
@@ -2701,12 +2701,12 @@
     return true;
 }
 
-static bool hasAttribute(const AtomicHTMLToken& token, const QualifiedName& name)
+static bool hasAttribute(const AtomHTMLToken& token, const QualifiedName& name)
 {
     return findAttribute(token.attributes(), name);
 }
 
-void HTMLTreeBuilder::processTokenInForeignContent(AtomicHTMLToken&& token)
+void HTMLTreeBuilder::processTokenInForeignContent(AtomHTMLToken&& token)
 {
     HTMLStackItem& adjustedCurrentNode = adjustedCurrentStackItem();
     
@@ -2833,7 +2833,7 @@
     // The tree builder might have been destroyed as an indirect result of finishing the parsing.
 }
 
-inline void HTMLTreeBuilder::parseError(const AtomicHTMLToken&)
+inline void HTMLTreeBuilder::parseError(const AtomHTMLToken&)
 {
 }
 

Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h (280198 => 280199)


--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h	2021-07-22 22:07:52 UTC (rev 280199)
@@ -59,7 +59,7 @@
 
     bool isParsingFragment() const;
 
-    void constructTree(AtomicHTMLToken&&);
+    void constructTree(AtomHTMLToken&&);
 
     bool isParsingTemplateContents() const;
     bool hasParserBlockingScriptWork() const;
@@ -112,32 +112,32 @@
     void linkifyPhoneNumbers(String&&);
 #endif
 
-    void processToken(AtomicHTMLToken&&);
+    void processToken(AtomHTMLToken&&);
 
-    void processDoctypeToken(AtomicHTMLToken&&);
-    void processStartTag(AtomicHTMLToken&&);
-    void processEndTag(AtomicHTMLToken&&);
-    void processComment(AtomicHTMLToken&&);
-    void processCharacter(AtomicHTMLToken&&);
-    void processEndOfFile(AtomicHTMLToken&&);
+    void processDoctypeToken(AtomHTMLToken&&);
+    void processStartTag(AtomHTMLToken&&);
+    void processEndTag(AtomHTMLToken&&);
+    void processComment(AtomHTMLToken&&);
+    void processCharacter(AtomHTMLToken&&);
+    void processEndOfFile(AtomHTMLToken&&);
 
-    bool processStartTagForInHead(AtomicHTMLToken&&);
-    void processStartTagForInBody(AtomicHTMLToken&&);
-    void processStartTagForInTable(AtomicHTMLToken&&);
-    void processEndTagForInBody(AtomicHTMLToken&&);
-    void processEndTagForInTable(AtomicHTMLToken&&);
-    void processEndTagForInTableBody(AtomicHTMLToken&&);
-    void processEndTagForInRow(AtomicHTMLToken&&);
-    void processEndTagForInCell(AtomicHTMLToken&&);
+    bool processStartTagForInHead(AtomHTMLToken&&);
+    void processStartTagForInBody(AtomHTMLToken&&);
+    void processStartTagForInTable(AtomHTMLToken&&);
+    void processEndTagForInBody(AtomHTMLToken&&);
+    void processEndTagForInTable(AtomHTMLToken&&);
+    void processEndTagForInTableBody(AtomHTMLToken&&);
+    void processEndTagForInRow(AtomHTMLToken&&);
+    void processEndTagForInCell(AtomHTMLToken&&);
 
-    void processHtmlStartTagForInBody(AtomicHTMLToken&&);
-    bool processBodyEndTagForInBody(AtomicHTMLToken&&);
+    void processHtmlStartTagForInBody(AtomHTMLToken&&);
+    bool processBodyEndTagForInBody(AtomHTMLToken&&);
     bool processTableEndTagForInTable();
     bool processCaptionEndTagForInCaption();
     bool processColgroupEndTagForInColumnGroup();
     bool processTrEndTagForInRow();
 
-    void processAnyOtherEndTagForInBody(AtomicHTMLToken&&);
+    void processAnyOtherEndTagForInBody(AtomHTMLToken&&);
 
     void processCharacterBuffer(ExternalCharacterTokenBuffer&);
     inline void processCharacterBufferForInBody(ExternalCharacterTokenBuffer&);
@@ -147,9 +147,9 @@
     void processFakeEndTag(const AtomString&);
     void processFakePEndTagIfPInButtonScope();
 
-    void processGenericRCDATAStartTag(AtomicHTMLToken&&);
-    void processGenericRawTextStartTag(AtomicHTMLToken&&);
-    void processScriptStartTag(AtomicHTMLToken&&);
+    void processGenericRCDATAStartTag(AtomHTMLToken&&);
+    void processGenericRawTextStartTag(AtomHTMLToken&&);
+    void processScriptStartTag(AtomHTMLToken&&);
 
     // Default processing for the different insertion modes.
     void defaultForInitial();
@@ -160,26 +160,26 @@
     void defaultForAfterHead();
     void defaultForInTableText();
 
-    bool shouldProcessTokenInForeignContent(const AtomicHTMLToken&);
-    void processTokenInForeignContent(AtomicHTMLToken&&);
+    bool shouldProcessTokenInForeignContent(const AtomHTMLToken&);
+    void processTokenInForeignContent(AtomHTMLToken&&);
     
     HTMLStackItem& adjustedCurrentStackItem() const;
 
-    void callTheAdoptionAgency(AtomicHTMLToken&);
+    void callTheAdoptionAgency(AtomHTMLToken&);
 
     void closeTheCell();
 
-    template <bool shouldClose(const HTMLStackItem&)> void processCloseWhenNestedTag(AtomicHTMLToken&&);
+    template <bool shouldClose(const HTMLStackItem&)> void processCloseWhenNestedTag(AtomHTMLToken&&);
 
-    void parseError(const AtomicHTMLToken&);
+    void parseError(const AtomHTMLToken&);
 
     void resetInsertionModeAppropriately();
 
-    void insertGenericHTMLElement(AtomicHTMLToken&&);
+    void insertGenericHTMLElement(AtomHTMLToken&&);
 
-    void processTemplateStartTag(AtomicHTMLToken&&);
-    bool processTemplateEndTag(AtomicHTMLToken&&);
-    bool processEndOfFileForInTemplateContents(AtomicHTMLToken&&);
+    void processTemplateStartTag(AtomHTMLToken&&);
+    bool processTemplateEndTag(AtomHTMLToken&&);
+    bool processEndOfFileForInTemplateContents(AtomHTMLToken&&);
 
     class FragmentParsingContext {
     public:

Modified: trunk/Source/WebCore/html/parser/TextDocumentParser.cpp (280198 => 280199)


--- trunk/Source/WebCore/html/parser/TextDocumentParser.cpp	2021-07-22 21:37:02 UTC (rev 280198)
+++ trunk/Source/WebCore/html/parser/TextDocumentParser.cpp	2021-07-22 22:07:52 UTC (rev 280199)
@@ -53,7 +53,7 @@
     // distrubing the line/column number calculations.
     Vector<Attribute> attributes;
     attributes.append(Attribute(styleAttr, "word-wrap: break-word; white-space: pre-wrap;"));
-    AtomicHTMLToken fakePre(HTMLToken::StartTag, preTag->localName(), WTFMove(attributes));
+    AtomHTMLToken fakePre(HTMLToken::StartTag, preTag->localName(), WTFMove(attributes));
     treeBuilder().constructTree(WTFMove(fakePre));
 
     // Normally we would skip the first \n after a <pre> element, but we don't
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to