$OpenBSD$ index 294c74f..4cdac97 100644 --- dom/events/Event.cpp.orig Fri Feb 20 15:40:37 2015 +++ dom/events/Event.cpp Fri Feb 20 15:40:37 2015 @@ -829,6 +829,19 @@ Event::GetScreenCoords(nsPresContext* aPresContext, WidgetEvent* aEvent, LayoutDeviceIntPoint aPoint) { + if (!nsContentUtils::IsCallerChrome()) { + // For non-chrome callers, return client coordinates instead. + // For some events, the result will be zero; specifically, for dragend + // events (there is no widget associated with dragend events, which + // causes GetClientX() to return zero). Since dragend is for the drag + // originator and not for the receiver, it is probably not widely used + // (receivers get a drop event). Therefore, returning 0 should not break + // many web pages. Also, a few years ago Firefox returned 0. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=466379 + CSSIntPoint clientCoords = GetClientCoords(aPresContext, aEvent, aPoint, CSSIntPoint(0, 0)); + return nsIntPoint(clientCoords.x, clientCoords.y); + } + if (EventStateManager::sIsPointerLocked) { return EventStateManager::sLastScreenPoint; }