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

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

Issue 2939393002: Change ScrollIntoViewOptions::inlinePostion to inline (Closed)
Patch Set: Add a todo 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/cssom-view/scrollIntoView-smooth.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="/resources/testharness.js"></script> 2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script> 3 <script src="/resources/testharnessreport.js"></script>
4 <title>Check End Position of scrollIntoView of shadow elements</title> 4 <title>Check End Position of scrollIntoView of shadow elements</title>
5 <div id="container"> 5 <div id="container">
6 <div id="space1" style="height: 2000px; width: 2000px;background-color: yellow "> 6 <div id="space1" style="height: 2000px; width: 2000px;background-color: yellow ">
7 </div> 7 </div>
8 <div id="shadow"></div> 8 <div id="shadow"></div>
9 <div id="space2" style="height: 2000px; width: 2000px;background-color: blue"> 9 <div id="space2" style="height: 2000px; width: 2000px;background-color: blue">
10 </div> 10 </div>
11 </div> 11 </div>
12 <script> 12 <script>
13 add_completion_callback(() => document.getElementById("container").remove()); 13 add_completion_callback(() => document.getElementById("container").remove());
14 14
15 test(t => { 15 test(t => {
16 var shadow = document.getElementById("shadow"); 16 var shadow = document.getElementById("shadow");
17 var shadowRoot = shadow.createShadowRoot(); 17 var shadowRoot = shadow.createShadowRoot();
18 var shadowDiv = document.createElement("div"); 18 var shadowDiv = document.createElement("div");
19 shadowDiv.style.height = "200px"; 19 shadowDiv.style.height = "200px";
20 shadowDiv.style.width = "200px"; 20 shadowDiv.style.width = "200px";
21 shadowDiv.style.backgroundColor = "green"; 21 shadowDiv.style.backgroundColor = "green";
22 shadowRoot.appendChild(shadowDiv); 22 shadowRoot.appendChild(shadowDiv);
23 23
24 window.scrollTo(0, 0); 24 window.scrollTo(0, 0);
25 var expected_x = shadowDiv.offsetLeft; 25 var expected_x = shadowDiv.offsetLeft;
26 var expected_y = shadowDiv.offsetTop; 26 var expected_y = shadowDiv.offsetTop;
27 assert_not_equals(window.scrollX, expected_x); 27 assert_not_equals(window.scrollX, expected_x);
28 assert_not_equals(window.scrollY, expected_y); 28 assert_not_equals(window.scrollY, expected_y);
29 shadowDiv.scrollIntoView({block: "start", inlinePosition: "start"}); 29 shadowDiv.scrollIntoView({block: "start", inline: "start"});
30 assert_approx_equals(window.scrollX, expected_x, 1); 30 assert_approx_equals(window.scrollX, expected_x, 1);
31 assert_approx_equals(window.scrollY, expected_y, 1); 31 assert_approx_equals(window.scrollY, expected_y, 1);
32 }, "scrollIntoView should behave correctly if applies to shadow dom elements"); 32 }, "scrollIntoView should behave correctly if applies to shadow dom elements");
33 </script> 33 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/cssom-view/scrollIntoView-smooth.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698