-
Notifications
You must be signed in to change notification settings - Fork 522
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
Is "unit of related similar-origin browsing contexts" the right thing to use in the rootMargin / rootBounds restriction? #161
Comments
That phrase is standard spec-ese: Is there a better or more accurate way to say this? |
I think we were going for whether this frame is in the same origin as the top-level frame since if it is, then you have access to all the information in the top-level frame even if there's a cross-origin frame wedged between you. I think we could also define this as being in the same origin as the parent frame. I'm not really sure what's best here, but I'm hopeful we can still change Chrome's behavior here without breaking content if there's something we should be doing differently. |
If I remember correctly, the issue is whether there are any intervening frames between target and root that are from a different origin. In that case, we don't want to report root bounds. |
IIRC @bzbarsky had opinions on this. I don't have strong opinions on this. We should do whatever is most consistent with other things on the platform. No reason for IntersectionObserver to be a special snowflake. |
Given the replies, it sounds like we really just want same origin, right? I think that matches what Chromium actually implements already. However, if we want to be more strict and disallow intermediate frames that are cross-origin, then things might be more interesting from a compatibility standpoint. |
I'm not sure I have a strong opinion on this. As @ojanvafai points out, if you're same-origin with the top window you can already do window.top.whatever to get whatever you want out of it... So the real question is whether any information about those intervening frames is leaked. If it's not, then it doesn't matter what their origins are, seems to me. |
This whole concept is gone from the HTML spec now, but this is still used in IntersectionObserver. |
cc @annevk who did the |
The new concept would be similar-origin window agent, which is roughly what that old concept corresponds to, minus its flaws (docgroup in Firefox, iirc). This would potentially allow certain same-site-but-cross-origin leaks, similar to A strict same-origin check on the origins of the documents involved would be more desirable I think. (As well as tests.) @dtapuska if agent is chosen here that would mean that opting into a fresh agent would disable this API (if I'm understanding things correctly). We should add that to the list of things to test. |
@annevk I agree, but I'd really need to understand why the restriction of the root margin is in place. And if so whether this should actually be a permission that is delegated. ie; someone might choose to delegate the rootMarginIntersectionPermission as well as a fresh agent to get something that is compatible to what they'd have today. |
Given what @ojanvafai wrote the most sense would make a "same origin-domain" check, presumably. That is, if you have script access to each other bits can leak, otherwise they cannot. It would be good to get this fixed though because as written the security model is broken. |
… principal base domain. r=mstange This is similar effectively, and should be more correct and faster, as per: w3c/IntersectionObserver#161 (comment) Differential Revision: https://phabricator.services.mozilla.com/D101636
… principal base domain. r=mstange This is similar effectively, and should be more correct and faster, as per: w3c/IntersectionObserver#161 (comment) Differential Revision: https://phabricator.services.mozilla.com/D101636 UltraBlame original commit: 6334a7af42751c7aa03de175a5490ab4b1a5f990
… principal base domain. r=mstange This is similar effectively, and should be more correct and faster, as per: w3c/IntersectionObserver#161 (comment) Differential Revision: https://phabricator.services.mozilla.com/D101636
There are two issues here that were brought up when I talked to members of our DOM team at Mozilla:
The text was updated successfully, but these errors were encountered: