<?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>261305</bug_id>
          
          <creation_ts>2023-09-07 17:24:08 -0700</creation_ts>
          <short_desc>New test added in 265747@main hits assertion failure: ScriptDisallowedScope::InMainThread::isScriptAllowed()</short_desc>
          <delta_ts>2023-09-13 00:40:07 -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>New Bugs</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=261339</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="Karl Rackler">rackler</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bot-watchers-bugzilla</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1976271</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Rackler">rackler</who>
    <bug_when>2023-09-07 17:24:08 -0700</bug_when>
    <thetext>Description:
editing/inserting/break-out-of-nested-lists.html

The test was added at 265747@main and has been a consistent failure since then.

This issue can be bisected to 265747@main using command:
run-webkit-tests --debug --iterations=1 -1  editing/inserting/break-out-of-nested-lists.html

History:
https://results.webkit.org/?suite=layout-tests&amp;test=editing%2Finserting%2Fbreak-out-of-nested-lists.html&amp;platform=mac&amp;flavor=wk1&amp;style=debug&amp;limit=6000&amp;recent=false

Crash Log:
No crash log found.

stdout:

stderr:
ASSERTION FAILED: ScriptDisallowedScope::InMainThread::isScriptAllowed()
/Volumes/Data/worker/trunk-romee-debug-archive/build/OpenSource/Source/WebCore/dom/Document.cpp(5389) : void WebCore::Document::dispatchWindowEvent(WebCore::Event &amp;, WebCore::EventTarget *)
1   0x11d993ab9 WTFCrash
2   0x11d993ad9 WTFCrashWithSecurityImplication
3   0x12a03d5bd WebCore::Document::dispatchWindowEvent(WebCore::Event&amp;, WebCore::EventTarget*)
4   0x12adf2671 WebCore::dispatchEventsOnWindowAndFocusedElement(WebCore::Document*, bool)
5   0x12adf2567 WebCore::FocusController::setFocusedInternal(bool)
6   0x12adf466e WebCore::FocusController::setActivityState(WTF::OptionSet&lt;WebCore::ActivityState&gt;)
7   0x12aeaf60c WebCore::Page::setActivityState(WTF::OptionSet&lt;WebCore::ActivityState&gt;)
8   0x12adf23bc WebCore::FocusController::setFocused(bool)
9   0x10b9d0667 -[WebHTMLView resignFirstResponder]
10  0x7ff812417494 -[NSWindow _realMakeFirstResponder:]
11  0x128f2f250 WebCore::safeRemoveFromSuperview(NSView*)
12  0x128f2f157 WebCore::Widget::removeFromSuperview()
13  0x128e52f09 WebCore::ScrollView::platformRemoveChild(WebCore::Widget*)
14  0x12b0b8b1b WebCore::ScrollView::removeChild(WebCore::Widget&amp;)
15  0x12ae5b9e4 WebCore::LocalFrameView::removeChild(WebCore::Widget&amp;)
16  0x12ba78874 WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets()
17  0x12828aad8 WebCore::WidgetHierarchyUpdatesSuspensionScope::~WidgetHierarchyUpdatesSuspensionScope()
18  0x12827eec5 WebCore::WidgetHierarchyUpdatesSuspensionScope::~WidgetHierarchyUpdatesSuspensionScope()
19  0x12a02d52b WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType)
20  0x12a02df8d WebCore::Document::updateStyleIfNeeded()
21  0x12a04c38a WebCore::Document::finishedParsing()
22  0x12a7559e8 WebCore::HTMLConstructionSite::finishedParsing()
23  0x12a7abe80 WebCore::HTMLTreeBuilder::finished()
24  0x12a75ce93 WebCore::HTMLDocumentParser::end()
25  0x12a75ae11 WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd()
26  0x12a75ab39 WebCore::HTMLDocumentParser::prepareToStopParsing()
27  0x12a75b947 WebCore::HTMLDocumentParser::endIfDelayed()
28  0x12a75d260 WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution()
29  0x12a75d5ec WebCore::HTMLDocumentParser::notifyFinished(WebCore::PendingScript&amp;)
30  0x12a1f3f5a WebCore::PendingScript::notifyClientFinished()
31  0x12a1f3fb9 WebCore::PendingScript::notifyFinished(WebCore::LoadableScript&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976273</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-09-07 17:24:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/115145062&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976277</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-09-07 17:41:31 -0700</bug_when>
    <thetext>Test gardening commit 267760@main (66f969fb7c23): &lt;https://commits.webkit.org/267760@main&gt;

Reviewed commits have been landed. Closing PR #17562 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976719</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-09-10 11:15:31 -0700</bug_when>
    <thetext>This is an issue with the assertion. We just need to disable it in WebKit1 like this in ScriptDisallowedScope.h:

        static bool isScriptAllowed()
        {
            ASSERT(isMainThread());
            if ()
#if PLATFORM(IOS_FAMILY)
            return isInWebProcess() || !s_count || webThreadDelegateMessageScopeCount;
#else
            return isInWebProcess() || !s_count;
#endif
        }

We can then isEventDispatchAllowedInSubtree like this:
        static bool isEventDispatchAllowedInSubtree(Node&amp; node)
        {
#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
            return isScriptAllowed() || EventAllowedScope::isAllowedNode(node);
#else
            UNUSED_PARAM(node);
            return true;
#endif
        }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976720</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-10 11:19:35 -0700</bug_when>
    <thetext>@Rniwa - should I do PR with proposed changes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976721</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-09-10 11:20:16 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #4)
&gt; @Rniwa - should I do PR with proposed changes?

Yes, please. I can do it too but I have other test failures to investigate at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976722</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-10 11:30:26 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #5)
&gt; (In reply to Ahmad Saleem from comment #4)
&gt; &gt; @Rniwa - should I do PR with proposed changes?
&gt; 
&gt; Yes, please. I can do it too but I have other test failures to investigate
&gt; at the moment.

No worries, will do in next few hours. 👍</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1976736</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-10 16:22:05 -0700</bug_when>
    <thetext>PR - https://github.com/WebKit/WebKit/pull/17639

Locally confirmed that it does indeed not crash while running:

run-webkit-tests --debug --iterations=1 -1  editing/inserting/break-out-of-nested-lists.html

and yes, I removed test expectation before running the above. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977038</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-09-12 03:26:38 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/17691</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977050</commentid>
    <comment_count>9</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-09-12 06:33:11 -0700</bug_when>
    <thetext>*** Bug 261339 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977233</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-09-13 00:40:04 -0700</bug_when>
    <thetext>Committed 267935@main (f33e99829e4f): &lt;https://commits.webkit.org/267935@main&gt;

Reviewed commits have been landed. Closing PR #17691 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>