Bug 265115
Summary: | Align 'moveTo' and 'moveBy' with Web-Specification (CSSOM View Extension to 'Window' Interface' | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | annevk, karlcow, koivisto, ntim, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While looking into 'browser specific failures' on WPT, I noticed that we fail few test cases 'cssom-view\idlharness.html' around 'moveTo' and 'moveBy' (there are few more but it is better to tackle one by one - easier to revert in case of any issue):
WPT Test Case: https://wpt.fyi/results/css/cssom-view/idlharness.html?label=master&label=experimental&aligned&q=safari:fail
Web-Specification: https://www.w3.org/TR/cssom-view-1/#extensions-to-the-window-interface
By doing changes in 'LocalDOMWindow' and 'Source/WebCore/page/LocalDOMWindow+CSSOMView.idl', I was able to progress few of them but I am not sure whether it is intentional to hold-off so I just wanted to raise bug.
>> Source/WebCore/page/LocalDOMWindow+CSSOMView.idl:
From:
undefined moveTo(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: Parameters should be mandatory and of type long.
undefined moveBy(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: Parameters should be mandatory and of type long.
To:
undefined moveTo(long x, long y);
undefined moveBy(long x, long y);
>> Source/WebCore/page/LocalDOMWindow.cpp (To):
void LocalDOMWindow::moveBy(int x, int y) const
{
if (!allowedToChangeWindowGeometry())
return;
CheckedPtr page = frame()->page();
auto fr = page->chrome().windowRect();
auto update = fr;
update.move(x, y);
page->chrome().setWindowRect(adjustWindowRect(*page, update));
}
void LocalDOMWindow::moveTo(int x, int y) const
{
if (!allowedToChangeWindowGeometry())
return;
CheckedPtr page = frame()->page();
auto fr = page->chrome().windowRect();
RefPtr localMainFrame = dynamicDowncast<LocalFrame>(page->mainFrame());
if (!localMainFrame)
return;
auto sr = screenAvailableRect(localMainFrame->view());
fr.setLocation(sr.location());
auto update = fr;
update.move(x, y);
page->chrome().setWindowRect(adjustWindowRect(*page, update));
}
>> Source/WebCore/page/LocalDOMWindow.h (To):
void moveBy(int x, int y) const;
void moveTo(int x, int y) const;
___
Just wanted to raise so I can get insight / plan. Adding 'BrowserCompat' tag since only WebKit / Safari is failing them and 'WPTImpact' because it has impact on WPT.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
PR - https://github.com/WebKit/WebKit/pull/20750
All EWS green - just added 'merge-queue'.
EWS
Committed 270997@main (ec1d30359a7e): <https://commits.webkit.org/270997@main>
Reviewed commits have been landed. Closing PR #20750 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/118668830>