Changeset 180911 in webkit
- Timestamp:
- Mar 2, 2015 5:04:40 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r180907 r180911 1 2015-03-02 Yoav Weiss <yoav@yoav.ws> 2 3 Add a microtask abstraction 4 https://bugs.webkit.org/show_bug.cgi?id=137496 5 6 Reviewed by Sam Weinig. 7 8 Adding a test for microtask abstraction. 9 10 * fast/dom/microtask-detach.html: Added. 11 * fast/dom/microtask-detach-expected.txt: Added. 12 * fast/dom/microtask-inorder.html: Added. 13 * fast/dom/microtask-inorder-expected.txt: Added. 14 * fast/dom/microtask-reverse.html: Added. 15 * fast/dom/microtask-reverse-expected.txt: Added. 16 1 17 2015-03-02 Myles C. Maxfield <mmaxfield@apple.com> 2 18 -
trunk/Source/WebCore/CMakeLists.txt
r180601 r180911 1371 1371 dom/MessagePort.cpp 1372 1372 dom/MessagePortChannel.cpp 1373 dom/MicroTask.cpp 1373 1374 dom/MouseEvent.cpp 1374 1375 dom/MouseRelatedEvent.cpp … … 3155 3156 testing/Internals.cpp 3156 3157 3158 testing/MicroTaskTest.cpp 3157 3159 testing/MockPageOverlayClient.cpp 3158 3160 -
trunk/Source/WebCore/ChangeLog
r180910 r180911 1 2015-03-02 Yoav Weiss <yoav@yoav.ws> 2 3 Add a microtask abstraction 4 https://bugs.webkit.org/show_bug.cgi?id=137496 5 6 Reviewed by Sam Weinig. 7 8 This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask 9 That abstraction is required in order to enable async loading of images, 10 which is in turn required to enable support for the picture element, as well as 11 to make sure that the order of properties set on HTMLImageElement has no implications. 12 13 * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project. 14 * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project. 15 * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project. 16 * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project. 17 * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project. 18 * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport.. 19 * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton. 20 (WebCore::MicroTask::~MicroTask): 21 (WebCore::MicroTask::run): Run the microtask. 22 * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton. 23 (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue. 24 (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue. 25 (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it. 26 * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue. 27 (WebCore::ScriptRunner::timerFired): 28 * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue. 29 (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): 30 (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): 31 (WebCore::HTMLScriptRunner::runScript): 32 * testing/Internals.cpp: Add a method to queue a test microtask. 33 (WebCore::Internals::queueMicroTask): 34 * testing/Internals.h: Add a method to queue a test microtask. 35 (WebCore::Internals::queueMicroTask): 36 * testing/Internals.idl: Expose test microtask queueing to test JS. 37 * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs. 38 (WebCore::MicroTaskTest::run): Run the microtask 39 (WebCore::MicroTaskTest::create): Create a test microtask. 40 * testing/MicroTaskTest.h: Add a test class that implements a microtask. 41 (WebCore::MicroTaskTest::run): 42 (WebCore::MicroTaskTest::create): 43 1 44 2015-03-02 Jeremy Jones <jeremyj@apple.com> 2 45 -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r180765 r180911 13435 13435 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> 13436 13436 </ClCompile> 13437 <ClCompile Include="..\dom\MicroTask.cpp" /> 13437 13438 <ClCompile Include="..\dom\MouseEvent.cpp"> 13438 13439 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> … … 20625 20626 <ClInclude Include="..\dom\MessagePort.h" /> 20626 20627 <ClInclude Include="..\dom\MessagePortChannel.h" /> 20628 <ClInclude Include="..\dom\MicroTask.h" /> 20627 20629 <ClInclude Include="..\dom\MouseEvent.h" /> 20628 20630 <ClInclude Include="..\dom\MouseRelatedEvent.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r180765 r180911 3202 3202 <Filter>dom</Filter> 3203 3203 </ClCompile> 3204 <ClCompile Include="..\dom\MicroTask.cpp"> 3205 <Filter>dom</Filter> 3206 </ClCompile> 3204 3207 <ClCompile Include="..\dom\MouseEvent.cpp"> 3205 3208 <Filter>dom</Filter> … … 10268 10271 </ClInclude> 10269 10272 <ClInclude Include="..\dom\MessagePortChannel.h"> 10273 <Filter>dom</Filter> 10274 </ClInclude> 10275 <ClInclude Include="..\dom\MicroTask.h"> 10270 10276 <Filter>dom</Filter> 10271 10277 </ClInclude> -
trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj
r180653 r180911 276 276 </ForcedIncludeFiles> 277 277 </ClCompile> 278 <ClCompile Include="..\testing\MicroTaskTest.cpp" /> 278 279 <ClCompile Include="..\testing\MockPageOverlayClient.cpp" /> 279 280 <ClCompile Include="..\testing\InternalSettings.cpp" /> … … 292 293 <ClInclude Include="..\testing\MallocStatistics.h" /> 293 294 <ClInclude Include="..\testing\MemoryInfo.h" /> 295 <ClInclude Include="..\testing\MicroTaskTest.h" /> 294 296 <ClInclude Include="..\testing\MockCDM.h" /> 295 297 <ClInclude Include="..\testing\MockPageOverlayClient.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters
r180653 r180911 38 38 </ClCompile> 39 39 <ClCompile Include="..\testing\js\WebCoreTestSupport.cpp"> 40 <Filter>testing</Filter> 41 </ClCompile> 42 <ClCompile Include="..\testing\MicroTaskTest.cpp"> 40 43 <Filter>testing</Filter> 41 44 </ClCompile> … … 91 94 </ClInclude> 92 95 <ClInclude Include="..\config.h" /> 96 <ClInclude Include="..\testing\MicroTaskTest.h"> 97 <Filter>testing</Filter> 98 </ClInclude> 93 99 <ClInclude Include="..\testing\MockCDM.h"> 94 100 <Filter>testing</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r180902 r180911 2079 2079 536D5A25193F40FC00CE4CAB /* SourceSizeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 536D5A24193F40FC00CE4CAB /* SourceSizeList.cpp */; }; 2080 2080 536D5A27193F410B00CE4CAB /* SourceSizeList.h in Headers */ = {isa = PBXBuildFile; fileRef = 536D5A26193F410B00CE4CAB /* SourceSizeList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2081 53B895AF19DC7ED9009CAA93 /* MicroTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B895AD19DC7C37009CAA93 /* MicroTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2081 2082 53C8298D13D8D92700DE2DEB /* RenderFlexibleBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53C8298B13D8D92700DE2DEB /* RenderFlexibleBox.cpp */; }; 2082 2083 53C8298E13D8D92700DE2DEB /* RenderFlexibleBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C8298C13D8D92700DE2DEB /* RenderFlexibleBox.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5622 5623 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; }; 5623 5624 CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; 5625 CB8CF0181A9358D4000D510B /* MicroTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB8CF0151A934B43000D510B /* MicroTask.cpp */; }; 5626 CB8CF01D1A95DE42000D510B /* MicroTaskTest.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */; }; 5627 CB8CF01F1A95DE59000D510B /* MicroTaskTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */; }; 5624 5628 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5625 5629 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; }; … … 9228 9232 536D5A24193F40FC00CE4CAB /* SourceSizeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceSizeList.cpp; sourceTree = "<group>"; }; 9229 9233 536D5A26193F410B00CE4CAB /* SourceSizeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceSizeList.h; sourceTree = "<group>"; }; 9234 53B895AD19DC7C37009CAA93 /* MicroTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroTask.h; sourceTree = "<group>"; }; 9230 9235 53C8298B13D8D92700DE2DEB /* RenderFlexibleBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFlexibleBox.cpp; sourceTree = "<group>"; }; 9231 9236 53C8298C13D8D92700DE2DEB /* RenderFlexibleBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFlexibleBox.h; sourceTree = "<group>"; }; … … 13088 13093 CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; }; 13089 13094 CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; 13095 CB8CF0151A934B43000D510B /* MicroTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroTask.cpp; sourceTree = "<group>"; }; 13096 CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroTaskTest.h; sourceTree = "<group>"; }; 13097 CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroTaskTest.cpp; sourceTree = "<group>"; }; 13090 13098 CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; }; 13091 13099 CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; }; … … 15672 15680 A7BF7EDE14C9175A0014489D /* InternalSettings.idl */, 15673 15681 A7BE7EDD14C9175A0014489D /* MallocStatistics.h */, 15682 CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */, 15683 CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */, 15674 15684 A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */, 15675 15685 CD5393CB175DCCE600C07123 /* MemoryInfo.h */, … … 22880 22890 E1ADECC60E76AD1F004A1A5E /* MessagePort.idl */, 22881 22891 41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */, 22892 53B895AD19DC7C37009CAA93 /* MicroTask.h */, 22893 CB8CF0151A934B43000D510B /* MicroTask.cpp */, 22882 22894 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */, 22883 22895 85031B300A44EFC700F992E0 /* MouseEvent.h */, … … 23444 23456 A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */, 23445 23457 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */, 23458 CB8CF01D1A95DE42000D510B /* MicroTaskTest.h in Headers */, 23446 23459 EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */, 23447 23460 CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */, … … 25868 25881 508CCA4F13CF106B003151F3 /* RenderFlowThread.h in Headers */, 25869 25882 A871DED30A1530C700B12A68 /* RenderFrame.h in Headers */, 25883 53B895AF19DC7ED9009CAA93 /* MicroTask.h in Headers */, 25870 25884 0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */, 25871 25885 A871DED10A1530C700B12A68 /* RenderFrameSet.h in Headers */, … … 27194 27208 417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */, 27195 27209 A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */, 27210 CB8CF01F1A95DE59000D510B /* MicroTaskTest.cpp in Sources */, 27196 27211 53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */, 27197 27212 A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */, … … 29829 29844 B2227A930D00BF220071B782 /* SVGPolylineElement.cpp in Sources */, 29830 29845 B2227A960D00BF220071B782 /* SVGPreserveAspectRatio.cpp in Sources */, 29846 CB8CF0181A9358D4000D510B /* MicroTask.cpp in Sources */, 29831 29847 B543B85717EB758F003BE93A /* SVGPropertyInfo.cpp in Sources */, 29832 29848 B2227A990D00BF220071B782 /* SVGRadialGradientElement.cpp in Sources */, -
trunk/Source/WebCore/dom/Document.h
r180867 r180911 1263 1263 void removeDisabledFieldsetElement() { ASSERT(m_disabledFieldsetElementsCount); m_disabledFieldsetElementsCount--; } 1264 1264 1265 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0) override final;1265 WEBCORE_EXPORT virtual void addConsoleMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0) override final; 1266 1266 1267 1267 WEBCORE_EXPORT virtual SecurityOrigin* topOrigin() const override final; … … 1289 1289 WEBCORE_EXPORT void updateIsPlayingAudio(); 1290 1290 void pageMutedStateDidChange(); 1291 WeakPtr<Document> createWeakPtr() { return m_weakFactory.createWeakPtr(); } 1291 1292 1292 1293 protected: -
trunk/Source/WebCore/dom/ScriptRunner.cpp
r176459 r180911 29 29 #include "CachedScript.h" 30 30 #include "Element.h" 31 #include "MicroTask.h" 31 32 #include "PendingScript.h" 32 33 #include "ScriptElement.h" … … 117 118 m_document.decrementLoadEventDelayCount(); 118 119 } 120 MicroTaskQueue::singleton().runMicroTasks(); 119 121 } 120 122 -
trunk/Source/WebCore/html/parser/HTMLScriptRunner.cpp
r157363 r180911 37 37 #include "HTMLScriptRunnerHost.h" 38 38 #include "IgnoreDestructiveWriteCountIncrementer.h" 39 #include "MicroTask.h" 39 40 #include "MutationObserver.h" 40 41 #include "NestingLevelIncrementer.h" … … 130 131 stopWatchingForLoad(pendingScript); 131 132 132 if (!isExecutingScript()) 133 if (!isExecutingScript()) { 133 134 MutationObserver::deliverAllMutations(); 135 MicroTaskQueue::singleton().runMicroTasks(); 136 } 134 137 135 138 // Clear the pending script before possible rentrancy from executeScript() … … 232 235 return false; 233 236 } 237 if (!isExecutingScript()) 238 MicroTaskQueue::singleton().runMicroTasks(); 234 239 return true; 235 240 } … … 294 299 // unfortuantely no obvious way to tell if prepareScript is going to 295 300 // execute the script from out here. 296 if (!isExecutingScript()) 301 if (!isExecutingScript()) { 297 302 MutationObserver::deliverAllMutations(); 303 MicroTaskQueue::singleton().runMicroTasks(); 304 } 298 305 299 306 InsertionPointRecord insertionPointRecord(m_host.inputStream()); -
trunk/Source/WebCore/testing/Internals.cpp
r180712 r180911 80 80 #include "MemoryCache.h" 81 81 #include "MemoryInfo.h" 82 #include "MicroTask.h" 83 #include "MicroTaskTest.h" 82 84 #include "MockPageOverlayClient.h" 83 85 #include "Page.h" … … 2533 2535 } 2534 2536 2535 } 2537 void Internals::queueMicroTask(int testNumber) 2538 { 2539 if (contextDocument()) 2540 MicroTaskQueue::singleton().queueMicroTask(MicroTaskTest::create(contextDocument()->createWeakPtr(), testNumber)); 2541 } 2542 2543 } -
trunk/Source/WebCore/testing/Internals.h
r180653 r180911 367 367 368 368 RefPtr<File> createFile(const String&); 369 void queueMicroTask(int); 369 370 370 371 private: -
trunk/Source/WebCore/testing/Internals.idl
r180601 r180911 323 323 324 324 File createFile(DOMString url); 325 void queueMicroTask(long testNumber); 325 326 };
Note: See TracChangeset
for help on using the changeset viewer.