Diff
Modified: trunk/Source/WebCore/ChangeLog (288609 => 288610)
--- trunk/Source/WebCore/ChangeLog 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebCore/ChangeLog 2022-01-26 09:25:24 UTC (rev 288610)
@@ -1,3 +1,21 @@
+2022-01-26 Antoine Quint <grao...@webkit.org>
+
+ [Model] Mouse interaction for <model> is flipped in the y-axis
+ https://bugs.webkit.org/show_bug.cgi?id=235363
+ <rdar://problem/87772557>
+
+ Reviewed by Dean Jackson.
+
+ The mouse coordinates we should send up to the ARQL APIs are in the coordinates
+ of the <model> element with the y-axis flipped.
+
+ * Modules/model-element/HTMLModelElement.cpp:
+ (WebCore::HTMLModelElement::flippedLocationInElementForMouseEvent):
+ (WebCore::HTMLModelElement::dragDidStart):
+ (WebCore::HTMLModelElement::dragDidChange):
+ (WebCore::HTMLModelElement::dragDidEnd):
+ * Modules/model-element/HTMLModelElement.h:
+
2022-01-25 Chris Dumez <cdu...@apple.com>
REGRESSION (iOS 15.2): Loading gets stuck after back-navigation involving COOP header
Modified: trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp (288609 => 288610)
--- trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp 2022-01-26 09:25:24 UTC (rev 288610)
@@ -344,6 +344,14 @@
dragDidEnd(mouseEvent);
}
+LayoutPoint HTMLModelElement::flippedLocationInElementForMouseEvent(MouseEvent& event)
+{
+ LayoutUnit flippedY { event.offsetY() };
+ if (auto* renderModel = dynamicDowncast<RenderModel>(renderer()))
+ flippedY = renderModel->paddingBoxHeight() - flippedY;
+ return { LayoutUnit(event.offsetX()), flippedY };
+}
+
void HTMLModelElement::dragDidStart(MouseEvent& event)
{
ASSERT(!m_isDragging);
@@ -357,7 +365,7 @@
m_isDragging = true;
if (m_modelPlayer)
- m_modelPlayer->handleMouseDown(event.pageLocation(), event.timeStamp());
+ m_modelPlayer->handleMouseDown(flippedLocationInElementForMouseEvent(event), event.timeStamp());
}
void HTMLModelElement::dragDidChange(MouseEvent& event)
@@ -367,7 +375,7 @@
event.setDefaultHandled();
if (m_modelPlayer)
- m_modelPlayer->handleMouseMove(event.pageLocation(), event.timeStamp());
+ m_modelPlayer->handleMouseMove(flippedLocationInElementForMouseEvent(event), event.timeStamp());
}
void HTMLModelElement::dragDidEnd(MouseEvent& event)
@@ -383,7 +391,7 @@
m_isDragging = false;
if (m_modelPlayer)
- m_modelPlayer->handleMouseUp(event.pageLocation(), event.timeStamp());
+ m_modelPlayer->handleMouseUp(flippedLocationInElementForMouseEvent(event), event.timeStamp());
}
// MARK: - Camera support.
Modified: trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h (288609 => 288610)
--- trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h 2022-01-26 09:25:24 UTC (rev 288610)
@@ -137,6 +137,8 @@
void dragDidChange(MouseEvent&);
void dragDidEnd(MouseEvent&);
+ LayoutPoint flippedLocationInElementForMouseEvent(MouseEvent&);
+
void setAnimationIsPlaying(bool, DOMPromiseDeferred<void>&&);
URL m_sourceURL;
Modified: trunk/Source/WebKit/ChangeLog (288609 => 288610)
--- trunk/Source/WebKit/ChangeLog 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebKit/ChangeLog 2022-01-26 09:25:24 UTC (rev 288610)
@@ -1,3 +1,29 @@
+2022-01-26 Antoine Quint <grao...@webkit.org>
+
+ [Model] Mouse interaction for <model> is flipped in the y-axis
+ https://bugs.webkit.org/show_bug.cgi?id=235363
+ <rdar://problem/87772557>
+
+ Reviewed by Dean Jackson.
+
+ The mouse coordinates consumed by the ARQL APIs are in the coordinates
+ of the <model> element with the y-axis flipped, so let's label them
+ as such.
+
+ * UIProcess/Cocoa/ModelElementControllerCocoa.mm:
+ (WebKit::ModelElementController::handleMouseDownForModelElement):
+ (WebKit::ModelElementController::handleMouseMoveForModelElement):
+ (WebKit::ModelElementController::handleMouseUpForModelElement):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::handleMouseDownForModelElement):
+ (WebKit::WebPageProxy::handleMouseMoveForModelElement):
+ (WebKit::WebPageProxy::handleMouseUpForModelElement):
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm:
+ (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseDown):
+ (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseMove):
+ (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseUp):
+
2022-01-26 Alexander Mikhaylenko <al...@gnome.org>
[GTK] REGRESSION: Touch scrolling is broken
Modified: trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (288609 => 288610)
--- trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm 2022-01-26 09:25:24 UTC (rev 288610)
@@ -215,22 +215,22 @@
return m_inlinePreviews.get(uuid);
}
-void ModelElementController::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ModelElementController::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto preview = previewForUUID(uuid))
- [preview mouseDownAtLocation:CGPointMake(locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
+ [preview mouseDownAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
}
-void ModelElementController::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ModelElementController::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto preview = previewForUUID(uuid))
- [preview mouseDraggedAtLocation:CGPointMake(locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
+ [preview mouseDraggedAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
}
-void ModelElementController::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ModelElementController::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto preview = previewForUUID(uuid))
- [preview mouseUpAtLocation:CGPointMake(locationInPageCoordinates.x().toFloat(), locationInPageCoordinates.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
+ [preview mouseUpAtLocation:CGPointMake(flippedLocationInElement.x().toFloat(), flippedLocationInElement.y().toFloat()) timestamp:timestamp.secondsSinceEpoch().value()];
}
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (288609 => 288610)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2022-01-26 09:25:24 UTC (rev 288610)
@@ -11011,19 +11011,19 @@
modelElementController()->modelElementDidCreatePreview(url, uuid, size, WTFMove(completionHandler));
}
-void WebPageProxy::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void WebPageProxy::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
- modelElementController()->handleMouseDownForModelElement(uuid, locationInPageCoordinates, timestamp);
+ modelElementController()->handleMouseDownForModelElement(uuid, flippedLocationInElement, timestamp);
}
-void WebPageProxy::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void WebPageProxy::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
- modelElementController()->handleMouseMoveForModelElement(uuid, locationInPageCoordinates, timestamp);
+ modelElementController()->handleMouseMoveForModelElement(uuid, flippedLocationInElement, timestamp);
}
-void WebPageProxy::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void WebPageProxy::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
- modelElementController()->handleMouseUpForModelElement(uuid, locationInPageCoordinates, timestamp);
+ modelElementController()->handleMouseUpForModelElement(uuid, flippedLocationInElement, timestamp);
}
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (288609 => 288610)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2022-01-26 09:25:24 UTC (rev 288610)
@@ -588,9 +588,9 @@
#endif
#if ENABLE(ARKIT_INLINE_PREVIEW_MAC)
ModelElementDidCreatePreview(URL url, String uuid, WebCore::FloatSize size) -> (Expected<std::pair<String, uint32_t>, WebCore::ResourceError> result) Async
- HandleMouseDownForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)
- HandleMouseMoveForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)
- HandleMouseUpForModelElement(String uuid, WebCore::LayoutPoint locationInPageCoordinates, MonotonicTime timestamp)
+ HandleMouseDownForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp)
+ HandleMouseMoveForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp)
+ HandleMouseUpForModelElement(String uuid, WebCore::LayoutPoint flippedLocationInElement, MonotonicTime timestamp)
#endif
#if ENABLE(ARKIT_INLINE_PREVIEW)
ModelElementGetCamera(struct WebKit::ModelIdentifier modelIdentifier) -> (Expected<WebCore::HTMLModelElementCamera, WebCore::ResourceError> result) Async
Modified: trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm (288609 => 288610)
--- trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm 2022-01-26 08:10:53 UTC (rev 288609)
+++ trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm 2022-01-26 09:25:24 UTC (rev 288610)
@@ -185,22 +185,22 @@
return false;
}
-void ARKitInlinePreviewModelPlayerMac::handleMouseDown(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ARKitInlinePreviewModelPlayerMac::handleMouseDown(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto* page = this->page())
- page->send(Messages::WebPageProxy::HandleMouseDownForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));
+ page->send(Messages::WebPageProxy::HandleMouseDownForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp));
}
-void ARKitInlinePreviewModelPlayerMac::handleMouseMove(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ARKitInlinePreviewModelPlayerMac::handleMouseMove(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto* page = this->page())
- page->send(Messages::WebPageProxy::HandleMouseMoveForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));
+ page->send(Messages::WebPageProxy::HandleMouseMoveForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp));
}
-void ARKitInlinePreviewModelPlayerMac::handleMouseUp(const LayoutPoint& locationInPageCoordinates, MonotonicTime timestamp)
+void ARKitInlinePreviewModelPlayerMac::handleMouseUp(const LayoutPoint& flippedLocationInElement, MonotonicTime timestamp)
{
if (auto* page = this->page())
- page->send(Messages::WebPageProxy::HandleMouseUpForModelElement([m_inlinePreview uuid].UUIDString, locationInPageCoordinates, timestamp));
+ page->send(Messages::WebPageProxy::HandleMouseUpForModelElement([m_inlinePreview uuid].UUIDString, flippedLocationInElement, timestamp));
}
}