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

Unified Diff: LayoutTests/fast/dom/partial-layout-block.html

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: define RenderObject::frameView in the header Created 7 years, 3 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
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/fast/dom/partial-layout-block-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/partial-layout-block.html
diff --git a/LayoutTests/fast/dom/partial-layout-block.html b/LayoutTests/fast/dom/partial-layout-block.html
new file mode 100644
index 0000000000000000000000000000000000000000..df8d31d3efeb7bbc5bb20b7e948ba7bc34a03129
--- /dev/null
+++ b/LayoutTests/fast/dom/partial-layout-block.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<link rel="stylesheet" href="../../resources/testharness.css">
+<head>
+<style>
+html, body {
+ margin: 0;
+ padding: 0;
+}
+
+#measure {
+ margin: 10px;
+ padding: 10px;
+}
+
+#fixedsize {
+ width: 100px;
+ height: 100px;
+}
+</style>
+</head>
+<body>
+<div id="measure"><div id="fixedsize"></div></div>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (window.internals)
+ window.internals.setUsesOverlayScrollbars(true);
+
+ test(function() {
+ var measure = document.getElementById('measure');
+
+ // Record partial layout values for offset*.
+ var measureWidth = measure.offsetWidth;
+ var measureHeight = measure.offsetHeight;
+ var measureTop = measure.offsetTop;
+ var measureLeft = measure.offsetLeft;
+
+ // Invalidate measure and force a full layout.
+ var child = measure.firstChild;
+ measure.removeChild(child);
+ document.body.clientHeight;
+ measure.appendChild(child);
+ var forceLayout = document.body.clientHeight;
+
+ var childOffsetTop = child.offsetTop;
+
+ assert_equals(measureWidth, document.body.offsetWidth - 20);
+ assert_equals(measureHeight, measure.offsetHeight);
+ assert_equals(measureTop, childOffsetTop - 10);
+ assert_equals(measureLeft, measure.offsetLeft);
+ }, 'Test that partial layout works for offset{width, height, left, top} methods.');
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/NeverFixTests ('k') | LayoutTests/fast/dom/partial-layout-block-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698