-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e025d1
commit 78e9fb0
Showing
12 changed files
with
97 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
interface mixin InvokerElement { | ||
[CEReactions,Reflect=invoketarget] attribute Element? commandForElement; | ||
[CEReactions,Reflect=invokeaction] attribute DOMString command; | ||
interface mixin CommandElement { | ||
[CEReactions,Reflect=commandfor] attribute Element? commandForElement; | ||
[CEReactions,Reflect=command] attribute DOMString command; | ||
}; | ||
|
||
interface CommandEvent : Event { | ||
constructor(DOMString type, optional CommandEventInit eventInitDict = {}); | ||
readonly attribute Element? invoker; | ||
readonly attribute Element? source; | ||
readonly attribute DOMString command; | ||
}; | ||
|
||
dictionary CommandEventInit : EventInit { | ||
Element? invoker = null; | ||
Element? source = null; | ||
DOMString command = ""; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
test/fixtures/wpt/storage/quotachange-in-detached-iframe.tentative.https.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<meta name=viewport content="width=device-width,initial-scale=1"> | ||
<title>Test image button coordinates</title> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#image-button-state-(type=image)"> | ||
<link rel="help" href="https://xhr.spec.whatwg.org/#dom-formdata"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=282266"> | ||
<link rel="author" title="Zach Hoffman" href="mailto:[email protected]"> | ||
<form id="myForm" onsubmit="return false;"> | ||
<input id="myImage" name="myImage" type="image" src="/images/100px-green-rect.svg"> | ||
</form> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script> | ||
promise_test(async t => { | ||
await new Promise(r => window.addEventListener("load", r)); | ||
|
||
const xCoordinates = []; | ||
const yCoordinates = []; | ||
|
||
let formData; | ||
myForm.addEventListener("submit", t.step_func(e => { | ||
e.preventDefault(); | ||
formData = new FormData(myForm, myImage); | ||
xCoordinates.push(formData.get("myImage.x")); | ||
yCoordinates.push(formData.get("myImage.y")); | ||
})); | ||
|
||
await test_driver.click(myImage); | ||
|
||
const [clientX, clientY] = getInViewCenterPoint(myImage.getBoundingClientRect()); | ||
const mouseEvent = new MouseEvent("click", {clientX, clientY}); | ||
myImage.dispatchEvent(mouseEvent); | ||
|
||
assert_equals(xCoordinates.length, 2, "there should be 2 X coordinates"); | ||
assert_equals(yCoordinates.length, 2, "there should be 2 Y coordinates"); | ||
assert_equals(xCoordinates[1], xCoordinates[0], "dispatched event X coordinate should match user intention X coordinate"); | ||
assert_equals(yCoordinates[1], yCoordinates[0], "dispatched event Y coordinate should match user intention Y coordinate"); | ||
}, "dispatched event coordinates should match user intention coordinates") | ||
|
||
// Private function from testdriver.js. | ||
function getInViewCenterPoint(rect) { | ||
var left = Math.max(0, rect.left); | ||
var right = Math.min(window.innerWidth, rect.right); | ||
var top = Math.max(0, rect.top); | ||
var bottom = Math.min(window.innerHeight, rect.bottom); | ||
|
||
var x = 0.5 * (left + right); | ||
var y = 0.5 * (top + bottom); | ||
|
||
return [x, y]; | ||
} | ||
</script> |