Auto merge of #20858 - tigercosmos:yy1, r=jdm

move test `dom-element-scroll.html` from mozilla to wpt

<!-- Please describe your changes on the following line: -->
The test `dom-element-scroll.html` was originally landed on #19127.
It was designed for testing `scrollLeft` and `scrollTop`.
It is not only for servo. I thought I put a wrong place at that time. It should not be under `mozilla`. It's better placed under `wpt`.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20858)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-05-25 08:21:14 -04:00 committed by GitHub
commit ab39f6dbc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View file

@ -31791,12 +31791,6 @@
{}
]
],
"css/cssom-view/dom-element-scroll.html": [
[
"/_mozilla/css/cssom-view/dom-element-scroll.html",
{}
]
],
"css/empty-keyframes.html": [
[
"/_mozilla/css/empty-keyframes.html",
@ -61182,10 +61176,6 @@
"16a4dd68da41156fbdd139b4a56547f94ad4dbe7",
"support"
],
"css/cssom-view/dom-element-scroll.html": [
"247b85d5988878a7b27bc9f0f7b817085725c038",
"testharness"
],
"css/data_img_a.html": [
"323bf50369f98ed02acccdd3a5824e38d3f353bf",
"reftest"

View file

@ -1,99 +0,0 @@
<!doctype html>
<meta charset="utf-8">
<title>dom-element-scroll tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#section1 {
width: 300px;
height: 500px;
top: 16px;
left: 16px;
border: inset gray 3px;
background: white;
}
#scrollable {
width: 400px;
height: 700px;
background: linear-gradient(135deg, red, blue);
}
#section2 {
width: 300px;
height: 500px;
top: 16px;
left: 16px;
border: inset gray 3px;
background: white;
}
#unscrollable {
width: 200px;
height: 300px;
background: linear-gradient(135deg, red, blue);
}
</style>
<section id="section1">
<div id="scrollable"></div>
</section>
<section id="section2">
<div id="unscrollable"></div>
</section>
<script>
var section1 = document.getElementById("section1");
var section2 = document.getElementById("section2");
test(function () {
// let it be "hidden" to have scrolling box
section1.style.overflow = "hidden";
section1.scroll(50, 60);
assert_equals(section1.scrollLeft, 50, "changed scrollLeft should be 50");
assert_equals(section1.scrollTop, 60, "changed scrollTop should be 60");
section1.scroll(0, 0); // back to the origin
}, "Element test for having scrolling box");
test(function () {
section1.scroll(10, 20);
assert_equals(section1.scrollLeft, 10, "changed scrollLeft should be 10");
assert_equals(section1.scrollTop, 20, "changed scrollTop should be 20");
section1.scroll(0, 0); // back to the origin
}, "Element test for having overflow");
test(function () {
// make it not "hidden" to not have scrolling box
section1.style.overflow = "visible";
section1.scroll(50, 0);
assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
section1.scroll(0, 60);
assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
section1.scroll(50, 60);
assert_equals(section1.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section1.scrollTop, 0, "changed scrollTop should be 0");
section1.scroll(0, 0); // back to the origin
}, "Element test for not having scrolling box");
test(function () {
section2.scroll(0, 20);
assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
section2.scroll(10, 0);
assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
section2.scroll(10, 20);
assert_equals(section2.scrollLeft, 0, "changed scrollLeft should be 0");
assert_equals(section2.scrollTop, 0, "changed scrollTop should be 0");
}, "Element test for not having overflow");
</script>