Bug 226337 - Enforce a quota in window.sessionStorage
Summary: Enforce a quota in window.sessionStorage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL: http://wpt.live/webstorage/storage_se...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-27 09:29 PDT by Sam Sneddon [:gsnedders]
Modified: 2021-06-04 19:36 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.59 KB, patch)
2021-06-03 21:37 PDT, Brady Eidson
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff
PFL (6.88 KB, patch)
2021-06-04 11:52 PDT, Brady Eidson
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].