Test that WebContextMenu position property is in the correct coordinate space

Bug #1471181 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Medium
Olivier Tilloy
1.9
Medium
Olivier Tilloy

Bug Description

From looking at the code in Chromium that is used to bring up the context menu, it's not clear whether the position is in the source frame's coordinate space, or the WebView one. It's also not clear whether it's in physical or device-independent pixels.

It should be in the WebView coordinate space, and in physical pixels.

Testing this sort-of depends on bug 1399207, which will make it easier to add new test runs with arbitrary configurations (such as a non-unity device scale).

Related branches

Changed in oxide:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Olivier Tilloy (osomon) wrote :

I just did some tests on a touch device, and it appears the position is expressed in device-independent pixels. One needs to multiply the coordinates by document.defaultView.devicePixelRatio to obtain a value in physical pixels.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

What about whether the position is relative to the origin of the webview, or of the frame?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Not tested yet, will do when I get around to fixing the units the position is expressed in.

Revision history for this message
Olivier Tilloy (osomon) wrote :

I just verified that the position is relative to the origin of the webview, so that at least is correct.
Working on a fix for the units.

Changed in oxide:
status: Triaged → In Progress
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Note that the coordinate space is already being tested by existing unit tests (see http://bazaar.launchpad.net/~oxide-developers/oxide/oxide.trunk/view/head:/qt/tests/qmltests/api/tst_WebView_contextMenu.qml#L64), where invoking a context menu on an iframe and verifying that the position corresponds to the position where the mouse was clicked, in webview coordinates.

The units (DIP vs physical pixels) is not being tested at the moment, it could probably be tested by setting the value of the OXIDE_FORCE_DPR environment variable to something ≠ 1.0.

Olivier Tilloy (osomon)
Changed in oxide:
status: In Progress → Fix Released
milestone: none → 1.9.1
milestone: 1.9.1 → branch-1.10
Revision history for this message
Olivier Tilloy (osomon) wrote :

Marked this bug fixed, and filed bug #1490907 to track the need for a unit test that verifies that the position is expressed in physical pixels.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers