Closed Bug 1231081 Opened 9 years ago Closed 7 years ago

IDBRequest.onsuccess and onerror docs missing event explanation

Categories

(Developer Documentation Graveyard :: API: IndexedDB, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: robincafolla, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151030084315

Steps to reproduce:

Docs on IDBRequest.onsuccess and IDBRequest.onerror are missing information on the parameter passed to the callback.

e.g:

request.onsuccess = function() { ... };

should read

request.onsuccess = function( event ) { ... };

where the event interface is documented. It may not even be an event. (although my jpm console seems to think it is)


Actual results:

No docs for the event object.


Expected results:

There should at least be an interface for that event.

Things it would be nice to know:
  - What is it? (interface)
  - Is it standardised across browsers?
  - What can it be used for?
This may actually be a spec issue:

http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest

I see in the spec IDBRequest.onsuccess is defined as an EventHandler, but it doesn't state any particular Event that is passed to it, and the examples in the spec don't list the Event.

Does that mean the parameter is a generic event with no specific data for the request?
Spec says it is a "success" event:
http://www.w3.org/TR/IndexedDB/#widl-IDBRequest-onsuccess
http://www.w3.org/TR/IndexedDB/#dfn-fire-a-success-event says: "The event must use the Event interface and have its type set to "success". The event does not bubble and is not cancelable."

The interface is Event, with type="success", bubble=no and cancelable=no.

The parameter is indeed missing in the article example.

And success in the description should be a link to https://developer.mozilla.org/en-US/docs/Web/Events/success

(Similar for onerror).
I don't mind editing the docs to reflect that. Is there a style guide for how event information should be included?
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.