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

Unified Diff: LayoutTests/fast/frames/frame-dimensions-before-parent-layout.html

Issue 19272007: Update parent layout when child frame requests innerHeight/innerWidth. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only force layout in innerWidth/innerHeight Created 7 years, 5 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/fast/frames/frame-dimensions-before-parent-layout.html
diff --git a/LayoutTests/fast/frames/frame-dimensions-before-parent-layout.html b/LayoutTests/fast/frames/frame-dimensions-before-parent-layout.html
new file mode 100644
index 0000000000000000000000000000000000000000..c172e2c666eb6aa9a2b847b9e9fb5c63dbcc3bdb
--- /dev/null
+++ b/LayoutTests/fast/frames/frame-dimensions-before-parent-layout.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+description('Tests that querying dimensions in an iframe returns the correct value even before the parent frame has had a layout');
+
+var iframe = document.createElement('iframe');
+document.body.appendChild(iframe);
+
+var heightBeforeLayout = iframe.contentWindow.innerHeight;
+var forceLayout = iframe.offsetHeight;
+var heightAfterLayout = iframe.contentWindow.innerHeight;
+
+shouldBe('heightBeforeLayout', 'heightAfterLayout');
+
+var iframe2 = document.createElement('iframe');
+document.body.appendChild(iframe2);
+
+var widthBeforeLayout = iframe2.contentWindow.innerWidth;
+var forceLayout = iframe2.offsetHeight;
+var widthAfterLayout = iframe2.contentWindow.innerWidth;
+
+shouldBe('widthBeforeLayout', 'widthAfterLayout');
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698