mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Dispatch a load event at iframes. Fixes #4350.
This commit is contained in:
parent
d1c8ed4359
commit
980b1efb72
16 changed files with 34 additions and 51 deletions
|
@ -31,7 +31,7 @@ use dom::htmlelement::HTMLElementTypeId;
|
||||||
use dom::htmliframeelement::HTMLIFrameElement;
|
use dom::htmliframeelement::HTMLIFrameElement;
|
||||||
use dom::keyboardevent::KeyboardEvent;
|
use dom::keyboardevent::KeyboardEvent;
|
||||||
use dom::mouseevent::MouseEvent;
|
use dom::mouseevent::MouseEvent;
|
||||||
use dom::node::{self, Node, NodeHelpers, NodeDamage, NodeTypeId};
|
use dom::node::{self, Node, NodeHelpers, NodeDamage, NodeTypeId, window_from_node};
|
||||||
use dom::window::{Window, WindowHelpers, ScriptHelpers};
|
use dom::window::{Window, WindowHelpers, ScriptHelpers};
|
||||||
use dom::worker::{Worker, TrustedWorkerAddress};
|
use dom::worker::{Worker, TrustedWorkerAddress};
|
||||||
use parse::html::{HTMLInput, parse_html};
|
use parse::html::{HTMLInput, parse_html};
|
||||||
|
@ -1432,6 +1432,20 @@ impl DocumentProgressHandler {
|
||||||
let doctarget: JSRef<EventTarget> = EventTargetCast::from_ref(document.r());
|
let doctarget: JSRef<EventTarget> = EventTargetCast::from_ref(document.r());
|
||||||
event.r().set_trusted(true);
|
event.r().set_trusted(true);
|
||||||
let _ = wintarget.dispatch_event_with_target(doctarget, event.r());
|
let _ = wintarget.dispatch_event_with_target(doctarget, event.r());
|
||||||
|
|
||||||
|
let window_ref = window.r();
|
||||||
|
let browser_context = window_ref.browser_context();
|
||||||
|
let browser_context = browser_context.as_ref().unwrap();
|
||||||
|
|
||||||
|
browser_context.frame_element().map(|frame_element| {
|
||||||
|
let frame_element = frame_element.root();
|
||||||
|
let frame_window = window_from_node(frame_element.r()).root();
|
||||||
|
let event = Event::new(GlobalRef::Window(frame_window.r()), "load".to_owned(),
|
||||||
|
EventBubbles::DoesNotBubble,
|
||||||
|
EventCancelable::NotCancelable).root();
|
||||||
|
let target: JSRef<EventTarget> = EventTargetCast::from_ref(frame_element.r());
|
||||||
|
event.r().fire(target);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
[send-entity-body-document.htm]
|
[send-entity-body-document.htm]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[XMLHttpRequest: send() - Document]
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[Document-URL.sub.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
||||||
[Document.URL with redirect]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[Element-matches.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[Node-parentNode.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[ParentNode-querySelector-All.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,12 +1,11 @@
|
||||||
[load-text-plain.html]
|
[load-text-plain.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[Checking document metadata for text file]
|
[Checking document metadata for text file]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
[Checking DOM for text file]
|
[Checking DOM for text file]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
[Checking contents for text file]
|
[Checking contents for text file]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
[named-objects.html]
|
[named-objects.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Check if the first nested browsing context is returned by window[\'c\'\]]
|
||||||
|
expected: FAIL
|
||||||
|
[Check if window[\'a\'\] contains all a, applet, area, embed, form, img, and object elements, and their order]
|
||||||
|
expected: FAIL
|
||||||
|
[Check if window[\'fs\'\] return the frameset element with name=\'fs\']
|
||||||
|
expected: FAIL
|
||||||
|
[Check if window[\'b\'\] returns the elements with the id=\'b\']
|
||||||
|
expected: FAIL
|
||||||
|
[Check if window[\'d\'\] returns the element with id=\'d\']
|
||||||
|
expected: FAIL
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[base_multiple.html]
|
[base_multiple.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[The attributes of the a element must be affected by the first base element]
|
[The attributes of the a element must be affected by the first base element]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[move_iframe_in_dom_03.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,6 +0,0 @@
|
||||||
[001.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
||||||
[async XMLHttpRequest in dedicated worker]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[002.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
||||||
[sync XMLHttpRequest in dedicated worker]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[003.html]
|
[003.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[async XMLHttpRequest in shared worker]
|
[async XMLHttpRequest in shared worker]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[004.html]
|
[004.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[sync XMLHttpRequest in shared worker]
|
[sync XMLHttpRequest in shared worker]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[005.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
||||||
[base url, dedicated worker]
|
|
||||||
expected: NOTRUN
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[006.html]
|
[006.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
|
||||||
[base url, shared worker]
|
[base url, shared worker]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue