Bug 226337

Summary: Enforce a quota in window.sessionStorage
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, beidson, cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: http://wpt.live/webstorage/storage_session_setitem_quotaexceedederr.window.html
Attachments:
Description Flags
Patch
cdumez: review+, cdumez: commit-queue-
PFL ews-feeder: commit-queue-

Description Sam Sneddon [:gsnedders] 2021-05-27 09:29:11 PDT
<rdar://78507096>

Per wpt.fyi this has been happening for a while. Interestingly storage_local_setitem_quotaexceedederr.window.html (i.e., the localStorage variant) passes.
Comment 1 Radar WebKit Bug Importer 2021-05-27 09:29:21 PDT
<rdar://problem/78572282>
Comment 2 Sam Sneddon [:gsnedders] 2021-05-27 09:37:49 PDT
<rdar://78507096>
Comment 3 Brady Eidson 2021-06-03 13:35:29 PDT
We need to add a sessionStorage quota to both pass the test and fix the crash.
Comment 4 Brady Eidson 2021-06-03 21:37:53 PDT
Created attachment 430536 [details]
Patch
Comment 5 Chris Dumez 2021-06-03 21:44:24 PDT
Comment on attachment 430536 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430536&action=review

> LayoutTests/storage/domstorage/quota.html:-57
> -function testNoQuota(storageString)

You'll likely need to update LayoutTests//platform/ios/ios/storage/domstorage/5mb-quota.html too.
Comment 6 Chris Dumez 2021-06-03 21:46:21 PDT
(In reply to Chris Dumez from comment #5)
> Comment on attachment 430536 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430536&action=review
> 
> > LayoutTests/storage/domstorage/quota.html:-57
> > -function testNoQuota(storageString)
> 
> You'll likely need to update
> LayoutTests//platform/ios/ios/storage/domstorage/5mb-quota.html too.

BTW, I am not quite sure why we have an iOS-specific test. Maybe we can drop it if the behavior isn't any different on macOS and iOS.
Comment 7 Chris Dumez 2021-06-03 23:17:26 PDT
Comment on attachment 430536 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430536&action=review

> LayoutTests/ChangeLog:8
> +        * storage/domstorage/quota.html:

Looks like this test needs to be rebaselined too.
Comment 8 Brady Eidson 2021-06-04 08:41:30 PDT
(In reply to Chris Dumez from comment #7)
> Comment on attachment 430536 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430536&action=review
> 
> > LayoutTests/ChangeLog:8
> > +        * storage/domstorage/quota.html:
> 
> Looks like this test needs to be rebaselined too.
(In reply to Chris Dumez from comment #6)
> (In reply to Chris Dumez from comment #5)
> > Comment on attachment 430536 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=430536&action=review
> > 
> > > LayoutTests/storage/domstorage/quota.html:-57
> > > -function testNoQuota(storageString)
> > 
> > You'll likely need to update
> > LayoutTests//platform/ios/ios/storage/domstorage/5mb-quota.html too.
> 
> BTW, I am not quite sure why we have an iOS-specific test. Maybe we can drop
> it if the behavior isn't any different on macOS and iOS.


After I uploaded is when I discovered the iOS test locally. UIWebView enforced a 5mb quota.

We can drop it now.

> > LayoutTests/ChangeLog:8
> > +        * storage/domstorage/quota.html:
>
> Looks like this test needs to be rebaselined too.

Passed locally, so yah I'll figure it out *sigh*
Comment 9 Brady Eidson 2021-06-04 11:52:25 PDT
Created attachment 430596 [details]
PFL
Comment 10 EWS 2021-06-04 14:21:56 PDT
Committed r278498 (238505@main): <https://commits.webkit.org/238505@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430596 [details].