mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #9456 - g-k:global-resize-event, r=KiChjang
Add onresize handler to GlobalEventHandlers Rebased: https://github.com/servo/servo/pull/8006 Fixes #7996 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9456) <!-- Reviewable:end -->
This commit is contained in:
commit
ae67f94b80
7 changed files with 64 additions and 15 deletions
|
@ -33318,6 +33318,12 @@
|
|||
"deleted": [],
|
||||
"items": {
|
||||
"testharness": {
|
||||
"html/webappapis/scripting/events/event-handler-onresize.html": [
|
||||
{
|
||||
"path": "html/webappapis/scripting/events/event-handler-onresize.html",
|
||||
"url": "/html/webappapis/scripting/events/event-handler-onresize.html"
|
||||
}
|
||||
],
|
||||
"websockets/Create-asciiSep-protocol-string.htm": [
|
||||
{
|
||||
"path": "websockets/Create-asciiSep-protocol-string.htm",
|
||||
|
|
|
@ -186,9 +186,6 @@
|
|||
[Document interface: attribute onratechange]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: attribute onresize]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: attribute onscroll]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1725,9 +1722,6 @@
|
|||
[HTMLElement interface: attribute onratechange]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement interface: attribute onresize]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement interface: attribute onscroll]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1956,9 +1950,6 @@
|
|||
[HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type (79)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type (81)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type (82)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -8730,9 +8721,6 @@
|
|||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "onratechange" with the proper type (141)]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "onresize" with the proper type (143)]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "onscroll" with the proper type (144)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
[focus]
|
||||
expected: FAIL
|
||||
|
||||
[resize]
|
||||
expected: FAIL
|
||||
|
||||
[scroll]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<title>HTMLBodyElement.onresize</title>
|
||||
<link rel="author" title="His-Name-Is-Joof" href="mailto:jeffrharrison@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#handler-window-onresize">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test("body.onresize should set the window.onload handler")
|
||||
window.onresize = t.step_func(function() {
|
||||
assert_unreached("This handler should be overwritten.")
|
||||
})
|
||||
|
||||
var body = document.createElement("body")
|
||||
body.onresize = t.step_func(function(e) {
|
||||
assert_equals(e.currentTarget, window,
|
||||
"The event should be fired at the window.")
|
||||
t.done()
|
||||
})
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
|
||||
t = async_test("document.onresize should set the document.onresize handler");
|
||||
document.onresize = t.step_func(function(e) {
|
||||
assert_equals(e.currentTarget, document,
|
||||
"The event should be fired at the document")
|
||||
t.done()
|
||||
})
|
||||
document.dispatchEvent(new Event('resize'));
|
||||
|
||||
t = async_test("meta.onresize should set the meta.onresize handler");
|
||||
var meta = document.createElement("meta")
|
||||
meta.onresize = t.step_func(function(e) {
|
||||
assert_equals(e.currentTarget, meta,
|
||||
"The event should be fired at the <meta> object")
|
||||
t.done()
|
||||
})
|
||||
meta.dispatchEvent(new Event('resize'));
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue