Skip to content

Commit 5ede4e4

Browse files
masayuki-nakanomoz-wptsync-bot
authored andcommitted
part 7: Change the type of width and height of PointerEvent to `double
The values may be used with the coords of `MouseEvent`. Therefore, they need to be `double` right now. Differential Revision: https://phabricator.services.mozilla.com/D222729 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1680669 gecko-commit: aad5ccb93e0b10bc7d8db967125f5ce6c9d9bbaf gecko-reviewers: smaug
1 parent 428f6a8 commit 5ede4e4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pointerevents/pointerevent_fractional_coordinates_untrusted.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,30 @@
162162
testFlooredMatch("-1.5 - -1.0", data.cls, event, smallerNegativeDict2);
163163
}
164164
}
165+
166+
const dictAlwaysDouble = {
167+
width: 0.111111111111,
168+
height: 0.222222222222,
169+
};
170+
171+
function testExactlyMatchAlwaysDouble(event, dict) {
172+
test(() => {
173+
assert_equals(event["width"], dict["width"]);
174+
}, `PointerEvent.${event.type}.width`);
175+
test(() => {
176+
assert_equals(event["height"], dict["height"]);
177+
}, `PointerEvent.${event.type}.height`);
178+
}
179+
180+
for (const type of ["pointerdown", "pointerup", "pointermove", "pointercancel",
181+
"gotpointercapture", "lostpointercapture",
182+
"pointerrawupdate",
183+
"pointerover", "pointerout", "pointerenter", "pointerleave",
184+
"foo"]) {
185+
const event = new PointerEvent(type, dictAlwaysDouble);
186+
testExactlyMatchAlwaysDouble(event, dictAlwaysDouble);
187+
}
188+
165189
</script>
166190
</head>
167191
<body></body>

0 commit comments

Comments
 (0)