--- title: Firefox 5 for developers slug: Mozilla/Firefox/Releases/5 tags: - Firefox - Firefox 5 - Gecko 5.0 - NeedsTranslation - TopicStub translation_of: Mozilla/Firefox/Releases/5 ---
Firefox 5, based on Gecko 5.0, was released on June 21, 2011. This article provides links to information about the changes that affect developers in this release.
ImageData
object as the input to the createImageData()
method; this creates a new ImageData
object initialized with the same dimensions as the specified object, but still with all pixels preset to transparent black. This was documented as implemented already but was not.addColorStop()
now correctly throws INDEX_SIZE_ERR
instead of SYNTAX_ERR
.toDataURL()
now correctly lower-cases the specified MIME type before matching.getImageData()
now correctly accepts rectangles that extend beyond the bounds of the canvas; pixels outside the canvas are returned as transparent black.drawImage()
and createImageData()
now handle negative arguments in accordance with the specification, by flipping the rectangle around the appropriate axis. We need an article about CSS sizing and how this works.createImageData()
now properly throws a NOT_SUPPORTED_ERR
exception.createImageData()
and getImageData()
now correctly return at least one pixel's worth of image data if a rectangle smaller than one pixel is specified.createRadialGradient()
now correctly throws INDEX_SIZE_ERR
.null
or undefined
image when calling createPattern()
or drawImage()
now correctly throws a TYPE_MISMATCH_ERR
exception.globalAlpha
no longer throws a SYNTAX_ERR
exception; these are now correctly silently ignored.translate()
, transform()
, rect()
, clearRect()
, fillRect()
, strokeRect()
, lineTo()
, moveTo()
, quadraticCurveTo()
, or arc()
no longer throws an exception; these calls are now correctly silently ignored.shadowOffsetX
, shadowOffsetY
, or shadowBlur
to an invalid value is now silently ignored.rotate
or scale
to an invalid value is now silently ignored.-moz-
prefix for now.modify()
method has been changed so that the "word" selection granularity no longer includes trailing spaces; this makes it more consistent across platforms and matches the behavior of WebKit's implementation.XMLHttpRequest
now supports the loadend
event for progress listeners. This is sent after any transfer is finished (that is, after the abort
, error
, or load
event). You can use this to handle any tasks that need to be performed regardless of success or failure of a transfer.slice()
method has been removed and replaced with a new, proposed syntax that makes it more consistent with Array.slice()
and String.slice()
methods in JavaScript. This method is named mozSlice()
for now.Accept-Language
HTTP header.Function.prototype.isGenerator()
method is now supported; this lets you determine if a function is a generator.class
, enum
, export
, extends
, import
, and super
.length
property indicating the number of items in the lists: {{ domxref("SVGLengthList") }}, {{ domxref("SVGNumberList") }}, {{ domxref("SVGPathSegList") }}, and {{ domxref("SVGPointList") }}.Keep-Alive
HTTP header; we weren't formatting it correctly, and it was redundant since we were also sending the {{ httpheader("Connection") }} or {{ httpheader("Proxy-Connection") }} header with the value "keep-alive" anyway.Content-Disposition
HTTP response header more effectively if both the filename
and filename*
parameters are provided; it looks through all provided names, using the filename*
parameter if one is available, even if a filename
parameter is included first. Previously, the first matching parameter would be used, thereby preventing a more appropriate name from being used. See {{ bug(588781) }}.Console
object now has a debug()
method, which is an alias for its log()
method; this improves compatibility with certain existing sites.For a guide to updating your add-on for Firefox 5, please see Updating add-ons for Firefox 5.
Dict.jsm
code module was added; it provides an API for dictionaries of key/value pairs.asyncFetch()
method now supports specifying the input source as an {{ interface("nsIInputStream") }}.HTMLCanvasElement
).nsIAppStartup2
and {{ interface("nsIAppStartup_MOZILLA_2_0") }} interfaces have been merged into the {{ interface("nsIAppStartup") }} interface.nsIDocShell_MOZILLA_2_0_BRANCH
interface has been merged into the {{ interface("nsIDocShell") }} interface.nsIFocusManager_MOZILLA_2_0_BRANCH
interface has been merged into the {{ interface("nsIFocusManager
") }} interface.nsIHTMLEditor_MOZILLA_2_0_BRANCH
interface has been merged into the {{ interface("nsIHTMLEditor") }} interface.nsIDOMAnimationEvent
added. {{domxref("AnimationEvent")}}The following interfaces were implementation details that are no longer needed:
nsICiter
(see {{ bug("633066") }})nsIDOM3Document
(see {{ bug("639849") }})nsIFIXptrEvaluator
nsISelectElement
(see {{ bug("619996") }})DebugOnly<T>
helper makes it possible to declare variables only for DEBUG
builds.JS_DoubleToInt32()
and JS_DoubleToUint32()
have been added, for converting jsdouble
values into C integers and unsigned integers.mozconfig
file; the --enable-application
setting now defaults to "browser". After pulling or downloading the code, you can simply configure && make
(or make -f client.mk
) to build Firefox.