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: http://svn.webkit.org/repository/webkit/trunk@105512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
9 files changed