Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
gamespot.com shows a smaller video when entering full screen
https://bugs.webkit.org/show_bug.cgi?id=244256 <rdar://98754870> Reviewed by Eric Carlson. When Gamespot.com videos enter fullscreen, they have a rule with a max-width: property set on their fullscreen element, that prevents the element from being resized to occupy the entire screen. Adopt CSS from the current Fullscreen API specification for the fullscreen element, including an explicit and !important min, max, and explicit width and height. * LayoutTests/fullscreen/full-screen-min-max-width-height-expected.txt: Added. * LayoutTests/fullscreen/full-screen-min-max-width-height.html: Added. * LayoutTests/fullscreen/full-screen-test.js: (waitFor): * Source/WebCore/css/fullscreen.css: Canonical link: https://commits.webkit.org/253790@main
- Loading branch information
Showing
9 changed files
with
133 additions
and
19 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
17 changes: 17 additions & 0 deletions
17
LayoutTests/fullscreen/full-screen-min-max-width-height-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,17 @@ | ||
Testing with explicit width and height | ||
EVENT(webkitfullscreenchange) | ||
EXPECTED (target.clientWidth === document.documentElement.clientWidth == 'true') OK | ||
EXPECTED (target.clientHeight === document.documentElement.clientHeight == 'true') OK | ||
EVENT(webkitfullscreenchange) | ||
Testing with max-width and max-height | ||
EVENT(webkitfullscreenchange) | ||
EXPECTED (target.clientWidth === document.documentElement.clientWidth == 'true') OK | ||
EXPECTED (target.clientHeight === document.documentElement.clientHeight == 'true') OK | ||
EVENT(webkitfullscreenchange) | ||
Testing with min-width and min-height | ||
EVENT(webkitfullscreenchange) | ||
EXPECTED (target.clientWidth === document.documentElement.clientWidth == 'true') OK | ||
EXPECTED (target.clientHeight === document.documentElement.clientHeight == 'true') OK | ||
EVENT(webkitfullscreenchange) | ||
END OF TEST | ||
|
65 changes: 65 additions & 0 deletions
65
LayoutTests/fullscreen/full-screen-min-max-width-height.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,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<style> | ||
.explicit-width-height { | ||
height: 400px; | ||
width: 400px; | ||
} | ||
|
||
.max-width-height { | ||
max-height: 400px; | ||
max-width: 400px; | ||
} | ||
|
||
|
||
.min-width-height { | ||
min-height: 400px; | ||
min-width: 400px; | ||
} | ||
</style> | ||
</head> | ||
<script src="full-screen-test.js"></script> | ||
<script> | ||
window.addEventListener('load', async event => { | ||
target = document.getElementById('target'); | ||
|
||
consoleWrite('Testing with explicit width and height'); | ||
target.className = 'explicit-width-height'; | ||
runWithKeyDown(() => { target.webkitRequestFullscreen(); }) | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
testExpected('target.clientWidth === document.documentElement.clientWidth', true); | ||
testExpected('target.clientHeight === document.documentElement.clientHeight', true); | ||
|
||
runWithKeyDown(() => { document.webkitExitFullscreen(); }); | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
consoleWrite('Testing with max-width and max-height'); | ||
target.className = 'max-width-height'; | ||
runWithKeyDown(() => { target.webkitRequestFullscreen(); }) | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
testExpected('target.clientWidth === document.documentElement.clientWidth', true); | ||
testExpected('target.clientHeight === document.documentElement.clientHeight', true); | ||
|
||
runWithKeyDown(() => { document.webkitExitFullscreen(); }); | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
consoleWrite('Testing with min-width and min-height'); | ||
target.className = 'min-width-height'; | ||
runWithKeyDown(() => { target.webkitRequestFullscreen(); }) | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
testExpected('target.clientWidth === document.documentElement.clientWidth', true); | ||
testExpected('target.clientHeight === document.documentElement.clientHeight', true); | ||
|
||
runWithKeyDown(() => { document.webkitExitFullscreen(); }); | ||
await waitFor(document, 'webkitfullscreenchange'); | ||
|
||
endTest(); | ||
}); | ||
</script> | ||
<body> | ||
<div id="target"></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
12 changes: 6 additions & 6 deletions
12
LayoutTests/fullscreen/fullscreen-user-agent-style-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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('bottom') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('right') == 'auto') OK | ||
RUN(span.webkitRequestFullscreen()) | ||
EVENT(webkitfullscreenchange) | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == '100%') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == '100%') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('bottom') == '0px') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('right') == '0px') OK | ||
RUN(document.webkitExitFullscreen()) | ||
EVENT(webkitfullscreenchange) | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('width') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('height') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('bottom') == 'auto') OK | ||
EXPECTED (document.defaultView.getComputedStyle(span, null).getPropertyValue('right') == 'auto') OK | ||
END OF TEST | ||
|
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