Reviewed by Maciej.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2006 07:48:22 +0000 (07:48 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2006 07:48:22 +0000 (07:48 +0000)
commit4f4d0dc6c1fa0740d215aa3abab612d2283dcb40
tree10f945530b1d35847a1d520496b87356cff07c1a
parent6549dc2b6c26b497e421095687a2c26100d16c1f
    Reviewed by Maciej.

        - Fixed <rdar://problem/4559720> window sizing: make javascript window
        and screen sizing methods and properties work @ HIDPI

        The general approach here is to change some ints to floats, make
        a few key functions that scale between WebView and window/screen
        coordinates, and change other functions that work with screen
        coordinates to use the scaling functions for their underlying
        implementations.

        * manual-tests/window-open-features.html: Removed.
        * manual-tests/window-sizing.html: Added. More test coverage.

        * bindings/js/kjs_window.cpp: Changed ints to floats and IntRects to
        FloatRects, because window coordinates can be fractional when scaled
        to WebView/DOM coordinates.
        (KJS::floatFeature):
        (KJS::showModalDialog):
        (KJS::Window::getValueProperty):
        (KJS::constrainToVisible):
        (KJS::WindowFunc::callAsFunction):
        * bridge/BrowserExtension.h:
        * bridge/mac/BrowserExtensionMac.mm:
        (WebCore::BrowserExtensionMac::createNewWindow): Removed custom scaling
        code and replaced with calls to Page::windowRect and
        Page::setWindowRect. Renamed 'page' and 'bridge' to 'pageBridge' and
        'frameBridge,' respectively.
        * bridge/mac/PageMac.mm:
        (WebCore::Page::windowRect): Changed to use scaling
        (WebCore::Page::setWindowRect): ditto
        * bridge/mac/WebCoreFrameBridge.mm:
        (globalPoint):
        * page/Page.h:
        * platform/IntRect.h:
        * platform/Screen.h:
        * platform/mac/MouseEventMac.mm:
        (WebCore::globalPositionForEvent): Changed to use flipScreenPoint
        * platform/mac/ScreenMac.mm:
        (WebCore::flipScreenRect): New key function
        (WebCore::flipScreenPoint): New key function
        (WebCore::scaleScreenRectToView): New key function
        (WebCore::scaleViewRectToScreen): New key function
        (WebCore::screenRect): Changed to use scaling
        (WebCore::usableScreenRect): ditto

        Feeble attempt to preserve Windows build:

        * platform/win/ScreenWin.cpp:
        (WebCore::scaleScreenRectToWidget): stub -- doesn't actually scale
        (WebCore::scaleWidgetRectToScreen): ditto
        * bridge/win/PageWin.cpp:
        (WebCore::Page::Page):
        (WebCore::Page::widget):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
WebCore/ChangeLog
WebCore/bindings/js/kjs_window.cpp
WebCore/bridge/BrowserExtension.h
WebCore/bridge/mac/BrowserExtensionMac.mm
WebCore/bridge/mac/PageMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/bridge/win/PageWin.cpp
WebCore/manual-tests/window-open-features.html [deleted file]
WebCore/manual-tests/window-sizing.html [new file with mode: 0644]
WebCore/page/Page.cpp
WebCore/page/Page.h
WebCore/platform/IntRect.h
WebCore/platform/Screen.h
WebCore/platform/mac/MouseEventMac.mm
WebCore/platform/mac/ScreenMac.mm
WebCore/platform/mac/WheelEventMac.mm
WebCore/platform/win/ScreenWin.cpp