Changeset 288610 in webkit
- Timestamp:
- Jan 26, 2022 1:25:24 AM (6 months ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/model-element/HTMLModelElement.cpp (modified) (4 diffs)
-
WebCore/Modules/model-element/HTMLModelElement.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (modified) (1 diff)
-
WebKit/UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r288605 r288610 1 2022-01-26 Antoine Quint <graouts@webkit.org> 2 3 [Model] Mouse interaction for <model> is flipped in the y-axis 4 https://bugs.webkit.org/show_bug.cgi?id=235363 5 <rdar://problem/87772557> 6 7 Reviewed by Dean Jackson. 8 9 The mouse coordinates we should send up to the ARQL APIs are in the coordinates 10 of the <model> element with the y-axis flipped. 11 12 * Modules/model-element/HTMLModelElement.cpp: 13 (WebCore::HTMLModelElement::flippedLocationInElementForMouseEvent): 14 (WebCore::HTMLModelElement::dragDidStart): 15 (WebCore::HTMLModelElement::dragDidChange): 16 (WebCore::HTMLModelElement::dragDidEnd): 17 * Modules/model-element/HTMLModelElement.h: 18 1 19 2022-01-25 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp
r288440 r288610 345 345 } 346 346 347 LayoutPoint HTMLModelElement::flippedLocationInElementForMouseEvent(MouseEvent& event) 348 { 349 LayoutUnit flippedY { event.offsetY() }; 350 if (auto* renderModel = dynamicDowncast<RenderModel>(renderer())) 351 flippedY = renderModel->paddingBoxHeight() - flippedY; 352 return { LayoutUnit(event.offsetX()), flippedY }; 353 } 354 347 355 void HTMLModelElement::dragDidStart(MouseEvent& event) 348 356 { … … 358 366 359 367 if (m_modelPlayer) 360 m_modelPlayer->handleMouseDown( event.pageLocation(), event.timeStamp());368 m_modelPlayer->handleMouseDown(flippedLocationInElementForMouseEvent(event), event.timeStamp()); 361 369 } 362 370 … … 368 376 369 377 if (m_modelPlayer) 370 m_modelPlayer->handleMouseMove( event.pageLocation(), event.timeStamp());378 m_modelPlayer->handleMouseMove(flippedLocationInElementForMouseEvent(event), event.timeStamp()); 371 379 } 372 380 … … 384 392 385 393 if (m_modelPlayer) 386 m_modelPlayer->handleMouseUp( event.pageLocation(), event.timeStamp());394 m_modelPlayer->handleMouseUp(flippedLocationInElementForMouseEvent(event), event.timeStamp()); 387 395 } 388 396 -
trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h
r288424 r288610 138 138 void dragDidEnd(MouseEvent&); 139 139 140 LayoutPoint flippedLocationInElementForMouseEvent(MouseEvent&); 141 140 142 void setAnimationIsPlaying(bool, DOMPromiseDeferred<void>&&); 141 143 -
trunk/Source/WebKit/ChangeLog
r288609 r288610 1 2022-01-26 Antoine Quint <graouts@webkit.org> 2 3 [Model] Mouse interaction for <model> is flipped in the y-axis 4 https://bugs.webkit.org/show_bug.cgi?id=235363 5 <rdar://problem/87772557> 6 7 Reviewed by Dean Jackson. 8 9 The mouse coordinates consumed by the ARQL APIs are in the coordinates 10 of the <model> element with the y-axis flipped, so let's label them 11 as such. 12 13 * UIProcess/Cocoa/ModelElementControllerCocoa.mm: 14 (WebKit::ModelElementController::handleMouseDownForModelElement): 15 (WebKit::ModelElementController::handleMouseMoveForModelElement): 16 (WebKit::ModelElementController::handleMouseUpForModelElement): 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::handleMouseDownForModelElement): 19 (WebKit::WebPageProxy::handleMouseMoveForModelElement): 20 (WebKit::WebPageProxy::handleMouseUpForModelElement): 21 * UIProcess/WebPageProxy.messages.in: 22 * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: 23 (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseDown): 24 (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseMove): 25 (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseUp): 26 1 27 2022-01-26 Alexander Mikhaylenko <alexm@gnome.org> 2 28 -
trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm
r288424 r288610 216 216 } 217 217 218 void ModelElementController::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)218 void ModelElementController::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 219 219 { 220 220 if (auto preview = previewForUUID(uuid)) 221 [preview mouseDownAtLocation:CGPointMake( locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];222 } 223 224 void ModelElementController::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)221 [preview mouseDownAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()]; 222 } 223 224 void ModelElementController::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 225 225 { 226 226 if (auto preview = previewForUUID(uuid)) 227 [preview mouseDraggedAtLocation:CGPointMake( locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];228 } 229 230 void ModelElementController::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)227 [preview mouseDraggedAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()]; 228 } 229 230 void ModelElementController::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 231 231 { 232 232 if (auto preview = previewForUUID(uuid)) 233 [preview mouseUpAtLocation:CGPointMake( locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];233 [preview mouseUpAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()]; 234 234 } 235 235 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r288605 r288610 11012 11012 } 11013 11013 11014 void WebPageProxy::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)11015 { 11016 modelElementController()->handleMouseDownForModelElement(uuid, locationInPageCoordinates, timestamp);11017 } 11018 11019 void WebPageProxy::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)11020 { 11021 modelElementController()->handleMouseMoveForModelElement(uuid, locationInPageCoordinates, timestamp);11022 } 11023 11024 void WebPageProxy::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)11025 { 11026 modelElementController()->handleMouseUpForModelElement(uuid, locationInPageCoordinates, timestamp);11014 void WebPageProxy::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11015 { 11016 modelElementController()->handleMouseDownForModelElement(uuid, flippedLocationInElement, timestamp); 11017 } 11018 11019 void WebPageProxy::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11020 { 11021 modelElementController()->handleMouseMoveForModelElement(uuid, flippedLocationInElement, timestamp); 11022 } 11023 11024 void WebPageProxy::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11025 { 11026 modelElementController()->handleMouseUpForModelElement(uuid, flippedLocationInElement, timestamp); 11027 11027 } 11028 11028 #endif -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r288104 r288610 589 589 #if ENABLE(ARKIT_INLINE_PREVIEW_MAC) 590 590 ModelElementDidCreatePreview(URL url, String uuid, WebCore::FloatSize size) -> (Expected<std::pair<String, uint32_t>, WebCore::ResourceError> result) Async 591 HandleMouseDownForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)592 HandleMouseMoveForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)593 HandleMouseUpForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)591 HandleMouseDownForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 592 HandleMouseMoveForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 593 HandleMouseUpForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp) 594 594 #endif 595 595 #if ENABLE(ARKIT_INLINE_PREVIEW) -
trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm
r286937 r288610 186 186 } 187 187 188 void ARKitInlinePreviewModelPlayerMac::handleMouseDown(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)188 void ARKitInlinePreviewModelPlayerMac::handleMouseDown(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 189 189 { 190 190 if (auto* page = this->page()) 191 page->send(Messages::WebPageProxy::HandleMouseDownForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));192 } 193 194 void ARKitInlinePreviewModelPlayerMac::handleMouseMove(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)191 page->send(Messages::WebPageProxy::HandleMouseDownForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp)); 192 } 193 194 void ARKitInlinePreviewModelPlayerMac::handleMouseMove(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 195 195 { 196 196 if (auto* page = this->page()) 197 page->send(Messages::WebPageProxy::HandleMouseMoveForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));198 } 199 200 void ARKitInlinePreviewModelPlayerMac::handleMouseUp(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)197 page->send(Messages::WebPageProxy::HandleMouseMoveForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp)); 198 } 199 200 void ARKitInlinePreviewModelPlayerMac::handleMouseUp(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 201 201 { 202 202 if (auto* page = this->page()) 203 page->send(Messages::WebPageProxy::HandleMouseUpForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));203 page->send(Messages::WebPageProxy::HandleMouseUpForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp)); 204 204 } 205 205
Note: See TracChangeset
for help on using the changeset viewer.