Commit 4dee2ef8 authored by Botond Ballo's avatar Botond Ballo
Browse files

Bug 1638594 - Use visual coordinates when hit testing in a chrome document. r=tnikkel, a=jcristau

It does not make sense to ask for layout coordinates relative to
a chrome document. If the chrome document has a zoomed (RCD)
descendant in the same process, this means we do not apply the
visual-to-layout transform when later entering the RCD.

Depends on D79588

Differential Revision: https://phabricator.services.mozilla.com/D79589
parent 90044168
......@@ -6974,9 +6974,13 @@ nsIFrame* PresShell::EventHandler::GetFrameToHandleNonTouchEvent(
MOZ_ASSERT(aGUIEvent->mClass != eTouchEventClass);
ViewportType viewportType = ViewportType::Layout;
if (aRootFrameToHandleEvent->Type() == LayoutFrameType::Viewport &&
aRootFrameToHandleEvent->PresContext()->IsRootContentDocument()) {
viewportType = ViewportTypeForInputEventsRelativeToRoot();
if (aRootFrameToHandleEvent->Type() == LayoutFrameType::Viewport) {
nsPresContext* pc = aRootFrameToHandleEvent->PresContext();
if (pc->IsChrome()) {
viewportType = ViewportType::Visual;
} else if (pc->IsRootContentDocument()) {
viewportType = ViewportTypeForInputEventsRelativeToRoot();
}
}
RelativeTo relativeTo{aRootFrameToHandleEvent, viewportType};
nsPoint eventPoint =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment