Bug 15592 - DOM Exception opening up client-side database example for the first time
Summary: DOM Exception opening up client-side database example for the first time
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL: http://webkit.org/misc/DatabaseExampl...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-21 10:33 PDT by David Kilzer (:ddkilzer)
Modified: 2007-10-21 12:49 PDT (History)
3 users (show)

See Also:


Attachments
Patch v1 (2.20 KB, patch)
2007-10-21 11:33 PDT, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2007-10-21 10:33:02 PDT
* SUMMARY
"DOM Exception 12" is reported the very first time the DatabaseExample.html page is opened.

* STEPS TO REPRODUCE
1. Remove ~/Libraries/WebKit/Databases if it exists.
2. Launch Safari + WebKit.
3. Open URL:  http://webkit.org/misc/DatabaseExample.html
4. Open JavaScript Console.

* EXPECTED RESULTS
No "DOM Exception 12" should be reported in the JavaScript Console.

* ACTUAL RESULTS
A "DOM Exception 12" is reported in the JavaScript Console:

SYNTAX_ERR: DOM Exception 12
http://webkit.org/misc/DatabaseExample.html
Line: 264

* REGRESSION
Not applicable as client-side database support is a new feature.

* NOTES
Tested with a local debug build of WebKit r26847 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218).
Comment 1 David Kilzer (:ddkilzer) 2007-10-21 10:34:23 PDT
Also, I believe this "DOM Exception 12" prevents a new blank note from being created the first time the page is loaded.

Comment 2 David Kilzer (:ddkilzer) 2007-10-21 11:07:12 PDT
(In reply to comment #1)
> Also, I believe this "DOM Exception 12" prevents a new blank note from being
> created the first time the page is loaded.

The problem is that there is a race condition between creating the WebKitStickyNotes table for the first time and querying the table in the loaded() function.  The loaded() function may get called before the WebKitStickyNotes table is created.

Comment 3 David Kilzer (:ddkilzer) 2007-10-21 11:33:30 PDT
Created attachment 16767 [details]
Patch v1

Proposed fix.
Comment 4 Darin Adler 2007-10-21 11:45:06 PDT
Comment on attachment 16767 [details]
Patch v1

r=me
Comment 5 David Kilzer (:ddkilzer) 2007-10-21 11:53:42 PDT
Committed revision 26851.

Comment 6 Timothy Hatcher 2007-10-21 12:49:54 PDT
Oops, I fixed this for the original example. But it wasn't fixed in Adam's version.