Bug 33916

Summary: openDatabase should throw exception if database access is disallowed
Product: WebKit Reporter: Eric U. <ericu>
Component: DOMAssignee: Dumitru Daniliuc <dumi>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dglazkov, dimich, dumi, eric, fishd, patrik.j.persson, webkit.review.bot
Priority: P4    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch dglazkov: review+, dumi: commit-queue-

Description Eric U. 2010-01-20 12:33:00 PST
From the spec [http://dev.w3.org/html5/webdatabase/ section 4.1.1]: "The user agent may raise a SECURITY_ERR exception instead of returning a Database object if the request violates a policy decision (e.g. if the user agent is configured to not allow the page to open databases)."  We're just returning null, which isn't an option offered by the specification.

The current behavior is enforced by LayoutTests/fast/frames/sandboxed-iframe-storage.html.
Comment 1 Dumitru Daniliuc 2010-04-08 13:19:11 PDT
Created attachment 52889 [details]
patch
Comment 2 Dimitri Glazkov (Google) 2010-04-08 13:25:06 PDT
Comment on attachment 52889 [details]
patch

ok. Can you reference a layout test that enforces it?
Comment 3 Patrik Persson 2010-04-09 00:02:33 PDT
(In reply to comment #3)
> From the spec [http://dev.w3.org/html5/webdatabase/ section 4.1.1]: "The user
> agent may raise a SECURITY_ERR exception instead of returning a Database object
> if the request violates a policy decision (e.g. if the user agent is configured
> to not allow the page to open databases)."  We're just returning null, which
> isn't an option offered by the specification.
> 
> The current behavior is enforced by
> LayoutTests/fast/frames/sandboxed-iframe-storage.html.

FYI: that particular layout test was revised in bug 32369. However, that change was specific to sandboxed iframes. Other database policy decisions were not addressed by bug 32369.
Comment 4 Dumitru Daniliuc 2010-04-12 17:26:18 PDT
Do we have a way to turn on/off DB support in tests? If not, then I'm not sure how to write a test for this patch, because DB support is enabled by default.
Comment 5 Dumitru Daniliuc 2010-04-12 18:08:42 PDT
Landed as r57492.
Comment 6 WebKit Review Bot 2010-04-12 18:35:38 PDT
http://trac.webkit.org/changeset/57492 might have broken SnowLeopard Intel Release (Tests)
Comment 7 Dumitru Daniliuc 2010-04-12 19:59:24 PDT
(In reply to comment #6)
> http://trac.webkit.org/changeset/57492 might have broken SnowLeopard Intel
> Release (Tests)

Fixed storage/open-database-over-quota.html in r57493.