Bug 232117 - imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html is timing out
Summary: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 232112 232114
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-21 16:48 PDT by Chris Dumez
Modified: 2021-10-25 13:16 PDT (History)
12 users (show)

See Also:


Attachments
Do not perform microtask checkpoint (for EWS) (622 bytes, patch)
2021-10-21 17:07 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (6.30 KB, patch)
2021-10-25 07:59 PDT, Chris Dumez
achristensen: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-10-21 16:48:06 PDT
imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html is failing on WebKit but passing in Chrome & Firefox.
Comment 1 Chris Dumez 2021-10-21 16:52:46 PDT
I am fixing 2 issues in dependency bugs. However, the test is still timing out. The reason is that subtests are conflicting with each other.

Each subtest is calling Element.insertAdjascentHTML(), you can see here that one call to Element.insertAdjascentHTML() for one subtest ends up calling insertAdjascentHTML again recursively, on behalf of another subtest:

```
1   0x41a5d39b0 WebCore::Element::insertAdjacentHTML(WTF::String const&, WTF::String const&)
2   0x417fa284b WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()::operator()() const
3   0x417fa2761 JSC::JSValue WebCore::toJS<WebCore::IDLUndefined, WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()>(JSC::JSGlobalObject&, JSC::ThrowScope&, WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()&&)
4   0x417fa26bf WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)
5   0x417fa223d long long WebCore::IDLOperation<WebCore::JSElement>::call<&(WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)), (WebCore::CastedThisErrorBehavior)0>(JSC::JSGlobalObject&, JSC::CallFrame&, char const*)
6   0x417f8b4e4 WebCore::jsElementPrototypeFunction_insertAdjacentHTML(JSC::JSGlobalObject*, JSC::CallFrame*)
7   0x3d822c2011d8
8   0x404c72449 llint_entry
9   0x404c724f9 llint_entry
10  0x404c724f9 llint_entry
11  0x404c724f9 llint_entry
12  0x404c73993 llint_entry
13  0x404c724f9 llint_entry
14  0x404c724f9 llint_entry
15  0x404c734c5 llint_entry
16  0x404c724f9 llint_entry
17  0x404c4e8d0 vmEntryToJavaScript
18  0x405b1c8d5 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
19  0x405b1d093 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
20  0x405edcd7a JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
21  0x405edd035 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
22  0x406140a60 JSC::JSMicrotask::run(JSC::JSGlobalObject*)
23  0x419ebee5b WebCore::JSExecState::runTask(JSC::JSGlobalObject*, JSC::Microtask&)
24  0x419ec537e WebCore::JSMicrotaskCallback::call()
25  0x419ec51cb WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&, WTF::Ref<JSC::Microtask, WTF::RawPtrTraits<JSC::Microtask> >&&)::$_43::operator()()
26  0x419ec50e9 WTF::Detail::CallableWrapper<WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&, WTF::Ref<JSC::Microtask, WTF::RawPtrTraits<JSC::Microtask> >&&)::$_43, void>::call()
27  0x4175218d2 WTF::Function<void ()>::operator()() const
28  0x41a5fe179 WebCore::EventLoopFunctionDispatchTask::execute()
29  0x41a63a9f1 WebCore::MicrotaskQueue::performMicrotaskCheckpoint()
30  0x41a5f44ee WebCore::EventLoop::performMicrotaskCheckpoint()
31  0x41a5f589f WebCore::EventLoopTaskGroup::performMicrotaskCheckpoint()
32  0x41a5069af WebCore::Document::finishedParsing()
33  0x41ac3bd98 WebCore::HTMLConstructionSite::finishedParsing()
34  0x41ac85020 WebCore::HTMLTreeBuilder::finished()
35  0x41ac436c3 WebCore::HTMLDocumentParser::end()
36  0x41ac41601 WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd()
37  0x41ac41349 WebCore::HTMLDocumentParser::prepareToStopParsing()
38  0x41ac4372f WebCore::HTMLDocumentParser::attemptToEnd()
39  0x41ac437eb WebCore::HTMLDocumentParser::finish()
40  0x41b04ba5d WebCore::DocumentWriter::end()
41  0x41b04aa1c WebCore::DocumentLoader::finishedLoading()
42  0x41b0575fe WebCore::DocumentLoader::maybeLoadEmpty()
43  0x41b057824 WebCore::DocumentLoader::startLoadingMainResource()
44  0x41b0b5e4e WebCore::FrameLoader::init()
45  0x41b2bd5a4 WebCore::Frame::init()
46  0x3ec55615a WebKit::WebFrame::createSubframe(WebKit::WebPage*, WTF::String const&, WebCore::HTMLFrameOwnerElement*)
47  0x3ec4b0421 WebKit::WebFrameLoaderClient::createFrame(WTF::String const&, WebCore::HTMLFrameOwnerElement&)
48  0x41b14b9d2 WebCore::FrameLoader::SubframeLoader::loadSubframe(WebCore::HTMLFrameOwnerElement&, WTF::URL const&, WTF::String const&, WTF::String const&)
49  0x41b14a8ab WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe(WebCore::HTMLFrameOwnerElement&, WTF::URL const&, WTF::AtomString const&, WebCore::LockHistory, WebCore::LockBackForwardList)
50  0x41b14a2f4 WebCore::FrameLoader::SubframeLoader::requestFrame(WebCore::HTMLFrameOwnerElement&, WTF::String const&, WTF::AtomString const&, WebCore::LockHistory, WebCore::LockBackForwardList)
51  0x41a9d03ab WebCore::HTMLFrameElementBase::openURL(WebCore::LockHistory, WebCore::LockBackForwardList)
52  0x41a9d074f WebCore::HTMLFrameElementBase::didFinishInsertingNode()
53  0x41a493856 void WebCore::executeNodeInsertionWithScriptAssertion<WebCore::ContainerNode::insertBefore(WebCore::Node&, WebCore::Node*)::$_0>(WebCore::ContainerNode&, WebCore::Node&, WebCore::ContainerNode::ChildChange::Source, WebCore::ReplacedAllChildren, WebCore::ContainerNode::insertBefore(WebCore::Node&, WebCore::Node*)::$_0)
54  0x41a492eb5 WebCore::ContainerNode::insertBefore(WebCore::Node&, WebCore::Node*)
55  0x41a5d305c WebCore::Element::insertAdjacent(WTF::String const&, WTF::Ref<WebCore::Node, WTF::RawPtrTraits<WebCore::Node> >&&)
56  0x41a5d36c2 WebCore::Element::insertAdjacentHTML(WTF::String const&, WTF::String const&, WTF::Vector<WTF::Ref<WebCore::Node, WTF::RawPtrTraits<WebCore::Node> >, 11ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>*)
57  0x41a5d39ca WebCore::Element::insertAdjacentHTML(WTF::String const&, WTF::String const&)
58  0x417fa284b WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()::operator()() const
59  0x417fa2761 JSC::JSValue WebCore::toJS<WebCore::IDLUndefined, WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()>(JSC::JSGlobalObject&, JSC::ThrowScope&, WebCore::jsElementPrototypeFunction_insertAdjacentHTMLBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSElement*)::'lambda'()&&)
```
Comment 2 Chris Dumez 2021-10-21 16:56:24 PDT
Basically, the issue seems to be that inserting a frame into the document loads the empty document synchronously inside this iframe and ends up performing a microtask checkpoint so we end up running some pending promises (subtests are promise tests).
Comment 3 Chris Dumez 2021-10-21 17:07:15 PDT
Created attachment 442091 [details]
Do not perform microtask checkpoint (for EWS)
Comment 4 Chris Dumez 2021-10-22 08:27:48 PDT
Proposing an change upstream to the test: https://github.com/web-platform-tests/wpt/pull/31359
Comment 5 Chris Dumez 2021-10-25 07:59:34 PDT
Created attachment 442369 [details]
Patch
Comment 6 EWS Watchlist 2021-10-25 08:00:47 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 7 EWS 2021-10-25 12:32:20 PDT
Tools/Scripts/svn-apply failed to apply attachment 442369 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 8 Chris Dumez 2021-10-25 13:15:10 PDT
Committed r284818 (243510@main): <https://commits.webkit.org/243510@main>
Comment 9 Radar WebKit Bug Importer 2021-10-25 13:16:20 PDT
<rdar://problem/84627337>