Loading content/events/src/Touch.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -61,14 +61,16 @@ Touch::Target() const NS_IMETHODIMP Touch::GetScreenX(int32_t* aScreenX) { *aScreenX = ScreenX(); bool isChrome = nsContentUtils::IsCallerChrome(); *aScreenX = isChrome ? ScreenX() : ClientX(); return NS_OK; } NS_IMETHODIMP Touch::GetScreenY(int32_t* aScreenY) { *aScreenY = ScreenY(); bool isChrome = nsContentUtils::IsCallerChrome(); *aScreenY = isChrome ? ScreenY() : ClientY(); return NS_OK; } Loading content/events/src/nsDOMEvent.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -1061,6 +1061,7 @@ nsDOMEvent::Shutdown() } } // XXX: This may need adjusting to be client-relative for content nsIntPoint nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext, nsEvent* aEvent, Loading content/events/src/nsDOMMouseEvent.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,19 @@ nsDOMMouseEvent::GetMozMovementY(int32_t* aMovementY) NS_METHOD nsDOMMouseEvent::GetScreenX(int32_t* aScreenX) { NS_ENSURE_ARG_POINTER(aScreenX); bool isChrome = nsContentUtils::IsCallerChrome(); if (!isChrome) { // 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 return GetClientX(aScreenX); } *aScreenX = ScreenX(); return NS_OK; } Loading @@ -324,6 +337,13 @@ NS_IMETHODIMP nsDOMMouseEvent::GetScreenY(int32_t* aScreenY) { NS_ENSURE_ARG_POINTER(aScreenY); bool isChrome = nsContentUtils::IsCallerChrome(); if (!isChrome) { // For non-chrome callers, return client coordinates instead. // See also the comment in nsDOMMouseEvent::GetScreenX(). return GetClientY(aScreenY); } *aScreenY = ScreenY(); return NS_OK; } Loading layout/xul/base/src/nsBoxObject.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ nsBoxObject::GetHeight(int32_t* aResult) return NS_OK; } // XXX: Does this need to be client coords for content? NS_IMETHODIMP nsBoxObject::GetScreenX(int32_t *_retval) { Loading Loading
content/events/src/Touch.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -61,14 +61,16 @@ Touch::Target() const NS_IMETHODIMP Touch::GetScreenX(int32_t* aScreenX) { *aScreenX = ScreenX(); bool isChrome = nsContentUtils::IsCallerChrome(); *aScreenX = isChrome ? ScreenX() : ClientX(); return NS_OK; } NS_IMETHODIMP Touch::GetScreenY(int32_t* aScreenY) { *aScreenY = ScreenY(); bool isChrome = nsContentUtils::IsCallerChrome(); *aScreenY = isChrome ? ScreenY() : ClientY(); return NS_OK; } Loading
content/events/src/nsDOMEvent.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -1061,6 +1061,7 @@ nsDOMEvent::Shutdown() } } // XXX: This may need adjusting to be client-relative for content nsIntPoint nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext, nsEvent* aEvent, Loading
content/events/src/nsDOMMouseEvent.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,19 @@ nsDOMMouseEvent::GetMozMovementY(int32_t* aMovementY) NS_METHOD nsDOMMouseEvent::GetScreenX(int32_t* aScreenX) { NS_ENSURE_ARG_POINTER(aScreenX); bool isChrome = nsContentUtils::IsCallerChrome(); if (!isChrome) { // 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 return GetClientX(aScreenX); } *aScreenX = ScreenX(); return NS_OK; } Loading @@ -324,6 +337,13 @@ NS_IMETHODIMP nsDOMMouseEvent::GetScreenY(int32_t* aScreenY) { NS_ENSURE_ARG_POINTER(aScreenY); bool isChrome = nsContentUtils::IsCallerChrome(); if (!isChrome) { // For non-chrome callers, return client coordinates instead. // See also the comment in nsDOMMouseEvent::GetScreenX(). return GetClientY(aScreenY); } *aScreenY = ScreenY(); return NS_OK; } Loading
layout/xul/base/src/nsBoxObject.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ nsBoxObject::GetHeight(int32_t* aResult) return NS_OK; } // XXX: Does this need to be client coords for content? NS_IMETHODIMP nsBoxObject::GetScreenX(int32_t *_retval) { Loading