Skip to content

Commit 3588ed9

Browse files
dtapuskachromium-wpt-export-bot
authored andcommitted
Fullscreen elements that were root level elements weren't sized properly.
Avoid setting position absolute on top layer elements that are the documentElement. This matches what Firefox does. The root element is special when it is in fullscreen mode because it does not get the style applied that forces its dimensions and position to be fixed. BUG=876339 Change-Id: I42b18047dc9648585bc279510d66decd6d6a4516 Reviewed-on: https://chromium-review.googlesource.com/1186961 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#585830}
1 parent d0960dc commit 3588ed9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<style>
3+
html, body {
4+
margin: 0px;
5+
}
6+
</style>
7+
<title>fullscreen root block sizing</title>
8+
<!-- This page intentionally has no content. It needs to have
9+
no width or height. This is to ensure that the root element
10+
gets sizing in fullscreen mode as it does in as it does not
11+
in fullscreen mode.
12+
-->
13+
<script src="/resources/testharness.js"></script>
14+
<script src="/resources/testharnessreport.js"></script>
15+
<script src="/resources/testdriver.js"></script>
16+
<script src="/resources/testdriver-vendor.js"></script>
17+
<script>
18+
async_test(t => {
19+
document.onfullscreenchange = t.step_func_done(() => {
20+
assert_equals(document.fullscreenElement, document.documentElement);
21+
assert_true(document.documentElement.getBoundingClientRect().width > 0);
22+
});
23+
document.documentElement.addEventListener('click', e => {
24+
document.documentElement.requestFullscreen();
25+
}, {once: true});
26+
test_driver.click(document.documentElement);
27+
});
28+
</script>

0 commit comments

Comments
 (0)