New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Window.open and related infrastructure #20678
Merged
+830
−528
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f408b79
implement window.open, create auxiliary browsing context
gterzian 21bf5a3
implement opener, disowning
gterzian e27ba16
share event-loops based on eTLD+1
gterzian a0082c5
iframe: use value of name attr to set nested bc name
gterzian fee5428
make auxiliary browsing-context script-closeable
gterzian 96f7546
rudimentary handling of tabs
gterzian e784f5a
Refactor embedder NewBrowser flow
gterzian File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
iframe: use value of name attr to set nested bc name
- Loading branch information
commit a0082c57c8bb9a1c62f03bffa3f636e0791ee7b3
| @@ -76,6 +76,7 @@ pub struct HTMLIFrameElement { | ||
| sandbox_allowance: Cell<Option<SandboxAllowance>>, | ||
| load_blocker: DomRefCell<Option<LoadBlocker>>, | ||
| visibility: Cell<bool>, | ||
| name: DomRefCell<DOMString>, | ||
| } | ||
|
|
||
| impl HTMLIFrameElement { | ||
| @@ -223,6 +224,16 @@ 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 { | ||
gterzian
Author
Member
|
||
| 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 | ||
| @@ -299,6 +310,7 @@ impl HTMLIFrameElement { | ||
| sandbox_allowance: Cell::new(None), | ||
| load_blocker: DomRefCell::new(None), | ||
| visibility: Cell::new(true), | ||
| name: DomRefCell::new(DOMString::new()) | ||
| } | ||
| } | ||
|
|
||
| @@ -471,6 +483,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { | ||
|
|
||
| // https://html.spec.whatwg.org/multipage/#dom-iframe-name | ||
| fn SetName(&self, name: DOMString) { | ||
| *self.name.borrow_mut() = name.clone(); | ||
| if let Some(window) = self.GetContentWindow() { | ||
| window.set_name(name) | ||
| } | ||
| @@ -481,7 +494,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { | ||
| if let Some(window) = self.GetContentWindow() { | ||
| window.get_name() | ||
| } else { | ||
| DOMString::new() | ||
| self.name.borrow().clone() | ||
| } | ||
| } | ||
| } | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Spec link? Why was that change needed? Please write more details in the commit message.