aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2017-02-10 17:24:44 -0600
committerAlan Jeffrey <ajeffrey@mozilla.com>2017-03-15 10:34:23 -0500
commit5348b63e3833f3251bb5ef110a3f14dd581b60c9 (patch)
tree497d97d611ee85a8ed35c4c9fdb7daa90453650c /components/script/dom/htmliframeelement.rs
parent1f61a549a35ae317479f914c454fbee3580869d6 (diff)
downloadservo-5348b63e3833f3251bb5ef110a3f14dd581b60c9.tar.gz
servo-5348b63e3833f3251bb5ef110a3f14dd581b60c9.zip
Implement setter for document.domain
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 5e9891bdcc4..599f2f69c36 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -498,11 +498,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://html.spec.whatwg.org/multipage/#dom-iframe-contentwindow
fn GetContentWindow(&self) -> Option<Root<BrowsingContext>> {
- if self.pipeline_id.get().is_some() {
- ScriptThread::find_browsing_context(self.frame_id)
- } else {
- None
- }
+ self.pipeline_id.get().and_then(|_| ScriptThread::find_browsing_context(self.frame_id))
}
// https://html.spec.whatwg.org/multipage/#dom-iframe-contentdocument
@@ -514,6 +510,8 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
Some(pipeline_id) => pipeline_id,
};
// Step 2-3.
+ // Note that this lookup will fail if the document is dissimilar-origin,
+ // so we should return None in that case.
let document = match ScriptThread::find_document(pipeline_id) {
None => return None,
Some(document) => document,