Implement setter for document.domain

This commit is contained in:
Alan Jeffrey 2017-02-10 17:24:44 -06:00
parent 1f61a549a3
commit 5348b63e38
68 changed files with 217 additions and 736 deletions

View file

@ -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,