Created attachment 404001 [details]
Testing on iOS 14 beta 2, I'm seeing the following broken behavior for the requestStorageAccess prompt in WKWebView:
1. On the simulator, clicking "Don't allow" or "Allow" does the opposite: "Don't allow" grants access while "Allow" denies it.
2. On device, in situations where the prompt should be shown, storage access is granted silently without displaying any prompt.
The behavior is correct in Safari, but broken in WKWebView (I'm testing using Chrome).
I've attached a test case that reproduces this bug:
1. First visit https://alijuma.github.io/request.html and click the button.
2. Visit the attached test page (which embeds the page above) and click the button, which triggers requestStorageAccess.
Expected behavior (and behavior in Safari): a prompt is shown, and clicking on "Allow" or "Don't allow" updates the displayed message to indicate whether the promise resolved or rejected.
Actual behavior in WKWebView: On simulator, the prompt is shown, but the buttons do the opposite of what they should. On device, no prompt is shown.
Also created FB7910866 for this.
Oh wow -- I think this has been inverted the whole time!
Ali: Looking at the code, I believe this has been broken in all versions of iOS with this prompt. Did you test in iOS 13 and find that it worked properly in that release?
Created attachment 404015 [details]
(In reply to Brent Fulgham from comment #4)
> Ali: Looking at the code, I believe this has been broken in all versions of
> iOS with this prompt. Did you test in iOS 13 and find that it worked
> properly in that release?
On iOS 13, I don't see the prompt at all in WKWebView (storage access is silently granted), presumably because ITP isn't enabled in iOS 13.
Committed r264266: <https://trac.webkit.org/changeset/264266>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 404015 [details].