Changeset 292902 in webkit
- Timestamp:
- Apr 15, 2022, 2:37:47 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 23 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/model-element/model-element-inline-preview-deletion-upon-source-change-expected.txt (added)
-
LayoutTests/model-element/model-element-inline-preview-deletion-upon-source-change.html (added)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/model-element/HTMLModelElement.cpp (modified) (1 diff)
-
Source/WebCore/Modules/model-element/HTMLModelElement.h (modified) (1 diff)
-
Source/WebCore/Modules/model-element/HTMLModelElement.idl (modified) (1 diff)
-
Source/WebCore/Modules/model-element/ModelPlayer.cpp (modified) (1 diff)
-
Source/WebCore/Modules/model-element/ModelPlayer.h (modified) (1 diff)
-
Source/WebCore/loader/FrameLoaderClient.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (2 diffs)
-
Source/WebCore/testing/Internals.h (modified) (2 diffs)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/ModelElementController.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h (modified) (1 diff)
-
Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r292897 r292902 1 2022-04-14 Antoine Quint <graouts@apple.com> 2 3 [model] ASVInlinePreview objects don't get cleared when the model source changes 4 https://bugs.webkit.org/show_bug.cgi?id=239064 5 <rdar://problem/90391037> 6 7 Reviewed by Dean Jackson. 8 9 Add a new test which loads a <model> element with a valid resource, checks its UUID against 10 those loaded in the UI process, and then removes the <model> source to check that same UUID 11 is not longer loaded. 12 13 This test is currently disabled on OpenSource bots. 14 15 * model-element/model-element-inline-preview-deletion-upon-source-change-expected.txt: Added. 16 * model-element/model-element-inline-preview-deletion-upon-source-change.html: Added. 17 * platform/ios/TestExpectations: 18 * platform/mac/TestExpectations: 19 1 20 2022-04-14 Matteo Flores <matteo_flores@apple.com> 2 21 -
trunk/LayoutTests/platform/ios/TestExpectations
r292859 r292902 3429 3429 model-element/model-element-camera.html [ Skip ] 3430 3430 model-element/model-element-interactive-dragging.html [ Skip ] 3431 model-element/model-element-inline-preview-deletion-upon-source-change.html [ Skip ] 3431 3432 3432 3433 # webkit.org/b/201982 These are flaky failures on iOS -
trunk/LayoutTests/platform/mac/TestExpectations
r292875 r292902 111 111 model-element/model-element-camera.html [ Skip ] 112 112 model-element/model-element-interactive-dragging.html [ Skip ] 113 model-element/model-element-inline-preview-deletion-upon-source-change.html [ Skip ] 113 114 114 115 # Accessibility tests for notifications that don't exist or aren't needed on Mac OS X. -
trunk/Source/WebCore/ChangeLog
r292901 r292902 1 2022-04-14 Antoine Quint <graouts@apple.com> 2 3 [model] ASVInlinePreview objects don't get cleared when the model source changes 4 https://bugs.webkit.org/show_bug.cgi?id=239064 5 <rdar://problem/90391037> 6 7 Reviewed by Dean Jackson. 8 9 Expose two new window.internals methods for tests to be able to query the list of UUIDs 10 currently loaded in the UI process and get the UUID for a given <model> element. 11 12 Test: model-element/model-element-inline-preview-deletion-upon-source-change.html 13 14 * Modules/model-element/HTMLModelElement.cpp: 15 (WebCore::HTMLModelElement::inlinePreviewUUIDForTesting const): 16 * Modules/model-element/HTMLModelElement.h: 17 * Modules/model-element/HTMLModelElement.idl: 18 * Modules/model-element/ModelPlayer.cpp: 19 (WebCore::ModelPlayer::inlinePreviewUUIDForTesting const): 20 * Modules/model-element/ModelPlayer.h: 21 * loader/FrameLoaderClient.h: 22 * testing/Internals.cpp: 23 (WebCore::Internals::modelInlinePreviewUUIDs const): 24 (WebCore::Internals::modelInlinePreviewUUIDForModelElement const): 25 * testing/Internals.h: 26 * testing/Internals.idl: 27 1 28 2022-04-14 Martin Robinson <mrobinson@webkit.org> 2 29 -
trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp
r291395 r292902 669 669 } 670 670 671 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 672 String HTMLModelElement::inlinePreviewUUIDForTesting() const 673 { 674 if (!m_modelPlayer) 675 return emptyString(); 676 return m_modelPlayer->inlinePreviewUUIDForTesting(); 677 } 678 #endif 679 671 680 } 672 681 -
trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h
r291245 r292902 110 110 void sizeMayHaveChanged(); 111 111 112 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 113 WEBCORE_EXPORT String inlinePreviewUUIDForTesting() const; 114 #endif 115 112 116 private: 113 117 HTMLModelElement(const QualifiedName&, Document&); -
trunk/Source/WebCore/Modules/model-element/HTMLModelElement.idl
r288728 r292902 27 27 Conditional=MODEL_ELEMENT, 28 28 EnabledBySetting=ModelElementEnabled, 29 ExportToWrappedFunction, 29 30 Exposed=Window, 31 JSGenerateToNativeObject 30 32 ] interface HTMLModelElement : HTMLElement { 31 33 [URL] readonly attribute USVString currentSrc; -
trunk/Source/WebCore/Modules/model-element/ModelPlayer.cpp
r288728 r292902 45 45 } 46 46 47 String ModelPlayer::inlinePreviewUUIDForTesting() const 48 { 49 return emptyString(); 47 50 } 51 52 } -
trunk/Source/WebCore/Modules/model-element/ModelPlayer.h
r289495 r292902 66 66 virtual void isMuted(CompletionHandler<void(std::optional<bool>&&)>&&) = 0; 67 67 virtual void setIsMuted(bool, CompletionHandler<void(bool success)>&&) = 0; 68 virtual String inlinePreviewUUIDForTesting() const; 68 69 #if PLATFORM(COCOA) 69 70 virtual Vector<RetainPtr<id>> accessibilityChildren() = 0; -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r292477 r292902 390 390 391 391 virtual bool isParentProcessAFullWebBrowser() const { return false; } 392 393 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 394 virtual void modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>)>&&) const { } 395 #endif 392 396 }; 393 397 -
trunk/Source/WebCore/testing/Internals.cpp
r292899 r292902 364 364 #endif 365 365 366 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 367 #include "HTMLModelElement.h" 368 #endif 369 366 370 using JSC::CallData; 367 371 using JSC::CodeBlock; … … 6764 6768 } 6765 6769 6770 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 6771 6772 void Internals::modelInlinePreviewUUIDs(ModelInlinePreviewUUIDsPromise&& promise) const 6773 { 6774 auto* document = contextDocument(); 6775 if (!document) { 6776 promise.reject(InvalidStateError); 6777 return; 6778 } 6779 6780 auto* frame = document->frame(); 6781 if (!frame) { 6782 promise.reject(InvalidStateError); 6783 return; 6784 } 6785 6786 CompletionHandler<void(Vector<String>&&)> completionHandler = [promise = WTFMove(promise)] (Vector<String> uuids) mutable { 6787 promise.resolve(uuids); 6788 }; 6789 6790 frame->loader().client().modelInlinePreviewUUIDs(WTFMove(completionHandler)); 6791 } 6792 6793 String Internals::modelInlinePreviewUUIDForModelElement(const HTMLModelElement& modelElement) const 6794 { 6795 return modelElement.inlinePreviewUUIDForTesting(); 6796 } 6797 6798 #endif 6799 6766 6800 } // namespace WebCore -
trunk/Source/WebCore/testing/Internals.h
r292859 r292902 158 158 #endif 159 159 160 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 161 class HTMLModelElement; 162 #endif 163 160 164 namespace ImageOverlay { 161 165 class CroppedImage; … … 1297 1301 void overrideModalContainerSearchTermForTesting(const String& term); 1298 1302 1303 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 1304 using ModelInlinePreviewUUIDsPromise = DOMPromiseDeferred<IDLSequence<IDLDOMString>>; 1305 void modelInlinePreviewUUIDs(ModelInlinePreviewUUIDsPromise&&) const; 1306 String modelInlinePreviewUUIDForModelElement(const HTMLModelElement&) const; 1307 #endif 1308 1299 1309 private: 1300 1310 explicit Internals(Document&); -
trunk/Source/WebCore/testing/Internals.idl
r292859 r292902 1138 1138 1139 1139 undefined overrideModalContainerSearchTermForTesting(DOMString term); 1140 }; 1140 1141 [Conditional=ARKIT_INLINE_PREVIEW_MAC] Promise<sequence<DOMString>> modelInlinePreviewUUIDs(); 1142 [Conditional=ARKIT_INLINE_PREVIEW_MAC] DOMString modelInlinePreviewUUIDForModelElement(HTMLModelElement modelElement); 1143 }; -
trunk/Source/WebKit/ChangeLog
r292898 r292902 1 2022-04-14 Antoine Quint <graouts@apple.com> 2 3 [model] ASVInlinePreview objects don't get cleared when the model source changes 4 https://bugs.webkit.org/show_bug.cgi?id=239064 5 <rdar://problem/90391037> 6 7 Reviewed by Dean Jackson. 8 9 We add a new ModelElementDestroyRemotePreview message going from the Web process to the 10 UI process to notify that an ASVInlinePreview with a given UUID should be cleared. This 11 message is sent via ~ARKitInlinePreviewModelPlayerMac since any unused resource will 12 trigger the destruction of such objects. 13 14 For testing purposes, we also add a new ModelInlinePreviewUUIDs message going from the 15 Web process to the UI process to retreive the list of UUIDs for the ASVInlinePreview 16 objects currently loaded in the UI process. This will allow tests to check whether 17 the UUID for a given <model> element is correctly removed from the UI process. 18 19 * UIProcess/Cocoa/ModelElementControllerCocoa.mm: 20 (WebKit::ModelElementController::modelElementDestroyRemotePreview): 21 (WebKit::ModelElementController::inlinePreviewUUIDs): 22 * UIProcess/ModelElementController.h: 23 * UIProcess/WebPageProxy.cpp: 24 (WebKit::WebPageProxy::modelElementDestroyRemotePreview): 25 (WebKit::WebPageProxy::modelInlinePreviewUUIDs): 26 * UIProcess/WebPageProxy.h: 27 * UIProcess/WebPageProxy.messages.in: 28 * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h: 29 * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: 30 (WebKit::ARKitInlinePreviewModelPlayerMac::~ARKitInlinePreviewModelPlayerMac): 31 (WebKit::ARKitInlinePreviewModelPlayerMac::inlinePreviewUUIDForTesting const): 32 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 33 (WebKit::WebFrameLoaderClient::modelInlinePreviewUUIDs const): 34 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 35 1 36 2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 37 -
trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm
r291393 r292902 241 241 } 242 242 243 void ModelElementController::modelElementDestroyRemotePreview(String uuid) 244 { 245 m_inlinePreviews.remove(uuid); 246 } 247 243 248 RetainPtr<ASVInlinePreview> ModelElementController::previewForUUID(const String& uuid) 244 249 { … … 300 305 } 301 306 307 void ModelElementController::inlinePreviewUUIDs(CompletionHandler<void(Vector<String>&&)>&& completionHandler) 308 { 309 completionHandler(WTF::map(m_inlinePreviews, [](auto& entry) { 310 return entry.key; 311 })); 312 } 302 313 #endif 303 314 -
trunk/Source/WebKit/UIProcess/ModelElementController.h
r291393 r292902 76 76 void modelElementCreateRemotePreview(String, WebCore::FloatSize, CompletionHandler<void(Expected<std::pair<String, uint32_t>, WebCore::ResourceError>)>&&); 77 77 void modelElementLoadRemotePreview(String, URL, CompletionHandler<void(std::optional<WebCore::ResourceError>&&)>&&); 78 void modelElementDestroyRemotePreview(String); 78 79 void modelElementSizeDidChange(const String& uuid, WebCore::FloatSize, CompletionHandler<void(Expected<MachSendRight, WebCore::ResourceError>)>&&); 79 80 void handleMouseDownForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 80 81 void handleMouseMoveForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 81 82 void handleMouseUpForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 83 void inlinePreviewUUIDs(CompletionHandler<void(Vector<String>&&)>&&); 82 84 #endif 83 85 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r292800 r292902 11219 11219 } 11220 11220 11221 void WebPageProxy::modelElementDestroyRemotePreview(const String& uuid) 11222 { 11223 modelElementController()->modelElementDestroyRemotePreview(uuid); 11224 } 11225 11221 11226 void WebPageProxy::modelElementSizeDidChange(const String& uuid, WebCore::FloatSize size, CompletionHandler<void(Expected<MachSendRight, WebCore::ResourceError>)>&& completionHandler) 11222 11227 { … … 11237 11242 { 11238 11243 modelElementController()->handleMouseUpForModelElement(uuid, flippedLocationInElement, timestamp); 11244 } 11245 11246 void WebPageProxy::modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>&&)>&& completionHandler) 11247 { 11248 modelElementController()->inlinePreviewUUIDs(WTFMove(completionHandler)); 11239 11249 } 11240 11250 #endif -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r292898 r292902 618 618 void modelElementCreateRemotePreview(const String&, const WebCore::FloatSize&, CompletionHandler<void(Expected<std::pair<String, uint32_t>, WebCore::ResourceError>)>&&); 619 619 void modelElementLoadRemotePreview(const String&, const URL&, CompletionHandler<void(std::optional<WebCore::ResourceError>&&)>&&); 620 void modelElementDestroyRemotePreview(const String&); 620 621 void modelElementSizeDidChange(const String&, WebCore::FloatSize, CompletionHandler<void(Expected<MachSendRight, WebCore::ResourceError>)>&&); 621 622 void handleMouseDownForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 622 623 void handleMouseMoveForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 623 624 void handleMouseUpForModelElement(const String&, const WebCore::LayoutPoint&, MonotonicTime); 625 void modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>&&)>&&); 624 626 #endif 625 627 -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r292812 r292902 598 598 ModelElementCreateRemotePreview(String uuid, WebCore::FloatSize size) -> (Expected<std::pair<String, uint32_t>, WebCore::ResourceError> result) 599 599 ModelElementLoadRemotePreview(String uuid, URL url) -> (std::optional<WebCore::ResourceError> error) 600 ModelElementDestroyRemotePreview(String uuid) 600 601 ModelElementSizeDidChange(String uuid, WebCore::FloatSize size) -> (Expected<MachSendRight, WebCore::ResourceError> result) 601 602 HandleMouseDownForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 602 603 HandleMouseMoveForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 603 604 HandleMouseUpForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 605 ModelInlinePreviewUUIDs() -> (Vector<String> uuids) 604 606 #endif 605 607 #if ENABLE(ARKIT_INLINE_PREVIEW) -
trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h
r291393 r292902 59 59 void handleMouseMove(const WebCore::LayoutPoint&, MonotonicTime) override; 60 60 void handleMouseUp(const WebCore::LayoutPoint&, MonotonicTime) override; 61 String inlinePreviewUUIDForTesting() const override; 61 62 62 63 void createFile(WebCore::Model&); -
trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm
r291842 r292902 56 56 ARKitInlinePreviewModelPlayerMac::~ARKitInlinePreviewModelPlayerMac() 57 57 { 58 if (m_inlinePreview) { 59 if (auto* page = this->page()) 60 page->send(Messages::WebPageProxy::ModelElementDestroyRemotePreview([m_inlinePreview uuid].UUIDString)); 61 } 58 62 clearFile(); 59 63 } … … 296 300 } 297 301 302 String ARKitInlinePreviewModelPlayerMac::inlinePreviewUUIDForTesting() const 303 { 304 if (!m_inlinePreview) 305 return emptyString(); 306 return [m_inlinePreview uuid].UUIDString; 307 } 308 298 309 } 299 310 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r292477 r292902 2015 2015 } 2016 2016 2017 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 2018 void WebFrameLoaderClient::modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>)>&& completionHandler) const 2019 { 2020 auto* webPage = m_frame->page(); 2021 if (!webPage) { 2022 completionHandler({ }); 2023 return; 2024 } 2025 2026 webPage->sendWithAsyncReply(Messages::WebPageProxy::ModelInlinePreviewUUIDs(), WTFMove(completionHandler)); 2027 } 2028 #endif 2029 2017 2030 } // namespace WebKit 2018 2031 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r292477 r292902 297 297 298 298 bool isParentProcessAFullWebBrowser() const final; 299 300 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 301 void modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>)>&&) const final; 302 #endif 299 303 }; 300 304
Note:
See TracChangeset
for help on using the changeset viewer.