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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/body-quirk-client-size.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, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/body-quirk-client-size-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!-- quirks mode -->
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 :root, body { width: 100%; height: 100%; margin: 0 }
5 #container.wide { width: 5000px; height: 10px; }
6 #container.tall { height: 5000px; width: 10px; }
7 </style>
8 <div id="container"></div>
9 <script>
10 description("Style recalc when reading clientWidth/clientHeight of body in q uirks mode.");
11
12 shouldBeDefined(window.internals);
13
14 function runClientSizeTest(testClass, expectWidthChange, expectHeightChange, expectedRecalcCount) {
15
16 var origWidth = document.body.clientWidth;
17 var origHeight = document.body.clientHeight;
18 internals.updateStyleAndReturnAffectedElementCount();
19
20 container.classList.add(testClass)
21
22 var afterWidth = document.body.clientWidth;
23 var afterHeight = document.body.clientHeight;
24
25 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", ""+expe ctedRecalcCount);
26
27 if (expectWidthChange)
28 shouldBeGreaterThan(""+origWidth, ""+afterWidth);
29 else
30 shouldBe(""+origWidth, ""+afterWidth);
31
32 if (expectHeightChange)
33 shouldBeGreaterThan(""+origHeight, ""+afterHeight);
34 else
35 shouldBe(""+origHeight, ""+afterHeight);
36
37 container.classList.remove(testClass)
38 }
39
40 var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnab led;
41
42 internals.settings.setOverlayScrollbarsEnabled(true);
43
44 runClientSizeTest("wide", false, false, 1);
45 runClientSizeTest("tall", false, false, 1);
46
47 internals.settings.setOverlayScrollbarsEnabled(false);
48
49 runClientSizeTest("wide", false, true, 0);
50 runClientSizeTest("tall", true, false, 0);
51
52 internals.settings.setOverlayScrollbarsEnabled(originalOverlayScrollbars);
53 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/body-quirk-client-size-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698