Repository navigation
Description
Current behavior:
Currently, Iframe.SetName only "sets the name" if the iframe has a browsing context/window proxy:
| if let Some(window) = self.GetContentWindow() { |
So when the "name" attribute is mutated before the iframe is inserted in the document, this has no effect:
| &local_name!("name") => { |
Tests:
Some tests assume the attribute can be mutated "with effect" before the iframe has been inserted in the document:
servo/tests/wpt/web-platform-tests/html/browsers/windows/noreferrer-window-name.html
Line 43 in bf66767
| ifr.name = "sufficientlyrandomwindownameamiright2"; |
There might be other tests testing this more specifically, or such a test could be written otherwise.
Desired behavior:
Per the spec "When the browsing context is created, if the attribute is present, the browsing context name must be set to the value of this attribute;", and after that "Whenever the name attribute is set, the nested browsing context's name must be changed to the new value. If the attribute is removed, the browsing context name must be set to the empty string." https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-name
"When an iframe element is inserted into a document that has a browsing context, the user agent must create a new browsing context, set the element's nested browsing context to the newly-created browsing context, and then process the iframe attributes for the "first time". https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element
Currently, "process_the_iframe_attributes" doesn't involve any previously set name, so it should be updated to set the name of the newly created browsing context to be the "name" attribute of the iframe:
| fn process_the_iframe_attributes(&self, mode: ProcessingMode) { |
Activity
[-]Allow setting name of Iframe with no WindowProxy[/-][+]Improve Spec compliance of Iframe "name" attribute[/+][-]Improve Spec compliance of Iframe "name" attribute[/-][+]Improve Spec compliance of the iframe "name" attribute[/+]Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=<try>
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=nox,jdm
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=jdm
Auto merge of #20678 - gterzian:improve_follow_hyperlinks, r=jdm