[Webkit-unassigned] [Bug 56703] window.localStorage should throw SECURITY_ERR when localStorage is disabled
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 2 12:16:19 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=56703
--- Comment #15 from Brady Eidson <beidson at apple.com> 2011-12-02 12:16:19 PST ---
(In reply to comment #14)
> As background, if that helps, I discovered the difference with the spec while working on this bug:
>
> https://bugs.webkit.org/show_bug.cgi?id=56354 Web Inspector: empty, non-functional window
>
> Although it's true that there's a "may" in step 1, there's a "must" prefacing the steps, and if you go through all of the steps, it seems as far as I can tell that the only options are to throw an exception or return a local storage object.
I think you're referring to "User agents must have a set of local storage areas, one for each origin" and yes - to be a *full* HTML5 compliant user agent it would have to have the local storage areas.
But WebKit is not *only* a 100% HTML5 engine. It supports plenty of modes where various HTML5 features are missing entirely. This is one of those modes we need to continue supporting.
>Returning null doesn't seem to be a valid option according to the spec.
This made me realize that yes, returning null for a missing feature is incorrect behavior. We should be returning undefined here, which is the appropriate behavior for any user agent and any missing feature.
> I should note that in my experience of running Safari with local storage disabled, which I continue to do to this day, the choice is usually not between throwing an exception or having a web site work correctly. The web sites just assume they can use local storage and don't even check for null, so the choice is between throwing an exception or getting a javascript error.
How is it you run Safari with LocalStorage disabled? AFAIK, Safari doesn't support doing this. Twiddling the hidden WebKit default yourself gets you in to unsupported power-user land.
And this may be true for web sites where you notice it, but I'm not suggesting there *might be* web content that properly and wisely do feature testing and change their behavior to match. I'm saying there *is* such content that this change would break.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list