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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/cssom-view/scrollIntoView-shadow.html

Issue 2936283003: Update CSSOM SmoothScroll Web Platform Test (Closed)
Patch Set: Update the tests and idl Created 3 years, 6 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <title>Check End Position of scrollIntoView of shadow elements</title>
5 <div id="container">
6 <div id="space1" style="height: 2000px; width: 2000px;background-color: yellow ">
7 </div>
8 <div id="shadow"></div>
9 <div id="space2" style="height: 2000px; width: 2000px;background-color: blue">
10 </div>
11 </div>
12 <script>
13 add_completion_callback(() => document.getElementById("container").remove());
14
15 test(t => {
16 var shadow = document.getElementById("shadow");
17 var shadowRoot = shadow.createShadowRoot();
18 var shadowDiv = document.createElement("div");
19 shadowDiv.style.height = "200px";
20 shadowDiv.style.width = "200px";
21 shadowDiv.style.backgroundColor = "green";
22 shadowRoot.appendChild(shadowDiv);
23
24 window.scrollTo(0, 0);
25 var expected_x = shadowDiv.offsetLeft;
26 var expected_y = shadowDiv.offsetTop;
27 assert_not_equals(window.scrollX, expected_x);
28 assert_not_equals(window.scrollY, expected_y);
29 shadowDiv.scrollIntoView({block: "start", inlinePosition: "start"});
30 assert_approx_equals(window.scrollX, expected_x, 1);
31 assert_approx_equals(window.scrollY, expected_y, 1);
32 }, "scrollIntoView should behave correctly if applies to shadow dom elements");
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698