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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe.html

Issue 1935043002: Avoid style recalc and layout when not necessary for client size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip layout for local frame roots only Created 4 years, 8 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: third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe.html b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..acca19817f523eaf9841bbb87bded5a472388d4f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style>
+ iframe { width: 100px; height: 100px; }
+ iframe.wider { width: 200px; }
+</style>
+<iframe id="frame" src="data:text/html,<!DOCTYPE html>iframe" onload="runTests()"></iframe>
+<script>
+ description("Style recalc/layout when reading clientWidth of documentElement in iframe.");
+
+ var jsTestIsAsync = true;
+
+ shouldBeDefined(window.internals);
+
+ var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnabled;
+ internals.settings.setOverlayScrollbarsEnabled(true);
+
+ function runTests() {
+ clientWidthBefore = frame.contentDocument.documentElement.clientWidth;
+ frame.className = "wider";
+ clientWidthAfter = frame.contentDocument.documentElement.clientWidth;
+
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0");
+ shouldBe("clientWidthBefore", "100");
+ shouldBe("clientWidthAfter", "200");
+
+ internals.settings.setOverlayScrollbarsEnabled(originalOverlayScrollbars);
+ finishJSTest();
+ }
+</script>

Powered by Google App Engine
This is Rietveld 408576698