Skip to content

Conversation

@servo-wpt-sync
Copy link
Collaborator

@servo-wpt-sync servo-wpt-sync commented Dec 27, 2025

Change quota accounting for WebStorage so that usage is tracked per storage
type instead of combining localStorage and sessionStorage into a single per
origin total.

The previous implementation summed the sizes of both storage types and applied
a shared quota limit. This could cause a write to sessionStorage to fail due
to data stored in localStorage (and vice-versa), and also resulted in origin
descriptors being created even when only one storage type was in use.

This behavior is not consistent with other browsers, where quota is enforced
independently for each storage mechanism.

Testing: Existing unit and WPT tests continue to pass, a new WPT test has been
added

Reviewed in servo/servo#41531

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync servo-wpt-sync force-pushed the servo_export_41531 branch 2 times, most recently from 2fa387e to 54c71c5 Compare December 27, 2025 21:07
The new tests verify that exhausting the quota of one Web Storage area does
not significantly reduce the capacity available to the other one.

Each test first measures the baseline capacity of one storage type by filling
it until QuotaExceededError is thrown, then clears it, exhausts the other
storage type, and measures the capacity again. Independence is verified by
requiring that the second measurement remains broadly comparable to the
baseline rather than collapsing to near-zero capacity, which would indicate
a shared quota.

Two directional tests are added:
- sessionStorage retains comparable quota after localStorage exhaustion
- localStorage retains comparable quota after sessionStorage exhaustion

Gecko currently fails these new tests. This is consistent with the fact that
the existing quota exhaustion tests also currently fail in Gecko.

Signed-off-by: Jan Varga <[email protected]>
@servo-wpt-sync servo-wpt-sync merged commit cfb1499 into web-platform-tests:master Dec 28, 2025
25 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_41531 branch December 28, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants