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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/containment/paint-containment-hittest.html

Issue 1490063002: Implement Paint Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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/css/containment/paint-containment-hittest-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 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <script>
4 var centerX;
5 var centerY;
6 function hitTestCenterOfElement(elementID, expectedID)
7 {
8 var element = document.getElementById(elementID);
9 var rect = element.getBoundingClientRect();
10 centerX = rect.left + (rect.width / 2);
11 centerY = rect.top + (rect.height / 2);
12 shouldBe("document.elementFromPoint(centerX, centerY).id", "'" + expectedID + "'");
13 }
14
15 function test() {
leviw_travelin_and_unemployed 2015/12/10 23:17:39 Chrishtr: Is this kinda what you were talking abou
chrishtr 2015/12/10 23:31:16 Yeah seem helpful. Please put them in LayoutTests/
16 hitTestCenterOfElement("containTransform", "containTransform");
17 hitTestCenterOfElement("containAbsolute", "containAbsolute");
18 hitTestCenterOfElement("containFixed", "containFixed");
19
20 hitTestCenterOfElement("transform", "body");
21 hitTestCenterOfElement("absolute", "body");
22 hitTestCenterOfElement("fixed", "body");
23 }
24 </script>
25 <style>
26 div {
27 width: 100px;
28 height: 100px;
29 background-color: green;
30 }
31 div > div {
32 background-color: red;
33 }
34 .paintContainment {
35 contain: paint;
36 margin: 10px;
37 }
38 #transform {
39 transform: translateZ(0) translateX(100px);
40 }
41 #absolute {
42 position: absolute;
43 top: 0px;
44 left: 100px;
45 }
46 #fixed {
47 position: fixed;
48 top: 0px;
49 left: 100px;
50 }
51 </style>
52 <body onload="test()" id="body">
53 <p>Hit testing should respect clips established by contain: paint.</p>
54 <div id="containTransform" class="paintContainment">
55 <div id="transform"></div>
56 </div>
57 <div id="containAbsolute" class="paintContainment">
58 <div id="absolute"></div>
59 </div>
60 <div id="containFixed" class="paintContainment">
61 <div id="fixed"></div>
62 </div>
63 <pre id="console"></pre>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/containment/paint-containment-hittest-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698