Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: LayoutTests/fullscreen/rendering/ua-style-iframe.html

Issue 974783002: Match the Fullscreen spec's CSS as far as currently practical (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fullscreen/rendering/ua-style-iframe.html
diff --git a/LayoutTests/fullscreen/rendering/ua-style-iframe.html b/LayoutTests/fullscreen/rendering/ua-style-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..5d291fa503cb4172500c6a8f0cf4cb5e8524b542
--- /dev/null
+++ b/LayoutTests/fullscreen/rendering/ua-style-iframe.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<title>Override user-agent level style sheet defaults for an iframe</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../trusted-event.js"></script>
+<style>
+iframe {
+ /* Override everything which is !important in the UA style sheet. */
+ position: relative !important;
+ top: auto !important;
+ right: auto !important;
+ bottom: auto !important;
+ left: auto !important;
+ margin: 10px !important;
+ box-sizing: content-box !important;
+ min-width: 50% !important;
+ max-width: 50% !important;
+ min-height: 50% !important;
+ max-height: 50% !important;
+ width: 50% !important;
+ height: 50% !important;
+ object-fit: none !important;
+ flex: 1 1 auto !important;
+ transform: translate(0, 0) !important;
+}
+</style>
+<div id="log"></div>
+<div>
+ <iframe></iframe>
+</div>
+<script>
+async_test(function()
+{
+ var iframe = document.querySelector("iframe");
+ // The HTML user-agent level style sheet defaults gives iframe a border.
+ // https://html.spec.whatwg.org/#embedded-content-rendering-rules
+ assert_equals(getComputedStyle(iframe).borderStyle, "inset");
+
+ document.addEventListener("fullscreenchange", this.step_func_done(function()
+ {
+ var style = getComputedStyle(iframe);
+ // All properties should match the UA style sheet.
+ assert_equals(style.position, "fixed");
+ assert_equals(style.top, "0px");
+ assert_equals(style.right, "0px");
+ assert_equals(style.bottom, "0px");
+ assert_equals(style.left, "0px");
+ assert_equals(style.margin, "0px");
+ assert_equals(style.boxSizing, "border-box");
+ assert_equals(style.minWidth, "0px");
+ assert_equals(style.maxWidth, "none");
+ assert_equals(style.minHeight, "0px");
+ assert_equals(style.maxHeight, "none");
+ assert_equals(style.width, window.innerWidth + "px");
+ assert_equals(style.height, window.innerHeight + "px");
Julien - ping for review 2015/03/04 17:50:22 You forgot to remove these 2 per your comment on p
philipj_slow 2015/03/05 04:05:06 I meant that I added back with width and height ov
+ assert_equals(style.objectFit, "contain");
+ assert_equals(style.flex, "0 0 auto"); // none computes to 0 0 auto
+ assert_equals(style.transform, "none");
+ // The Fullscreen user-agent level style sheet defaults remove the border.
+ assert_equals(style.borderStyle, "none");
+ }));
+
+ trusted_request(iframe);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698