Bug 96447
| Summary: | screen.availTop and screen.availLeft values are incorrect on systems with multiple displays | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Charles d'Harcourt <xcgxp397> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | UNCONFIRMED | ||
| Severity: | Normal | CC: | ahmad.saleem792, ap, bdakin, bfulgham, rniwa, simon.fraser, xcgxp397 |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac (Intel) | ||
| OS: | OS X 10.8 | ||
Charles d'Harcourt
STEPS TO REPRODUCE:
1. Set up a system with two displays of different heights, with the top of the displays _not_ lined up. The numbers below correspond to a 30" display connected to and placed to the left of a MacBook Pro 15", with the bottoms of the displays lined up and the 15" display set as the primary one (the one with the menu bar). The numbers would be different for different types of display and different operating system, but any setup with unaligned display tops should experience the problem.
2. Make sure the display arrangement is know to the operating system (System Preferences->Display->Arrangement on OS X).
3. Open a window in the primary display and bring up the JavaScript console for that window.
4. In that JavaScript console, enter "screen" and note the values of the object logged. You should get values like the following, with the unexpected values marked with arrows:
screen1.width: 1680
screen1.height: 1050
screen1.availWidth: 1676 <<<<<< A: Expected 1680
screen1.availHeight: 1028
screen1.availLeft: 0
screen1.availTop: 22
5. Open up another window in the other display and bring up the JavaScript console for it.
6. In that JavaScript console, enter "screen" and note the values of the object logged. You should get values like:
screen2.width: 2560
screen2.height: 1600
screen2.availWidth: 2560
screen2.availHeight: 1600
screen2.availLeft: -2560
screen2.availTop: 0 <<<< B: Expected -550
EXPECTED AND ACTUAL BEHAVIOR:
A: Expected 1680 because the whole width of the window should be available. The actual value is 4 pixels less.
B: Expected -550 because that is the Y coordinate of the top pixels of that screen relative to the Y coordinate of the top of the primary screen.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Charles d'Harcourt
Reported at Chromium as: https://code.google.com/p/chromium/issues/detail?id=148553
Ahmad Saleem
These two are not in spec and not standardised:
https://github.com/w3c/csswg-drafts/issues/1090
It is still open issue. Just wanted to keep it updated.
rniwa@webkit.org - do you familiar with whether Window Placement API is going to replace this because Chrome bug seems to indicate that it might but it might also have similar limitation? Thanks!
Simon Fraser (smfr)
There are privacy/fingerprinting issues here. I would prefer that a web page was not able to deduce that you had multiple displays.