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

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: Address reviewer comments. Add PartialLayoutState and PartialLayoutDisabler Created 7 years, 4 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 | « no previous file | LayoutTests/fast/dom/partial-layout-block-expected.txt » ('j') | Source/core/dom/Document.cpp » ('J')
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..67d2f05690df0c915da5e39b13e8e24299c8c14d
--- /dev/null
+++ b/LayoutTests/fast/dom/partial-layout-block.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<html>
+<script src="../js/resources/js-test-pre.js"></script>
+<head>
+<style>
+html, body {
+ margin: 0;
+ padding: 0;
+}
+#measure {
+ margin: 10px;
+ padding: 10px;
+}
+#fixedsize {
+ width: 100px;
+ height: 100px;
+}
+</style>
+<script>
+ description('Test that partial layout works for offset{width, height, left, top} methods.');
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ if (window.internals)
+ window.internals.setUsesOverlayScrollbars(true);
+
+ function checkSize() {
+ 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;
+
+ shouldBe(measureWidth, "document.body.offsetWidth - 20");
+ shouldBe(measureHeight, "measure.offsetHeight");
+ shouldBe(measureTop, childOffsetTop - 10);
+ shouldBe(measureLeft, "measure.offsetLeft");
+ finishJSTest();
+ }
+</script>
+</head>
+<body onload="checkSize()">
+<div id="measure"><div id="fixedsize"></div></div>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/partial-layout-block-expected.txt » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698