Auto merge of #24409 - tigleym:mouse_event_cssom_attributes, r=jdm

Implements pageX and pageY attributes on MouseEvent interface

<!-- Please describe your changes on the following line: -->
Implements missing pageX and pageY on MouseEvent interface.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] These changes fix #24248 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/24409)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-10-17 16:16:15 -04:00 committed by GitHub
commit 01620676c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 15 deletions

View file

@ -613547,7 +613547,7 @@
"testharness"
],
"css/cssom-view/mouseEvent.html": [
"907a2b405e442ba09ae623327d6f7de5492d3a80",
"7e194b8909317806ff80e300cd480b31680a397e",
"testharness"
],
"css/cssom-view/negativeMargins.html": [

View file

@ -29,12 +29,6 @@
[Text interface: document.createTextNode("x") must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type]
expected: FAIL
[MouseEvent interface: attribute pageX]
expected: FAIL
[MouseEvent interface: attribute pageY]
expected: FAIL
[HTMLImageElement interface: document.createElement("img") must inherit property "x" with the proper type]
expected: FAIL
@ -316,10 +310,3 @@
[MouseEvent interface: new MouseEvent("foo") must inherit property "offsetX" with the proper type]
expected: FAIL
[MouseEvent interface: new MouseEvent("foo") must inherit property "pageY" with the proper type]
expected: FAIL
[MouseEvent interface: new MouseEvent("foo") must inherit property "pageX" with the proper type]
expected: FAIL

View file

@ -2,6 +2,9 @@
<meta charset=utf-8>
<head>
<title>CSSOM MouseEvent tests</title>
<div style="background:lightblue; height:10000px">
Hello
</div>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
@ -13,5 +16,18 @@ test(function () {
assert_equals(mouseEvent.x, 30);
assert_equals(mouseEvent.y, 40);
}, 'MouseEvent\'s x and y must be equal to clientX and clientY.');
test(function () {
var mouseEvent1 = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
assert_equals(mouseEvent1.pageX, 10);
assert_equals(mouseEvent1.pageY, 20);
scrollBy(0, 5000);
assert_equals(mouseEvent1.pageX, 10);
assert_equals(mouseEvent1.pageY, 5020);
var mouseEvent2 = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
assert_equals(mouseEvent2.pageX, 10);
assert_equals(mouseEvent2.pageY, 5020);
}, 'MouseEvent\'s pageX and pageY attributes should be the sum of the scroll offset and clientX/clientY');
</script>
</head>