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

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: 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 <script src="../../resources/js-test.js"></script>
esprehn 2016/05/02 19:02:12 Can you add a comment at the top like <!-- quirks
rune 2016/05/02 22:48:21 Done.
2 <style>
3 :root, body { width: 100%; height: 100%; margin: 0 }
4 #container.wide { width: 5000px; height: 10px; }
5 #container.tall { height: 5000px; width: 10px; }
6 </style>
7 <div id="container"></div>
8 <script>
9 description("Style recalc when reading clientWidth/clientHeight of body in q uirks mode.");
10
11 shouldBeDefined(window.internals);
12
13 function runClientSizeTest(testClass, expectWidthChange, expectHeightChange, expectedRecalcCount) {
14
15 var origWidth = document.body.clientWidth;
16 var origHeight = document.body.clientHeight;
17 internals.updateStyleAndReturnAffectedElementCount();
18
19 container.classList.add(testClass)
20
21 var afterWidth = document.body.clientWidth;
22 var afterHeight = document.body.clientHeight;
23
24 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", ""+expe ctedRecalcCount);
25
26 if (expectWidthChange)
27 shouldBeGreaterThan(""+origWidth, ""+afterWidth);
28 else
29 shouldBe(""+origWidth, ""+afterWidth);
30
31 if (expectHeightChange)
32 shouldBeGreaterThan(""+origHeight, ""+afterHeight);
33 else
34 shouldBe(""+origHeight, ""+afterHeight);
35
36 container.classList.remove(testClass)
37 }
38
39 var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnab led;
40
41 internals.settings.setOverlayScrollbarsEnabled(true);
42
43 runClientSizeTest("wide", false, false, 1);
44 runClientSizeTest("tall", false, false, 1);
45
46 internals.settings.setOverlayScrollbarsEnabled(false);
47
48 runClientSizeTest("wide", false, true, 0);
49 runClientSizeTest("tall", true, false, 0);
50
51 internals.settings.setOverlayScrollbarsEnabled(originalOverlayScrollbars);
52 </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