<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>247412</bug_id>
          
          <creation_ts>2022-11-03 00:00:35 -0700</creation_ts>
          <short_desc>Assertion failure in TreeScopeOrderedMap::add by TreeScope::addElementByName</short_desc>
          <delta_ts>2022-11-03 12:35:26 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=244398</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1910004</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-11-03 00:00:35 -0700</bug_when>
    <thetext>e.g.
ASSERTION FAILED: !entry.registeredElements.contains(&amp;element)
dom/TreeScopeOrderedMap.cpp(63) : void WebCore::TreeScopeOrderedMap::add(const WTF::AtomStringImpl &amp;, WebCore::Element &amp;, const WebCore::TreeScope &amp;)
1   0x4e264cde9 WTFCrash
2   0x4e264ce09 WTFCrashWithSecurityImplication
3   0x4fbe3aff1 WebCore::TreeScopeOrderedMap::add(WTF::AtomStringImpl const&amp;, WebCore::Element&amp;, WebCore::TreeScope const&amp;)
4   0x4fbe3b4a1 WebCore::TreeScope::addElementByName(WTF::AtomStringImpl const&amp;, WebCore::Element&amp;)
5   0x4fbc9d1ea WebCore::Element::insertedIntoAncestor(WebCore::Node::InsertionType, WebCore::ContainerNode&amp;)
6   0x4fc090ad4 WebCore::HTMLElement::insertedIntoAncestor(WebCore::Node::InsertionType, WebCore::ContainerNode&amp;)
7   0x4fbb7eb21 WebCore::notifyNodeInsertedIntoDocument(WebCore::ContainerNode&amp;, WebCore::Node&amp;, WebCore::TreeScopeChange, WTF::Vector&lt;WTF::Ref&lt;WebCore::Node, WTF::RawPtrTraits&lt;WebCore::Node&gt; &gt;, 11ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;)
8   0x4fbb7e908 WebCore::notifyChildNodeInserted(WebCore::ContainerNode&amp;, WebCore::Node&amp;, WTF::Vector&lt;WTF::Ref&lt;WebCore::Node, WTF::RawPtrTraits&lt;WebCore::Node&gt; &gt;, 11ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc&gt;&amp;)
9   0x4fbb65966 void WebCore::executeNodeInsertionWithScriptAssertion&lt;WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck(WebCore::Node&amp;)::$_4&gt;(WebCore::ContainerNode&amp;, WebCore::Node&amp;, WebCore::Node*, WebCore::ContainerNode::ChildChange::Source, WebCore::ReplacedAllChildren, WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck(WebCore::Node&amp;)::$_4)
10  0x4fbb62e88 WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck(WebCore::Node&amp;)
11  0x4fbb6278a WebCore::ContainerNode::insertBefore(WebCore::Node&amp;, WebCore::Node*)
12  0x4fbd6e33e WebCore::Node::after(WTF::FixedVector&lt;std::__1::variant&lt;WTF::RefPtr&lt;WebCore::Node, WTF::RawPtrTraits&lt;WebCore::Node&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::Node&gt; &gt;, WTF::String&gt; &gt;&amp;&amp;)
13  0x4f91c507f WebCore::jsElementPrototypeFunction_afterBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::&apos;lambda&apos;()::operator()() const
14  0x4f91c4fb1 JSC::JSValue WebCore::toJS&lt;WebCore::IDLUndefined, WebCore::jsElementPrototypeFunction_afterBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::&apos;lambda&apos;()&gt;(JSC::JSGlobalObject&amp;, JSC::ThrowScope&amp;, WebCore::jsElementPrototypeFunction_afterBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::&apos;lambda&apos;()&amp;&amp;)
15  0x4f91c4f3f WebCore::jsElementPrototypeFunction_afterBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)
16  0x4f91c4cfe long long WebCore::IDLOperation&lt;WebCore::JSElement&gt;::call&lt;&amp;(WebCore::jsElementPrototypeFunction_afterBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)), (WebCore::CastedThisErrorBehavior)0&gt;(JSC::JSGlobalObject&amp;, JSC::CallFrame&amp;, char const*)
17  0x4f91b4064 WebCore::jsElementPrototypeFunction_after(JSC::JSGlobalObject*, JSC::CallFrame*)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910005</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-03 00:00:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/101898183&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910006</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-11-03 00:01:41 -0700</bug_when>
    <thetext>&lt;rdar://101897430&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910007</commentid>
    <comment_count>3</comment_count>
      <attachid>463377</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-11-03 00:03:44 -0700</bug_when>
    <thetext>Created attachment 463377
Test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910008</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-11-03 00:10:53 -0700</bug_when>
    <thetext>Luckily, there is no security implication here despite of the assertion since CachedHTMLCollection&lt;HTMLCollectionClass, traversalType&gt;::namedItem returns early when the input string is empty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910009</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-11-03 00:23:31 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6077</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910154</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-03 12:35:24 -0700</bug_when>
    <thetext>Committed 256286@main (6231b9849576): &lt;https://commits.webkit.org/256286@main&gt;

Reviewed commits have been landed. Closing PR #6077 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463377</attachid>
            <date>2022-11-03 00:03:44 -0700</date>
            <delta_ts>2022-11-03 00:03:44 -0700</delta_ts>
            <desc>Test</desc>
            <filename>bug247412.html</filename>
            <type>text/html</type>
            <size>334</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzY3JpcHQ+CmlmICh3aW5kb3cudGVzdFJ1bm5lcikKICAgIHRlc3RS
dW5uZXIuZHVtcEFzVGV4dCgpOwoKZnVuY3Rpb24gcnVuKCkgewogICAgY29udGFpbmVyLmFwcGVu
ZENoaWxkKG5hbWVkRWxlbWVudCk7CiAgICBkb2N1bWVudC5ib2R5LmlubmVySFRNTCA9ICc8cD5U
aGlzIHRlc3QgcGFzc2VzIGlmIFdlYktpdCBkb2VzIG5vdCBoaXQgYW55IGRlYnVnIGFzc2VydGlv
bnMuPC9wPjxwPlBBU1M8L3A+JzsKfQo8L3NjcmlwdD4KPGJvZHkgb25sb2FkPXJ1bigpPgo8ZGl2
IGlkPSJjb250YWluZXIiPgo8aW1nIGlkPSJuYW1lZEVsZW1lbnQiIG5hbWU9IiI+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>