Bug 250800
Summary: | Fix moveTo to not use screenAvailableRect as an origin but as a boundary | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | DOM | Assignee: | Ahmad Saleem <ahmad.saleem792> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | bfulgham, rniwa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=21413 |
Ahmad Saleem
Hi Team,
While going through Blink's commit, I came across another failing tests (where all browsers are failing few tests but Safari is failing more than others):
Test Case - https://jsfiddle.net/84rogcy7/show
^ Safari 16.2 & STP 161 are failing:
Testing - xxx with 0 arguments & Testing - xxx with with 1 argument where it suppose to throw exception, it is throwing undefined. While Chrome Canary 111 and Firefox Nightly 111 passes these.
All browsers are failing two arguments tests.
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/f7557ab98c0e2bb380f9bfc6355666434c6e481f
WebKit Source - https://searchfox.org/wubkat/source/Source/WebCore/page/DOMWindow.cpp#1813
Just wanted to raise to get input and whether it is good to fix at least 0 and 1 argument cases to match other browsers.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/104670843>
Ahmad Saleem
This compiles:
void LocalDOMWindow::moveTo(int x, int y) const
{
if (!allowedToChangeWindowGeometry())
return;
CheckedPtr page = frame()->page();
auto update = page->chrome().windowRect();
RefPtr localMainFrame = dynamicDowncast<LocalFrame>(page->mainFrame());
if (!localMainFrame)
return;
update.setLocation(LayoutPoint(x, y));
page->chrome().setWindowRect(adjustWindowRect(*page, update));
}
Ahmad Saleem
(In reply to Ahmad Saleem from comment #2)
> This compiles:
>
> void LocalDOMWindow::moveTo(int x, int y) const
> {
> if (!allowedToChangeWindowGeometry())
> return;
> CheckedPtr page = frame()->page();
> auto update = page->chrome().windowRect();
> RefPtr localMainFrame = dynamicDowncast<LocalFrame>(page->mainFrame());
> if (!localMainFrame)
> return;
> update.setLocation(LayoutPoint(x, y));
> page->chrome().setWindowRect(adjustWindowRect(*page, update));
> }
This is updated:
void LocalDOMWindow::moveTo(int x, int y) const
{
if (!allowedToChangeWindowGeometry())
return;
RefPtr page = frame()->page();
auto update = page->chrome().windowRect();
RefPtr localMainFrame = dynamicDowncast<LocalFrame>(page->mainFrame());
if (!localMainFrame)
return;
update.setLocation(LayoutPoint(x, y));
page->chrome().setWindowRect(adjustWindowRect(*page, update));
}
Ahmad Saleem
Pull request: https://github.com/WebKit/WebKit/pull/35210
EWS
Committed 285205@main (ee0481b506b2): <https://commits.webkit.org/285205@main>
Reviewed commits have been landed. Closing PR #35210 and removing active labels.