Bug 1561522 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

MouseEvent.screenX and MouseEvent.screenY should be coordinates based on CSS pixels, but sometimes they become coordinates based on physical pixels on the device unexpectedly. I still couldn't narrow down minimum conditions to reproduce, but it happens on an actual addon [Tree Style Tab (TST)](https://addons.mozilla.org/firefox/addon/tree-style-tab/), so I file this as a bug of WebExtensions for now.

# Steps to reproduce

1. Prepare Hi-dpi screen and set device pixel ratio larger than 1. (I tested with 1.25 on Windows 10.)
2. Start Nightly with a clean profile.
3. Go to `about:debugging`.
4. Load attached xpi (development build of TST with debug log) as a temporary addon. Then the sidebar appears and TST's sidebar panel is loaded.
5. Open a debugger tab for the loaded temporary addon TST.
6. Choose the console tab in the debugger.
7. Click the pull down menu in the sidebar header, and choose "Move Sidebar to RIght".
8. Drag an item in the sidebar and drop it on the dragged item itself (of course inside the sidebar area) again and again.

# Actual result

Sometimes you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1813 <= unnaturally too large!
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         965 <=unnaturally too large!
```

# Expected result:

Always you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1450 <= between the expected range
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         760 <= between the expected range
```

# Environment

* Windows 10 Pro 1809 (64bit)
* Firefox 67.0.4 (64bit)
* Nightly 69.0a1 (64bit) build id: 20190625215814
MouseEvent.screenX and MouseEvent.screenY should be coordinates based on CSS pixels, but sometimes they become coordinates based on physical pixels on the device unexpectedly on an event listener for `dragend`. I still couldn't narrow down minimum conditions to reproduce, but it happens on an actual addon [Tree Style Tab (TST)](https://addons.mozilla.org/firefox/addon/tree-style-tab/), so I file this as a bug of WebExtensions for now.

# Steps to reproduce

1. Prepare Hi-dpi screen and set device pixel ratio larger than 1. (I tested with 1.25 on Windows 10.)
2. Start Nightly with a clean profile.
3. Go to `about:debugging`.
4. Load attached xpi (development build of TST with debug log) as a temporary addon. Then the sidebar appears and TST's sidebar panel is loaded.
5. Open a debugger tab for the loaded temporary addon TST.
6. Choose the console tab in the debugger.
7. Click the pull down menu in the sidebar header, and choose "Move Sidebar to RIght".
8. Drag an item in the sidebar and drop it on the dragged item itself (of course inside the sidebar area) again and again.

# Actual result

Sometimes you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1813 <= unnaturally too large!
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         965 <=unnaturally too large!
```

# Expected result:

Always you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1450 <= between the expected range
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         760 <= between the expected range
```

# Environment

* Windows 10 Pro 1809 (64bit)
* Firefox 67.0.4 (64bit)
* Nightly 69.0a1 (64bit) build id: 20190625215814
MouseEvent.screenX and MouseEvent.screenY should be coordinates based on CSS pixels, but sometimes they become coordinates based on physical pixels on the device unexpectedly on an event listener for `dragend`. I still couldn't narrow down minimum conditions to reproduce, but it happens on an actual addon [Tree Style Tab (TST)](https://addons.mozilla.org/firefox/addon/tree-style-tab/), so I file this as a bug of WebExtensions for now.

# Steps to reproduce

1. Prepare Hi-dpi screen and set device pixel ratio larger than 1. (I tested with 1.25 on Windows 10.)
2. Start Nightly with a clean profile.
3. Go to `about:debugging`.
4. Load attached xpi (development build of TST with debug log) as a temporary addon. Then the sidebar appears and TST's sidebar panel is loaded.
5. Open a debugger tab for the loaded temporary addon TST.
6. Choose the console tab in the debugger.
7. Click the pull down menu in the sidebar header, and choose "Move Sidebar to RIght".
8. Put the browser window at bottom-right edge of the screen (to maximize the erratic coordinates.)
9. Drag an item in the sidebar and drop it on the dragged item itself (of course inside the sidebar area) again and again.

# Actual result

Sometimes you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1813 <= unnaturally too large!
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         965 <=unnaturally too large!
```

# Expected result:

Always you get console output like below

```
expected range of screenX:  Object { from: 1355.199951171875, to: 1581.199951171875 }
screenX on dragstart:       1440
screenX on dragend:         1450 <= between the expected range
expected range of screenY:  Object { from: 483.20001220703125, to: 929.2000122070312 }
screenY on dragstart:       771
screenY on dragend:         760 <= between the expected range
```

# Environment

* Windows 10 Pro 1809 (64bit)
* Firefox 67.0.4 (64bit)
* Nightly 69.0a1 (64bit) build id: 20190625215814

Back to Bug 1561522 Comment 0