Bug 305922
| Summary: | Make location.ancestorOrigins not return stale origins after iframe removal | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pieters (:zcorpan) <zcorpan> |
| Component: | DOM | Assignee: | sideshowbarker <mike> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, annevk, cdumez, karlcow, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://wpt.live/html/browsers/history/the-location-interface/location-ancestor-origins-inactive-document.sub.html | ||
Simon Pieters (:zcorpan)
See https://github.com/whatwg/html/pull/12071
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
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)
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
<rdar://problem/169097730>
Ahmad Saleem
Test Case - https://wpt.fyi/results/html/browsers/history/the-location-interface/location-ancestor-origins-inactive-document.sub.html?label=experimental&label=master&aligned
Live Link - https://wpt.live/html/browsers/history/the-location-interface/location-ancestor-origins-inactive-document.sub.html
Anne van Kesteren
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)
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
Pull request: https://github.com/WebKit/WebKit/pull/60263
EWS
Committed 309126@main (de0ea2ba7c3a): <https://commits.webkit.org/309126@main>
Reviewed commits have been landed. Closing PR #60263 and removing active labels.