-
Notifications
You must be signed in to change notification settings - Fork 67
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
All src changes should reload the portal #197
Comments
Yeah, I think you're probably right that we should do this, at least for cross-origin. The consistency win might justify doing it for the same-origin case, too. |
This is already the case in the spec. (And also already the case for iframes, I think, otherwise OOPIFs would be impossible?) So maybe this is more of a "test todo" than a "spec todo"? |
Why would OOPIFs be impossible if the parent document could initiate same-document navigations? As far as I know that is possible. |
Sorry, I was thinking that the child would synchronously see the result, but of course there's no way to do that... However, from what I can tell the HTML spec goes through the full navigate algorithm for any assignment to |
Nevermind, I was just being dumb. It's in https://html.spec.whatwg.org/#navigating-across-documents:scroll-to-fragid. OK, so I think portals are affected, since they go through the navigate algorithm in https://wicg.github.io/portals/#htmlportalelement-set-the-source-url-of-a-portal-element. |
Should changing |
Ping for opinions on whether src-changing should close the previous browsing context or not. I'm especially interested in hearing if that would be observable in any way... if it's not, I might just switch to that for simplicity. |
The main difference I can think of is whether the portal is activatable immediately following resetting the src. In any case, creating a new context also seems cleaner to me. As an aside, doing this consistently for same and cross origin would make it so that same document navigations for same origin cases (e.g. loading a template page, then populating it), would need to be done with a combination of postMessage and self-navigation, rather than navigation via portal.src. Consistency would certainly be nice, though I'm not sure how common either of these approaches are today with existing content to know whether this would be cumbersome. |
Hmm. So this kind of reduces to #227. That's tricky. |
I'm not sure I think fragment navigation is the natural way to do that anyway -- you're reasonably likely to want to |
This sounds like it relates to options for the question of knowing when to call activate, such as leaving the activation promise in a pending state until the new portal context is ready for activation. |
If changing the hash part of the URL does not cause a reload, then it creates a data channel between the page and the portal.
We should ensure that all src changes reload the portal.
The text was updated successfully, but these errors were encountered: