RESOLVED FIXED305922
Make location.ancestorOrigins not return stale origins after iframe removal
https://bugs.webkit.org/show_bug.cgi?id=305922
Summary Make location.ancestorOrigins not return stale origins after iframe removal
Simon Pieters (:zcorpan)
Reported 2026-01-21 08:11:38 PST
Attachments
Alexey Proskuryakov
Comment 1 2026-01-21 17:32:56 PST
Thank you for the report! We can probably figure it out with more effort, but from a cursory glance at the issue, I'm not sure which exact aspect of the discussion this bug covers. Would you mind clarifying? A test case would be ideal, of course.
Simon Pieters (:zcorpan)
Comment 2 2026-01-22 00:18:02 PST
This is mainly about removing `[SameObject, CachedAttribute]` so that a new `DOMTokenList` object is returned every time. The spec says to compute the list when a `Document` is created, but without the `referrerpolicy` change I think it's not observable if it's computed lazily. (You can still cache the underlying array, so long as you return a new `DOMTokenList` every time and make sure to return an empty list when the document is not active.) Tests are linked from the spec PR.
Radar WebKit Bug Importer
Comment 3 2026-01-28 08:12:12 PST
Anne van Kesteren
Comment 5 2026-01-30 02:05:49 PST
Note that I left feedback on the PR. Returning a new object for getter each time it is invoked would be a very surprising behavior and go against API design guidelines. There might well be something we have to change, but what exactly isn't clear yet.
Simon Pieters (:zcorpan)
Comment 6 2026-02-11 02:57:01 PST
I've updated the PR based on Anne's feedback. location.ancestorOrigins === location.ancestorOrigins should be true, except when the "relevant Document" changes to null. WebKit doesn't invalidate the cache when "relevant Document" changes to null (e.g. remove an iframe or navigate a parent frame). Test: https://github.com/web-platform-tests/wpt/pull/56635
sideshowbarker
Comment 7 2026-03-10 07:22:33 PDT
EWS
Comment 8 2026-03-12 01:47:50 PDT
Committed 309126@main (de0ea2ba7c3a): <https://commits.webkit.org/309126@main> Reviewed commits have been landed. Closing PR #60263 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.