FileError

< apis‎ | file
Jump to: navigation, search

FileError

This article is In Progress.


W3C Working Draft

Summary

Represents an error that occurs while using the FileReader interface.

Obsolete per latest specification. Use DOMError instead.


Properties

API Name Summary
length The number of nodes in the list.
oncached The resources listed in the manifest have been downloaded, and the application is now cached.
onchecking The user agent is checking for an update, or attempting to download the manifest for the first time. This is always the first event in the sequence.
ondownloading The user agent has found an update and is fetching it, or is downloading the resources listed by the manifest for the first time.
onerror Indicates an error has occurred.
onnoupdate Indicates the manifest has not changed.
onobsolete The Webpage is associated with an application cache whose group is marked as obsolete.
onprogress The user agent is downloading resources listed by the manifest. The event object's total attribute returns the total number of files to be downloaded. The event object's loaded attribute returns the number of files processed so far.
onupdateready The ApplicationCache object's cache host is associated with an application cache whose application cache group's update status is idle, and whose application cache group is not marked as obsolete, but that application cache is not the newest cache in its group.
status Returns the current status of the application cache, as given by the constants defined below.
enabled Returns true if the given track is active, and false otherwise. Can be set, to change whether the track is enabled or not. If multiple audio tracks are enabled simultaneously, they are mixed.
id Returns the ID of the given track. This is the ID that can be used with a fragment identifier if the format supports the Media Fragments URI syntax, and that can be used with the getTrackById() method.
kind Returns the category the given track falls into.
label Returns the label of the given track, if known, or the empty string otherwise.
language Returns the language of the given track, if known, or the empty string otherwise.
length Returns the number of tracks in the list.
activeCues Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.
cues Returns the text track list of cues, as a TextTrackCueList object.
inBandMetadataTrackDispatchType Returns the text track in-band metadata track dispatch type string.
kind Returns the text track kind string.
label Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).
language Returns the text track language string.
mode The text track mode, represented by a string from the following list. "disabled": The text track disabled mode. "hidden": The text track hidden mode. "showing": The text track showing mode.
align A string representing the text track cue alignment, as follows. If it is start alignment: the string "start". If it is middle alignment: the string "middle". If it is end alignment: the string "end". If it is left alignment: the string "left". If it is right alignment: the string "right".
endTime The text track cue end time, in seconds.
id The text track cue identifier.
line The text track cue line position. In the case of the value being auto, the string "auto" is returned.
pauseOnExit The text track cue pause-on-exit flag.
position The text track cue text position.
size The text track cue size.
snapToLines The text track cue snap-to-lines flag.
startTime The text track cue start time, in seconds.
text The text track cue text in raw unparsed form.
track Returns the TextTrack object to which this text track cue belongs, if any, or null otherwise.
vertical A string representing the text track cue writing direction, as follows. If it is horizontal: The empty string. If it is vertical growing left: The string "rl". If it is vertical growing right: The string "lr".
length The length attribute returns the number of cues in the list represented by the TextTrackCueList.
length The length attribute of a TextTrackList object returns the number of text tracks in the list represented by the TextTrackList.
length Returns the number of ranges in the object.
track Returns the track object (TextTrack, AudioTrack, or VideoTrack) to which the event relates.
charging Represents if the system's battery is charging.
chargingTime Represents the time remaining in seconds until the system's battery is fully charged.
dischargingTime Represents the time remaining in seconds until the system's battery is completely discharged and the system is about to be suspended.
level Represents the current battery level scaled from 0 to 1.0.
onchargingchange Handles the chargingchange event.
onchargingtimechange Handles the chargingtimechange event.
ondischargingtimechange Handles the dischargingtimechange event.
onlevelchange Handles the levelchange event.
battery The object that exposes the battery status information.
html/elements/canvas A (read-only) reference to the canvas element that the CanvasRenderingContext2D object was created for.
fillStyle The current style used to fill shapes. The style can be a CanvasGradient, a CanvasPattern, or a string containing a CSS color.
... further results

Methods

API Name Summary
abort Cancels the application cache download process. This method is intended to be used by Web applications showing their own caching progress UI, in case the user wants to stop the update (e.g., because bandwidth is limited).
swapCache Switches to the most recent application cache, if there is a newer one. If there isn't, throws an InvalidStateError exception.

This does not cause previously-loaded resources to be reloaded; for example, images do not suddenly get reloaded and style sheets and scripts do not get reparsed or reevaluated. The only change is that subsequent requests for cached resources will obtain the newer copies.

The updateready event will fire before this method can be called. Once it fires, the Web application can, at its leisure, call this method to switch the underlying cache to the one with the more recent updates. To make proper use of this, applications have to be able to bring the new features into play; for example, reloading scripts to enable new features. An easier alternative to swapCache() is just to reload the entire page at a time suitable for the user, using location.reload().

update Invokes the application cache download process. Throws an InvalidStateError exception if there is no application cache to update. Calling this method is not usually necessary, as user agents will generally take care of updating application caches automatically. The method can be useful in situations such as long-lived applications. For example, a Web mail application might stay open in a browser tab for weeks at a time. Such an application could want to test for updates each day.
getTrackById Returns the AudioTrack object with the given identifier, or null if no track has that identifier.
addCue Adds the given cue to textTrack's text track list of cues.
removeCue Removes the given cue from textTrack's text track list of cues.
getCueAsHTML Returns the text track cue text as a DocumentFragment of HTML elements and other DOM nodes.
getCueById Returns the first text track cue (in text track cue order) with text track cue identifier id. Returns null if none of the cues have the given identifier or if the argument is the empty string.
end Returns the time for the end of the range with the given index. Throws an IndexSizeError if the index is out of range.
start Returns the time for the start of the range with the given index. Throws an IndexSizeError if the index is out of range.
addColorStop Adds a new stop to a gradient. If offset is less than 0 or greater than 1 then an IndexSizeError exception must be thrown. If the color cannot be parsed as a CSS <color> value, then a SyntaxError exception must be thrown. Otherwise the gradient must have a new stop placed, at offset offset relative to the whole gradient, and with the color obtained by parsing color as a CSS <color> value.
addHitRegion Creates a hit region.
arc Draws the specified arc.
arcTo Check to be sure there's a subpath for (x1, y1). Then, the behavior depends on the arguments and the last point in the subpath. See Notes.
beginPath Empties the list of subpaths in the context's current default path so that it once again has zero subpaths.
bezierCurveTo Ensures there is a subpath for (cp1x, cp1y), then connects the last point in the subpath to the given point (x, y) using a cubic Bézier curve with control points (cp1x, cp1y) and (cp2x, cp2y), then adds the point (x, y) to the subpath.
clearRect Clears all pixels on the canvas in the given rectangle (x, y, w, h) to transparent black.
clip Specifies a new clipping region by calculating the intersection of the current clipping region and the area described by the intended path, using the non-zero winding number rule. The new clipping region replaces the current clipping region.
closePath Marks the last subpath as closed, creates a new subpath whose first point is the same as the previous subpath's first point, and then adds the new subpath to the path. If the object's path has no subpaths, this method does nothing.
createImageData Depending on how it is called, returns either an ImageData object with the given sw, sh dimensions or an ImageData object with the same dimensions as the imagedata argument. See Notes.
createLinearGradient Returns a linear CanvasGradient initialized with the specified line as represented by the start point (x0, y0) and end point (x1, y1) of the gradient.
createPattern Returns a CanvasPattern object that uses the given image and repeats in the direction(s) given by the repetition argument.
createRadialGradient Returns a radial CanvasGradient initialized with the two specified circles. This effectively creates a cone, touched by the two circles defined in the creation of the gradient, with the part of the cone before the start circle (0.0) using the color of the first offset, the part of the cone after the end circle (1.0) using the color of the last offset, and areas outside the cone (untouched by the gradient) transparent black.
drawCustomFocusRing Draw a focus ring of the appropriate style along the intended path, and sets result to false.
drawImage Draws the specified image onto the canvas. Can be called in three ways; see Notes.
drawSystemFocusRing Draws a focus ring of the appropriate style along the intended path, following platform conventions.
ellipse Draws the specified ellipse. If the object's path has any subpaths, this method adds a straight line from the last point in the subpath to the start point of the arc. Then, it adds the start and end points of the arc to the subpath, and connects them with an arc.
fill Fills all the subpaths of the intended path, using fillStyle, and using the non-zero winding number rule. Open subpaths must be implicitly closed when being filled (without affecting the actual subpaths).
fillRect Paints the specified rectangular area using the color (or style) defined by fillStyle.
fillText Renders the given text at the given (x, y) coordinates, ensuring that the text isn't wider than maxWidth (if specified), using the current font, textAlign, and textBaseline values.
getImageData Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle whose corners are the four points (sx, sy), (sx+sw, sy), (sx+sw, sy+sh), (sx, sy+sh), in canvas coordinate space units.
getLineDash Gets the line dash properties for the stroke.
isPointInPath Returns true if the point given by the x and y coordinates passed to the method, when treated as coordinates in the canvas coordinate space unaffected by the current transformation, is inside the intended path as determined by the non-zero winding number rule; returns false otherwise. If either of the arguments is infinite or NaN, then the method returns false.
lineTo Connects the last point in the subpath to the given point (x, y) using a straight line, and then adds the point to the subpath.
moveTo Creates a new subpath with the specified point as its first (and only) point.
putImageData Writes data from ImageData structures back to the canvas. If any of the arguments are infinite or NaN, the method must throw a NotSupportedError exception. When the last four arguments are omitted, they are assumed to have the values 0, 0, the width member of the imagedata structure, and the height member of the imagedata structure, respectively.
quadraticCurveTo Ensures there is a subpath for (cpx, cpy), then connects the last point in the subpath to the given point (x, y) using a quadratic Bézier curve with control point (cpx, cpy), and then adds the given point (x, y) to the subpath.
rect Creates a new subpath containing just the four points (x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points connected by straight lines, then marks the subpath as closed. It then creates a new subpath with the point (x, y) as the only point in the subpath.
removeHitRegion Removes a previously-defined hit region.
restore Pops the top entry from the drawing state stack, and reset the drawing state it describes. If there is no saved state, the method does nothing.
rotate Addd the rotation transformation described by the argument to the transformation matrix. The angle argument represents a clockwise rotation angle expressed in radians.
save Saves the current state of the context. Use the restore() method to retrieve the saved state.
scale Adds the scaling transformation described by the arguments to the transformation matrix. The x argument represents the scale factor in the horizontal direction; the y argument represents the scale factor in the vertical direction. The factors are multiples.
scrollPathIntoView Scrolls the current path into view. See Notes.
setLineDash Sets the line dash properties for the stroke.
setTransform Resets the current transform to the identity matrix, and then invokes the transform(a, b, c, d, e, f) method with the same arguments.
stroke Traces the intended path, using the CanvasRenderingContext2D object for the line styles, and then fills the combined stroke area using the strokeStyle attribute.
strokeRect Takes the result of tracing the path, using the CanvasRenderingContext2D object's line styles, and fills it with the strokeStyle.
strokeText Renders the given text at the given (x, y) coordinates, ensuring that the text isn't wider than maxWidth (if specified), using the current font, textAlign, and textBaseline values.
transform Replaces the current transformation matrix with the result of multiplying the current transformation matrix with the matrix described by:

a c e
b d f
0 0 1

... further results

Events

API Name Summary
ended All tracks of the MediaStream object have ended; the MediaStream is said to be finished.
chargingchange Fired when the battery charging state is updated.
chargingtimechange Fired when the battery charging time is updated.
dischargingtimechange Fired when the battery discharging time is updated.
levelchange Fired when the battery level is updated.
regionfragmentchange Fires on the NamedFlow object when there is a change in how content flows through a region chain.
regionoversetchange Fires on the NamedFlow object when a change in how its content flows through a region chain renders any region empty or overset (overfilled), or that reverses that state.
addtrack This event is fired when a track is added to the MediaStream.
removetrack This event is fired when a track is removed from the MediaStream.
mute This event fires when the MediaStreamTrack object's source is temporarily unable to provide data.
overconstrained This event fires asynchronously for each affected track (when multiple tracks share the same source) after the user agent has evaluated the current constraints against a given sourceId and is not able to configure the source within the limitations established by the union of imposed constraints.
started This event fires when the MediaStreamTrack object has just transitioned from the "new" readyState to another state.
unmute This event fires when the MediaStreamTrack object's source is live again after having been temporarily unable to provide data.
ended This event is fired when a MediaStream is stopped.
change Fires when the Connection changes.
ended The MediaStreamTrack object's source will not provide data; this may be caused by the following:
  • the user has revoked permissions on the application
  • the source device has been disconnected
  • the remote peer has stopped sending data
  • the stop() method was invoked
muted The MediaStreamTrack object's source is temporarily unable to provide data.
unmuted The MediaStreamTrack object's source has resumed providing data.
addtrack A MediaStreamTrack has been added to the list.
removetrack A MediaStreamTrack has been removed from the list.
addstream
icecandidate
icechange
identityresult
negotiationneeded The browser anticipates a session negotiation is required.

It is triggered whenever addStream, removeStream or setIdentityProvider methods were called successfully and RTCPeerConnection signalingState is stable .

open
removestream A stream has been removed from the remoteStreams array.
statechange
abort When the request has been aborted. For instance, by invoking the abort() method.
error When the request has failed.
load When the request has successfully completed.
loadend When the request has completed (either in success or failure).
loadstart When the request starts.
progress While sending and loading data.
readystatechange Fires whenever the readyState of the request changes. Mostly used to determine whether the body of the response is available for handling.
timeout When the author specified timeout has passed before the request could complete.
error
load
progress
timeout
rowenter
rowexit
rowsdelete
rowsinserted
scroll
select
selectionchange
selectstart
start
stop
... further results

Needs Examples: This section should include examples.

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [fileError Object Article]