Changeset 180996 in webkit
- Timestamp:
- Mar 3, 2015 11:55:28 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r180991 r180996 1 2015-03-03 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 A similar patch was rolled back in r180914. 10 11 * fast/dom/microtask-detach.html: Added. 12 * fast/dom/microtask-detach-expected.txt: Added. 13 * fast/dom/microtask-inorder.html: Added. 14 * fast/dom/microtask-inorder-expected.txt: Added. 15 * fast/dom/microtask-reverse.html: Added. 16 * fast/dom/microtask-reverse-expected.txt: Added. 17 1 18 2015-03-03 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebCore/CMakeLists.txt
r180978 r180996 1372 1372 dom/MessagePort.cpp 1373 1373 dom/MessagePortChannel.cpp 1374 dom/MicroTask.cpp 1374 1375 dom/MouseEvent.cpp 1375 1376 dom/MouseRelatedEvent.cpp … … 3156 3157 testing/Internals.cpp 3157 3158 3159 testing/MicroTaskTest.cpp 3158 3160 testing/MockPageOverlayClient.cpp 3159 3161 -
trunk/Source/WebCore/ChangeLog
r180987 r180996 1 2015-03-03 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 A similar patch was rolled back in r180914. This patch is an improved version. 14 15 * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project. 16 * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project. 17 * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project. 18 * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project. 19 * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project. 20 * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport.. 21 * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton. 22 (WebCore::MicroTask::~MicroTask): 23 (WebCore::MicroTask::run): Run the microtask. 24 * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton. 25 (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue. 26 (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue. 27 (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it. 28 * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue. 29 (WebCore::ScriptRunner::timerFired): 30 * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue. 31 (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): 32 (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): 33 (WebCore::HTMLScriptRunner::runScript): 34 * testing/Internals.cpp: Add a method to queue a test microtask. 35 (WebCore::Internals::queueMicroTask): 36 * testing/Internals.h: Add a method to queue a test microtask. 37 (WebCore::Internals::queueMicroTask): 38 * testing/Internals.idl: Expose test microtask queueing to test JS. 39 * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs. 40 (WebCore::MicroTaskTest::run): Run the microtask 41 (WebCore::MicroTaskTest::create): Create a test microtask. 42 * testing/MicroTaskTest.h: Add a test class that implements a microtask. 43 (WebCore::MicroTaskTest::run): 44 (WebCore::MicroTaskTest::create): 45 1 46 2015-03-03 Brent Fulgham <bfulgham@apple.com> 2 47 -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r180914 r180996 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
r180914 r180996 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
r180914 r180996 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
r180914 r180996 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
r180985 r180996 2080 2080 536D5A25193F40FC00CE4CAB /* SourceSizeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 536D5A24193F40FC00CE4CAB /* SourceSizeList.cpp */; }; 2081 2081 536D5A27193F410B00CE4CAB /* SourceSizeList.h in Headers */ = {isa = PBXBuildFile; fileRef = 536D5A26193F410B00CE4CAB /* SourceSizeList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2082 53B895AF19DC7ED9009CAA93 /* MicroTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 53B895AD19DC7C37009CAA93 /* MicroTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2082 2083 53C8298D13D8D92700DE2DEB /* RenderFlexibleBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53C8298B13D8D92700DE2DEB /* RenderFlexibleBox.cpp */; }; 2083 2084 53C8298E13D8D92700DE2DEB /* RenderFlexibleBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C8298C13D8D92700DE2DEB /* RenderFlexibleBox.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5624 5625 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; }; 5625 5626 CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; 5627 CB8CF0181A9358D4000D510B /* MicroTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB8CF0151A934B43000D510B /* MicroTask.cpp */; }; 5628 CB8CF01D1A95DE42000D510B /* MicroTaskTest.h in Headers */ = {isa = PBXBuildFile; fileRef = CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */; }; 5629 CB8CF01F1A95DE59000D510B /* MicroTaskTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */; }; 5626 5630 CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5627 5631 CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; }; … … 9231 9235 536D5A24193F40FC00CE4CAB /* SourceSizeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceSizeList.cpp; sourceTree = "<group>"; }; 9232 9236 536D5A26193F410B00CE4CAB /* SourceSizeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceSizeList.h; sourceTree = "<group>"; }; 9237 53B895AD19DC7C37009CAA93 /* MicroTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroTask.h; sourceTree = "<group>"; }; 9233 9238 53C8298B13D8D92700DE2DEB /* RenderFlexibleBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFlexibleBox.cpp; sourceTree = "<group>"; }; 9234 9239 53C8298C13D8D92700DE2DEB /* RenderFlexibleBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFlexibleBox.h; sourceTree = "<group>"; }; … … 13092 13097 CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; }; 13093 13098 CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; 13099 CB8CF0151A934B43000D510B /* MicroTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroTask.cpp; sourceTree = "<group>"; }; 13100 CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MicroTaskTest.h; sourceTree = "<group>"; }; 13101 CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MicroTaskTest.cpp; sourceTree = "<group>"; }; 13094 13102 CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; }; 13095 13103 CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; }; … … 15677 15685 A7BF7EDE14C9175A0014489D /* InternalSettings.idl */, 15678 15686 A7BE7EDD14C9175A0014489D /* MallocStatistics.h */, 15687 CB8CF01E1A95DE59000D510B /* MicroTaskTest.cpp */, 15688 CB8CF01C1A95DE42000D510B /* MicroTaskTest.h */, 15679 15689 A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */, 15680 15690 CD5393CB175DCCE600C07123 /* MemoryInfo.h */, … … 22886 22896 E1ADECC60E76AD1F004A1A5E /* MessagePort.idl */, 22887 22897 41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */, 22898 53B895AD19DC7C37009CAA93 /* MicroTask.h */, 22899 CB8CF0151A934B43000D510B /* MicroTask.cpp */, 22888 22900 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */, 22889 22901 85031B300A44EFC700F992E0 /* MouseEvent.h */, … … 23450 23462 A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */, 23451 23463 CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */, 23464 CB8CF01D1A95DE42000D510B /* MicroTaskTest.h in Headers */, 23452 23465 EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */, 23453 23466 CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */, … … 25875 25888 508CCA4F13CF106B003151F3 /* RenderFlowThread.h in Headers */, 25876 25889 A871DED30A1530C700B12A68 /* RenderFrame.h in Headers */, 25890 53B895AF19DC7ED9009CAA93 /* MicroTask.h in Headers */, 25877 25891 0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */, 25878 25892 A871DED10A1530C700B12A68 /* RenderFrameSet.h in Headers */, … … 27202 27216 417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */, 27203 27217 A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */, 27218 CB8CF01F1A95DE59000D510B /* MicroTaskTest.cpp in Sources */, 27204 27219 53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */, 27205 27220 A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */, … … 29837 29852 B2227A930D00BF220071B782 /* SVGPolylineElement.cpp in Sources */, 29838 29853 B2227A960D00BF220071B782 /* SVGPreserveAspectRatio.cpp in Sources */, 29854 CB8CF0181A9358D4000D510B /* MicroTask.cpp in Sources */, 29839 29855 B543B85717EB758F003BE93A /* SVGPropertyInfo.cpp in Sources */, 29840 29856 B2227A990D00BF220071B782 /* SVGRadialGradientElement.cpp in Sources */, -
trunk/Source/WebCore/dom/Document.h
r180914 r180996 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
r180914 r180996 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
r180914 r180996 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
r180963 r180996 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
r180914 r180996 367 367 368 368 RefPtr<File> createFile(const String&); 369 void queueMicroTask(int); 369 370 370 371 private: -
trunk/Source/WebCore/testing/Internals.idl
r180914 r180996 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.