aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 3c37c97af4c..c44ed04b265 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -217,6 +217,16 @@ impl HTMLIFrameElement {
let window = window_from_node(self);
+ // https://html.spec.whatwg.org/multipage/#attr-iframe-name
+ // Note: the spec says to set the name 'when the nested browsing context is created'.
+ // The current implementation sets the name on the window,
+ // when the iframe attributes are first processed.
+ if mode == ProcessingMode::FirstTime {
+ if let Some(window) = self.GetContentWindow() {
+ window.set_name(self.name.borrow().clone())
+ }
+ }
+
// https://github.com/whatwg/html/issues/490
if mode == ProcessingMode::FirstTime &&
!self.upcast::<Element>().has_attribute(&local_name!("src"))
@@ -233,16 +243,6 @@ impl HTMLIFrameElement {
return;
}
- // https://html.spec.whatwg.org/multipage/#attr-iframe-name
- // Note: the spec says to set the name 'when the nested browsing context is created'.
- // The current implementation sets the name on the window,
- // when the iframe attributes are first processed.
- if mode == ProcessingMode::FirstTime {
- if let Some(window) = self.GetContentWindow() {
- window.set_name(self.name.borrow().clone())
- }
- }
-
let url = self.get_url();
// TODO: check ancestor browsing contexts for same URL