zhouivy / torora

Automatically exported from code.google.com/p/torora
0 stars 0 forks source link

window.inner[height|width) and window.outer[height|width] #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
our tactic of resizing the window to multiples of 50 is not working well. need 
a new plan, or need to ensure values are always rounded.

Original issue reported on code.google.com by rob...@roberthogan.net on 23 Sep 2010 at 10:24

GoogleCodeExporter commented 9 years ago
Here's the relevant code in WebKit (DomWindow.cpp):

int DOMWindow::outerHeight() const
{
    if (!m_frame)
        return 0;

    Page* page = m_frame->page();
    if (!page)
        return 0;

    return static_cast<int>(page->chrome()->windowRect().height());
}

int DOMWindow::outerWidth() const
{
    if (!m_frame)
        return 0;

    Page* page = m_frame->page();
    if (!page)
        return 0;

    return static_cast<int>(page->chrome()->windowRect().width());
}

int DOMWindow::innerHeight() const
{
    if (!m_frame)
        return 0;

    FrameView* view = m_frame->view();
    if (!view)
        return 0;

    return static_cast<int>(view->height() / m_frame->pageZoomFactor());
}

int DOMWindow::innerWidth() const
{
    if (!m_frame)
        return 0;

    FrameView* view = m_frame->view();
    if (!view)
        return 0;

    return static_cast<int>(view->width() / m_frame->pageZoomFactor());
}

Original comment by rob...@roberthogan.net on 23 Sep 2010 at 10:34

GoogleCodeExporter commented 9 years ago
so at the moment we are leaking the height of the space between the top of the 
frame view and the bottom of the window decoration.

Original comment by rob...@roberthogan.net on 23 Sep 2010 at 10:36