aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-12-01 04:09:11 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-12-01 04:09:11 +0530
commit51c19fd733a863f2fae05e693795dbecce69f2ed (patch)
treee30b07aa51b6fee09a97a5dd87d6b9c3a12c36f9 /components/script/dom/document.rs
parent2a125b56135cdaa86b49783e8a52e9f1e9c7c126 (diff)
parentc23cbd4163ad3adbc983e4915b3656e0f37af623 (diff)
downloadservo-51c19fd733a863f2fae05e693795dbecce69f2ed.tar.gz
servo-51c19fd733a863f2fae05e693795dbecce69f2ed.zip
Auto merge of #8558 - jdm:crossoriginiframeload, r=glennw
Dispatch load events for cross origin iframes. Resolves #6672. Splitting it out from #6677. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8558) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs24
1 files changed, 10 insertions, 14 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 31f67f33801..92942012def 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -58,7 +58,7 @@ use dom::keyboardevent::KeyboardEvent;
use dom::location::Location;
use dom::messageevent::MessageEvent;
use dom::mouseevent::MouseEvent;
-use dom::node::{self, CloneChildrenFlag, Node, NodeDamage, window_from_node};
+use dom::node::{self, CloneChildrenFlag, Node, NodeDamage};
use dom::nodeiterator::NodeIterator;
use dom::nodelist::NodeList;
use dom::processinginstruction::ProcessingInstruction;
@@ -79,9 +79,9 @@ use layout_interface::{HitTestResponse, MouseOverResponse};
use layout_interface::{LayoutChan, Msg};
use layout_interface::{ReflowGoal, ReflowQueryType};
use msg::compositor_msg::ScriptToCompositorMsg;
-use msg::constellation_msg::AnimationState;
use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
+use msg::constellation_msg::{AnimationState, PipelineId};
use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyModifiers, KeyState, MozBrowserEvent, SubpageId};
use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::CookieSource::NonHTTP;
@@ -1333,6 +1333,14 @@ impl Document {
.find(|node| node.subpage_id() == Some(subpage_id))
}
+ /// Find an iframe element in the document.
+ pub fn find_iframe_by_pipeline(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> {
+ self.upcast::<Node>()
+ .traverse_preorder()
+ .filter_map(Root::downcast::<HTMLIFrameElement>)
+ .find(|node| node.pipeline() == Some(pipeline))
+ }
+
pub fn get_dom_loading(&self) -> u64 {
self.dom_loading.get()
}
@@ -2433,18 +2441,6 @@ impl DocumentProgressHandler {
event.set_trusted(true);
let _ = wintarget.dispatch_event_with_target(document.upcast(), &event);
- let browsing_context = window.browsing_context();
- let browsing_context = browsing_context.as_ref().unwrap();
-
- if let Some(frame_element) = browsing_context.frame_element() {
- let frame_window = window_from_node(frame_element);
- let event = Event::new(GlobalRef::Window(frame_window.r()),
- DOMString::from("load"),
- EventBubbles::DoesNotBubble,
- EventCancelable::NotCancelable);
- event.fire(frame_element.upcast());
- };
-
document.notify_constellation_load();
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadend