By my reading, the spec does not clearly specify what the 'origin' should be. IDBFactory.open/deleteDatabase say "Let origin be the origin of the IDBEnvironment used to access this IDBFactory." The IDL states "Window implements IDBEnvironment;" The HTML5 spec, as far as I can tell, does not define the concept of an origin for a window, but only for a document.
There is another related question here: how should IndexedDB behave in the presence of modifications to document.domain? - Kyle