Environment: on MacBook with Retina display with and without external monitor. If I am open with Javascript a new window with e.g. window.open("","queryLogFrame","height=700,width=1000,scrollbars=no,resizable,status"); The window height is about 30-50 pixel smaller than with Firefox or Chrome. This problem I notice the first time with 10.10 in conjunction with the Retina display. -- Josef
This causes failures in these tests: https://github.com/w3c/web-platform-tests/pull/5390 I think it would be good to have predictable behavior here, that "height" feature sets the viewport height like in other browsers.
Hmm, we do: FloatSize viewportSize = page->chrome().pageRect().size(); FloatRect windowRect = page->chrome().windowRect(); windowRect.setHeight(*features.height + (windowRect.height() - viewportSize.height())); So we *seem* to be doing the right thing. However, viewportSize and windowRect are identical :/
(In reply to Chris Dumez from comment #2) > Hmm, we do: > FloatSize viewportSize = page->chrome().pageRect().size(); > FloatRect windowRect = page->chrome().windowRect(); > windowRect.setHeight(*features.height + (windowRect.height() - > viewportSize.height())); > > So we *seem* to be doing the right thing. However, viewportSize and > windowRect are identical :/ From what I can see viewportSize is wrong and windowRect is right.
Tim says we should subtract the topContentInset because the view is the same height as the window since Yosemite.
Really I said "probably we should leave it up to the WebKits and ask them for window-size-for-given-view-size or something, instead of hoping that subtracting will give you what you want, but if you want to quickly work around the problem you could subtract topContentInset" :)
Test: http://w3c-test.org/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html
Page::setTopContentInset() gets called *after* we set the new Window size unfortunately.
(In reply to Chris Dumez from comment #7) > Page::setTopContentInset() gets called *after* we set the new Window size > unfortunately. Where is the size set? You might be able to reorder it, because TCI is sent in WebProcessCreationParameters, so it's not like we don't have it.
(In reply to Tim Horton from comment #8) > (In reply to Chris Dumez from comment #7) > > Page::setTopContentInset() gets called *after* we set the new Window size > > unfortunately. > > Where is the size set? You might be able to reorder it, because TCI is sent > in WebProcessCreationParameters, so it's not like we don't have it. WebPageCreationParameters, whatever.
(In reply to Tim Horton from comment #9) > (In reply to Tim Horton from comment #8) > > (In reply to Chris Dumez from comment #7) > > > Page::setTopContentInset() gets called *after* we set the new Window size > > > unfortunately. > > > > Where is the size set? You might be able to reorder it, because TCI is sent > > in WebProcessCreationParameters, so it's not like we don't have it. > > WebPageCreationParameters, whatever. The logic for setting the new window size is in: RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, const FrameLoadRequest& request, const WindowFeatures& features, bool& created) inside FrameLoader.cpp. We first call chrome().createWindow() to create the Window. Then we compute the height we want. Finally we call chrome().setWindowRect().
(In reply to Chris Dumez from comment #10) > (In reply to Tim Horton from comment #9) > > (In reply to Tim Horton from comment #8) > > > (In reply to Chris Dumez from comment #7) > > > > Page::setTopContentInset() gets called *after* we set the new Window size > > > > unfortunately. > > > > > > Where is the size set? You might be able to reorder it, because TCI is sent > > > in WebProcessCreationParameters, so it's not like we don't have it. > > > > WebPageCreationParameters, whatever. > > The logic for setting the new window size is in: > RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, const > FrameLoadRequest& request, const WindowFeatures& features, bool& created) > inside FrameLoader.cpp. > > We first call chrome().createWindow() to create the Window. > Then we compute the height we want. > Finally we call chrome().setWindowRect(). And to make things a bit more complicated, between the window creation and setting the window size, there is a call to chrome().setToolbarsVisible(), which I believe would impact the topContentInset.