[Model] add support for controlling looping animations
Created attachment 444795 [details] Patch
<rdar://problem/85428884>
Comment on attachment 444795 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=444795&action=review > Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm:366 > + callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler), error = WebCore::ResourceError { WebCore::ResourceError::Type::General }] () mutable { Nit - might be simpler as `completionHandler(makeUnexpected(WebCore::ResourceError { WebCore::ResourceError::Type::General }));`, instead of copying the error via block capture. > Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm:397 > + callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler)] () mutable { Same question as the other patch — could we clarify why we need these `callOnMainRunLoop`s?
(In reply to Wenson Hsieh from comment #3) > Comment on attachment 444795 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=444795&action=review > > > Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm:366 > > + callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler), error = WebCore::ResourceError { WebCore::ResourceError::Type::General }] () mutable { > > Nit - might be simpler as > `completionHandler(makeUnexpected(WebCore::ResourceError { > WebCore::ResourceError::Type::General }));`, instead of copying the error > via block capture. Absolutely, will fix when landing. > > Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm:397 > > + callOnMainRunLoop([weakThis = WeakPtr { *this }, completionHandler = WTFMove(completionHandler)] () mutable { > > Same question as the other patch — could we clarify why we need these > `callOnMainRunLoop`s? I think we only need those when using block-based APIs, will remove the use of `callOnMainRunLoop()` when landing.
Committed r286066 (244453@main): <https://commits.webkit.org/244453@main>