haikuwebkit/LayoutTests/fast/dom/microtask-reverse.html

29 lines
719 B
HTML
Raw Permalink Normal View History

Add a microtask abstraction https://bugs.webkit.org/show_bug.cgi?id=137496 Reviewed by Sam Weinig. Source/WebCore: This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask That abstraction is required in order to enable async loading of images, which is in turn required to enable support for the picture element, as well as to make sure that the order of properties set on HTMLImageElement has no implications. A similar patch was rolled back in r180914. This patch is an improved version. * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project. * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project. * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project. * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project. * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project. * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport.. * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton. (WebCore::MicroTask::~MicroTask): (WebCore::MicroTask::run): Run the microtask. * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton. (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue. (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue. (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it. * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue. (WebCore::ScriptRunner::timerFired): * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue. (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): (WebCore::HTMLScriptRunner::runScript): * testing/Internals.cpp: Add a method to queue a test microtask. (WebCore::Internals::queueMicroTask): * testing/Internals.h: Add a method to queue a test microtask. (WebCore::Internals::queueMicroTask): * testing/Internals.idl: Expose test microtask queueing to test JS. * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs. (WebCore::MicroTaskTest::run): Run the microtask (WebCore::MicroTaskTest::create): Create a test microtask. * testing/MicroTaskTest.h: Add a test class that implements a microtask. (WebCore::MicroTaskTest::run): (WebCore::MicroTaskTest::create): LayoutTests: Adding a test for microtask abstraction. A similar patch was rolled back in r180914. * fast/dom/microtask-detach.html: Added. * fast/dom/microtask-detach-expected.txt: Added. * fast/dom/microtask-inorder.html: Added. * fast/dom/microtask-inorder-expected.txt: Added. * fast/dom/microtask-reverse.html: Added. * fast/dom/microtask-reverse-expected.txt: Added. Canonical link: https://commits.webkit.org/160313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-03-04 07:55:28 +00:00
<!DOCTYPE html>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.waitUntilDone();
}
</script>
id of iframe incorrectly sets window name https://bugs.webkit.org/show_bug.cgi?id=150565 Reviewed by Darin Adler. Source/WebCore: As per the specification, the iframe's contentWindow name should be an empty string if the frame's name attribute is unset: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-name Instead, WebKit was using the iframe's id as window name if the name was unset. Firefox, IE and Chrome behave according to the specification. This is a merge of the following Blink commit: https://src.chromium.org/viewvc/blink?revision=169803&view=revision Test: fast/frames/iframe-no-name.html * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::parseAttribute): (WebCore::HTMLFrameElementBase::insertedInto): Deleted. LayoutTests: Add a test to check that id of iframe incorrectly sets the window name when the iframe's name is not set. Also set frame names in a lot of layout tests so that they keep giving the same output. * fast/css-generated-content/positioned-div-with-floating-after-content-crash.html: * fast/dom/Window/slow-unload-handler-overwritten-date.html: * fast/dom/Window/timeout-callback-scope.html: * fast/dom/Window/window-access-after-navigation.html: * fast/dom/Window/window-collection-length-no-crash.html: * fast/dom/Window/window-special-properties-expected.txt: * fast/dom/microtask-detach.html: * fast/dom/microtask-inorder.html: * fast/dom/microtask-reverse.html: * fast/dom/wrapper-context.html: * fast/dom/xss-DENIED-javascript-variations.html: * fast/events/onbeforeunload-focused-iframe.html: * fast/events/open-window-from-another-frame.html: * fast/events/popup-blocked-to-post-blank.html: * fast/events/popup-blocking-click-in-iframe.html: * fast/events/popup-when-select-change.html: * fast/frames/detach-frame-during-focus.html: * fast/frames/frame-inherit-noresize-from-frameset.html: * fast/frames/frame-programmatic-noresize.html: * fast/frames/frame-with-noresize-can-be-resized-after-removal-of-noresize.html: * fast/frames/frame-with-noresize-can-be-resized-after-setting-noResize-to-false.html: * fast/frames/iframe-no-name-expected.txt: Added. * fast/frames/iframe-no-name.html: Added. * fast/frames/unload-reparent-sibling-frame.html: * fast/history/form-submit-in-frame-via-onclick.html: * fast/history/form-submit-in-frame.html: * fast/history/same-document-iframes-changing-fragment.html: * fast/history/same-document-iframes-changing-pushstate.html: * fast/history/saves-state-after-frame-nav.html: * fast/images/exif-orientation-image-document.html: * fast/loader/resources/subframe-navigate-during-main-frame-load2.html: * fast/overflow/scrollRevealButton.html: * fast/parser/xml-colon-entity.html: * fast/parser/xml-declaration-missing-ending-mark.html: * fast/scrolling/latching/scroll-nested-iframe.html: * fullscreen/full-screen-frameset.html: * http/tests/contentextensions/block-cookies-in-csp-report.html: * http/tests/contentextensions/block-cookies-in-ping.html: * http/tests/contentextensions/block-cookies-send.html: * http/tests/contentextensions/block-csp-report.html: * http/tests/contentextensions/block-everything-unless-domain-iframe.html: * http/tests/contentextensions/block-ping.html: * http/tests/contentextensions/hide-on-csp-report.html: * http/tests/contentextensions/hide-on-ping.html: * http/tests/loading/text-content-type-with-binary-extension.html: * http/tests/misc/location-replace-crossdomain.html: * http/tests/multipart/multipart-wait-before-boundary.html: * http/tests/navigation/no-referrer-subframe.html: * http/tests/security/cross-frame-access-child-explicit-domain.html: * http/tests/security/cross-frame-access-document-direct.html: * http/tests/security/cross-frame-access-parent-explicit-domain.html: * http/tests/security/cross-frame-access-port-explicit-domain.html: * http/tests/security/cross-frame-access-port.html: * http/tests/security/dataURL/resources/foreign-domain-data-url-accessee-iframe.html: * http/tests/security/dataURL/resources/foreign-domain-data-url-accessor-iframe.html: * http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe.html: * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level.html: * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame.html: * http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.html: * http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url.html: * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level.html: * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase.html: * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame.html: * http/tests/security/host-compare-case-insensitive.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode.html: * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS.html: * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html: * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-iframe.html: * http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level.html: * http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame.html: * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url.html: * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame.html: * http/tests/security/protocol-compare-case-insensitive.html: * http/tests/security/referrer-policy-redirect-link.html: * http/tests/security/sandboxed-iframe-blocks-access-from-parent.html: * http/tests/security/srcdoc-inherits-referrer-for-forms.html: * http/tests/security/xssAuditor/full-block-base-href.html: * http/tests/security/xssAuditor/full-block-iframe-javascript-url.html: * http/tests/security/xssAuditor/full-block-iframe-no-inherit.php: * http/tests/security/xssAuditor/full-block-javascript-link.html: * http/tests/security/xssAuditor/full-block-link-onclick.html: * http/tests/security/xssAuditor/full-block-object-tag.html: * http/tests/security/xssAuditor/full-block-script-tag-cross-domain.html: * http/tests/security/xssAuditor/full-block-script-tag-with-source.html: * http/tests/security/xssAuditor/full-block-script-tag.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-1.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-2.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-3.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-4.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-5.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-6.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-7.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-8.html: * http/tests/security/xssAuditor/malformed-xss-protection-header-9.html: * http/tests/security/xssAuditor/report-script-tag-replace-state.html: * http/tests/security/xssAuditor/report-script-tag.html: * http/tests/security/xssAuditor/resources/utilities.js: (sendRequestFromIFrame): * http/tests/security/xssAuditor/xss-protection-parsing-02.html: * http/tests/security/xssAuditor/xss-protection-parsing-03.html: * http/tests/security/xssAuditor/xss-protection-parsing-04.html: * platform/mac/webarchive/archive-empty-frame-dom-expected.txt: * plugins/plugin-remove-subframe.html: * webarchive/archive-empty-frame-dom-expected.webarchive: * webarchive/archive-empty-frame-dom.html: Canonical link: https://commits.webkit.org/168770@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 04:40:04 +00:00
<iframe id="frame1" name="frame1"></iframe>
<iframe id="frame2" name="frame2"></iframe>
Add a microtask abstraction https://bugs.webkit.org/show_bug.cgi?id=137496 Reviewed by Sam Weinig. Source/WebCore: This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask That abstraction is required in order to enable async loading of images, which is in turn required to enable support for the picture element, as well as to make sure that the order of properties set on HTMLImageElement has no implications. A similar patch was rolled back in r180914. This patch is an improved version. * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project. * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project. * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project. * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project. * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project. * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport.. * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton. (WebCore::MicroTask::~MicroTask): (WebCore::MicroTask::run): Run the microtask. * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton. (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue. (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue. (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it. * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue. (WebCore::ScriptRunner::timerFired): * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue. (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): (WebCore::HTMLScriptRunner::runScript): * testing/Internals.cpp: Add a method to queue a test microtask. (WebCore::Internals::queueMicroTask): * testing/Internals.h: Add a method to queue a test microtask. (WebCore::Internals::queueMicroTask): * testing/Internals.idl: Expose test microtask queueing to test JS. * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs. (WebCore::MicroTaskTest::run): Run the microtask (WebCore::MicroTaskTest::create): Create a test microtask. * testing/MicroTaskTest.h: Add a test class that implements a microtask. (WebCore::MicroTaskTest::run): (WebCore::MicroTaskTest::create): LayoutTests: Adding a test for microtask abstraction. A similar patch was rolled back in r180914. * fast/dom/microtask-detach.html: Added. * fast/dom/microtask-detach-expected.txt: Added. * fast/dom/microtask-inorder.html: Added. * fast/dom/microtask-inorder-expected.txt: Added. * fast/dom/microtask-reverse.html: Added. * fast/dom/microtask-reverse-expected.txt: Added. Canonical link: https://commits.webkit.org/160313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-03-04 07:55:28 +00:00
<script>
var iframe1 = document.querySelector("#frame1").contentWindow;
var iframe2 = document.querySelector("#frame2").contentWindow;
if(window.internals)
internals.queueMicroTask(0);
if(iframe1.internals)
iframe1.internals.queueMicroTask(1);
if(iframe2.internals)
iframe2.internals.queueMicroTask(2);
console.log("Finished queueing tests.");
requestAnimationFrame(function() {
if (window.testRunner)
testRunner.notifyDone();
});
</script>