Summary: | DOMWindow.cpp DOMWindow::moveTo offsets moves by 22 (menu bar height) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Simenel <esimenel> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, esimenel, rniwa, yevseytsev |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=250800 |
Description
Eric Simenel
2008-10-06 15:09:08 PDT
Tried to reproduce a bug in Safari and Firefox using the code provided, but windows are not moving at all. As well Firefox is no longer uses WebKit, so I am not sure it is a bug nowadays. Please ignore the second part of my previous comment, Firefox uses WebKit only on iOS in webkit/Source/WebCore/page/DOMWindow.cpp file there is a code that prevents window geometry to be changed void DOMWindow::moveTo(float x, float y) const { if (!allowedToChangeWindowGeometry()) return; Page* page = m_frame->page(); FloatRect fr = page->chrome().windowRect(); FloatRect sr = screenAvailableRect(page->mainFrame().view()); fr.setLocation(sr.location()); FloatRect update = fr; update.move(x, y); page->chrome().setWindowRect(adjustWindowRect(*page, update)); } I am not able to reproduce anything from the test case in Comment 0 and all browsers (Safari 15.6, Safari Technology Preview 151, Chrome Canary 106, Firefox Nightly 105) ignore the "Move Me" input and also don't show anything in console. Link - https://jsfiddle.net/3gowr4c5/ The referencee code in Comment 03, is still present in slightly changed / refactor format: https://github.com/WebKit/WebKit/blob/64f843f962fd4b62b95fb3c3c53127b6f526fbcd/Source/WebCore/page/DOMWindow.cpp#L1758 rniwa@webkit.org - Is something still needed? Thanks! As documented in <https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo>, Firefox only performs a moveTo if the window was created by window.open(). Looking at allowedToChangeWindowGeometry(), WebKit appears to have a different policy, it blocks moveTo if invoked from a mouse event handler. It also needs to be the main frame, not a subframe. The test needs to be adjusted accordingly to verify if this is still an issue. |