window.innerWidth/Height should not include page scale
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 15:03:23 +0000 (15:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 15:03:23 +0000 (15:03 +0000)
commit319f78bc1af02f8ff74633d9bd94deb71b863f82
treed221f5db60f2ba087fb05d398ad7701b67a011d5
parente291bdf270e1474f8208c49f3decd5a11669b3bb
window.innerWidth/Height should not include page scale
https://bugs.webkit.org/show_bug.cgi?id=76555

Source/WebCore:

The DOM attributes window.innerWidth and window.innerHeight should be in
CSS pixels instead of device pixels. Currently the text zoom factor is
cancelled out when calculating these values, but the same also needs to
be done for the page scale.

There is an additional subtlety concerning frames/iframes since their
visible content rectangle is already in (unscaled) CSS pixels. By using
Frame::frameScaleFactor() we avoid unnecessarily cancelling out the page
scale factor in this case.

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-01-20
Reviewed by Kenneth Rohde Christiansen.

Tests: fast/dom/iframe-inner-size-scaling.html
       fast/dom/window-inner-size-scaling.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::innerHeight):
(WebCore::DOMWindow::innerWidth):

LayoutTests:

Add two tests for window.innerWidth and window.innerHeight interaction
with page scaling.

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-01-20
Reviewed by Kenneth Rohde Christiansen.

* fast/dom/iframe-inner-size-scaling-expected.txt: Added.
* fast/dom/iframe-inner-size-scaling.html: Added.
* fast/dom/window-inner-size-scaling-expected.txt: Added.
* fast/dom/window-inner-size-scaling.html: Added.
* fast/frames/frame-set-rotation-hit.html: Calculate the panel height before changing the page scale, because the visual viewport changes with the page scale.
* fast/frames/frame-set-scaling-hit.html: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/iframe-inner-size-scaling.html [new file with mode: 0644]
LayoutTests/fast/dom/window-inner-size-scaling-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/window-inner-size-scaling.html [new file with mode: 0644]
LayoutTests/fast/frames/frame-set-rotation-hit.html
LayoutTests/fast/frames/frame-set-scaling-hit.html
Source/WebCore/ChangeLog
Source/WebCore/page/DOMWindow.cpp