-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colorDepth returns '0' on detached frame
https://bugs.webkit.org/show_bug.cgi?id=265021 Reviewed by Simon Fraser. The specification requires 24 as a fallback rather than 0: https://drafts.csswg.org/cssom-view/#dom-screen-colordepth Always returning 24 is tempting, but maybe not correct long term. This synchronizes web-platforms-tests for css/cssom-view with: web-platform-tests/wpt@4647677 * LayoutTests/http/tests/dom/same-origin-detached-window-properties-expected.txt: * LayoutTests/http/tests/dom/same-origin-detached-window-properties.html: * LayoutTests/imported/w3c/resources/resource-files.json: * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/screen-detached-frame-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/screen-detached-frame.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change.html: Added. * Source/WebCore/page/Screen.cpp: (WebCore::Screen::colorDepth const): Canonical link: https://commits.webkit.org/270952@main
- Loading branch information
Showing
10 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...utTests/imported/w3c/web-platform-tests/css/cssom-view/screen-detached-frame-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Window.screen on detached frame | ||
|
39 changes: 39 additions & 0 deletions
39
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/screen-detached-frame.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-screen"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1858977"> | ||
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> | ||
<link rel="author" href="https://mozilla.org" title="Mozilla"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<iframe></iframe> | ||
<script> | ||
onload = function() { | ||
test(() => { | ||
let frame = document.querySelector("iframe"); | ||
let win = frame.contentWindow; | ||
frame.remove(); | ||
assert_true(!!win.screen, "Window.screen should be available"); | ||
for (let prop of ["top", "left", "width", "height"]) { | ||
let availProp = "avail" + prop[0].toUpperCase() + prop.substr(1); | ||
if (prop == "width" || prop == "height") { | ||
assert_true(prop in win.screen, prop + "must be implemented per spec") | ||
assert_true(availProp in win.screen, availProp + "must be implemented per spec") | ||
} | ||
if (prop in win.screen) { | ||
assert_equals(win.screen[prop], 0, prop); | ||
} | ||
if (availProp in win.screen) { | ||
assert_equals(win.screen[availProp], 0, availProp); | ||
} | ||
} | ||
|
||
// https://drafts.csswg.org/cssom-view/#dom-screen-colordepth | ||
// If the user agent does not know the color depth or does not want to | ||
// return it for privacy considerations, it should return 24. | ||
for (let prop of ["colorDepth", "pixelDepth"]) { | ||
assert_equals(win.screen[prop], 24, prop); | ||
} | ||
}, "Window.screen on detached frame"); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<div style="width: 100px; height: 100px; background: green;"></div> | ||
</body> | ||
</html> | ||
|
10 changes: 10 additions & 0 deletions
10
...ts/imported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<div style="width: 100px; height: 100px; background: green;"></div> | ||
</body> | ||
</html> | ||
|
15 changes: 15 additions & 0 deletions
15
...tTests/imported/w3c/web-platform-tests/css/cssom-view/window-scrollBy-display-change.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Verify that scrolling the root does actually do a visual scroll</title> | ||
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/#dom-window-scrollby"> | ||
<link rel="match" href="window-scrollBy-display-change-ref.html"> | ||
</head> | ||
<body style="overflow: hidden" onload="window.scrollBy(0, 2000);"> | ||
<div style="height: 2000px"></div> | ||
<div style="width: 100px; height: 100px; background: green;"></div> | ||
<div style="height: 2000px"></div> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters