Path: blob/main/files/en-us/mozilla/firefox/releases/40/index.md
6581 views
------{{FirefoxSidebar}}
To test the latest developer features of Firefox, install Firefox Developer Edition Firefox 40 was released on August 11, 2015. This article lists key changes that are useful not only for web developers, but also Firefox and Gecko developers as well as add-on developers.
Changes for Web developers
Developer Tools
Highlights:
More:
Copy URL/Open in New Tab context menu items for Debugger source list pane
Style Editor: "Open Link In New Tab" item added to stylesheet list
Inspector selector search now includes class/id results even without css prefix
Tooltips in box-model view saying which CSS rule caused the value
Switch between color unit format in the Inspector using Shift+click
Everything: all devtools bugs fixed between Firefox 39 and Firefox 40.
CSS
Prefixed rules (
-moz-) for {{cssxref("text-decoration-color")}}, {{cssxref("text-decoration-line")}}, and {{cssxref("text-decoration-style")}} have been removed (Firefox bug 1097922).The property {{cssxref("text-align")}} now supports the
match-parentvalue (Firefox bug 645642).In Quirks Mode, {{cssxref("empty-cells")}} now defaults to
show, like in standard mode (Firefox bug 1020400).The {{cssxref("-moz-orient")}} non-standard property, used to style {{HTMLElement('meter')}} and {{HTMLElement('progress')}} element has been adapted for vertical writing-modes: the value
autohas been dropped and the valuesinlineandblockadded, withinlinebeing the new default value (Firefox bug 1028716).The property {{cssxref("font-size-adjust")}} has been fixed so that
0is treated as a multiplier (leading to a0height for the font, hence hiding it) instead of thenonevalue (leading to no adjustment, or a1.0value) (Firefox bug 1144885).Fix text-overflow doesn't work in vertical writing mode (Firefox bug 1117227).
HTML
No change.
JavaScript
Unreachable code after {{jsxref("Statements/return", "return")}} statement (including unreachable expression after {{jsxref("Statements/return", "semicolon-less return statements", "#Automatic_semicolon_insertion", 1)}}) will now show a warning in the console (Firefox bug 1005110, Firefox bug 1151931).
{{jsxref("Symbol.match")}} has been added (Firefox bug 1054755).
Passing an object which has a property named {{jsxref("Symbol.match")}} with a {{Glossary("truthy")}} value to {{jsxref("String.prototype.startsWith")}}, {{jsxref("String.prototype.endsWith")}}, and
String.prototype.containsnow throws a {{jsxref("TypeError")}} (Firefox bug 1054755).{{jsxref("RegExp")}} function returns pattern itself if called without {{jsxref("Operators/new", "new")}} and pattern object has a property named {{jsxref("Symbol.match")}} with a {{Glossary("truthy")}} value, and the pattern object's
constructorproperty equals to {{jsxref("RegExp")}} function. (Firefox bug 1147817).Support for the non-standard JS1.7 destructuring for-in has been dropped (Firefox bug 1083498).
Non-standard initializer expressions in for...in loops are now ignored and will present a warning in the console. (Firefox bug 748550 and Firefox bug 1164741).
\u{xxxxxx}Unicode code point escapes have been added (Firefox bug 320500).{{jsxref("String.prototype.includes", "String.prototype.contains", "#String.prototype.contains")}} has been replaced with {{jsxref("String.prototype.includes")}},
String.prototype.containsis kept as an alias (Firefox bug 1102219).If the {{jsxref("DataView")}} constructor is called as a function without the {{ jsxref("Operators/new", "new") }} operator, a {{jsxref("TypeError")}} is now thrown as per the ES2015 specification.
An issue regressed in Firefox 21, where proxyfied arrays without the
gettrap were not working properly, has been fixed. If thegettrap in a {{jsxref("Proxy")}} was not defined, {{jsxref("Array.length")}} returned0and thesettrap didn't get called. A workaround was to add thegettrap even if was not necessary in your code. This issue has been fixed now (Firefox bug 895223).WeakMap.prototypeandWeakSet.prototypehave been updated to be just ordinary objects, per ES2015 specification (Firefox bug 1055473).
Interfaces/APIs/DOM
New APIs
The Push API has been experimentally implemented (Firefox bug 1038811). Controlled by the
services.push.enabledpref, it is disabled by default.
Web Animations API
Improvement in our experimental Web Animations implementation, mostly to match latest spec changes:
{{domxref("Animation/currentTime", "AnimationPlayer.currentTime")}} now can also be set (Firefox bug 1072037).
Animatable.getAnimationPlayers(), available on {{domxref("Element")}} has been renamed to {{domxref("Element.getAnimations()")}} (Firefox bug 1145246).AnimationandAnimationEffecthave been merged into the newly createdKeyframeEffectReadOnly(Firefox bug 1153734).AnimationPlayerhas been renamed to {{domxref("Animation")}} (Firefox bug 1154615).{{domxref("AnimationTimeline")}} is now an abstract class, with {{domxref("DocumentTimeline")}} its only implementation (Firefox bug 1152171).
CSSOM
The CSS Font Loading API is now enabled by default in Nightly and Developer Edition releases (Firefox bug 1088437). It is still deactivated by default in Beta and Release browsers.
The
CSSCharsetRuleinterface has been removed and such objects are no longer available in CSSOM (Firefox bug 1148694). This matches the spec (recently adapted) and Chrome behavior.
WebRTC
WebRTC: the {{domxref("RTCPeerConnection.negotiationneeded_event", "negotiationneeded")}} event is now also sent for initial negotiations, not only for re-negotiations (Firefox bug 1149838).
DOM & HTML DOM
When unable to parse the {{htmlattrxref("srcset", "image")}}, the {{domxref("HTMLImageElement.currentSrc")}} method doesn't return
nullanymore but"", as requested by the latest specification (Firefox bug 1139560).Like for images, Firefox now throttles {{domxref("Window.requestAnimationFrame()")}} for non-visible {{HTMLElement("iframe")}} (Firefox bug 1145439).
{{domxref("NavigatorID/taintEnabled", "Navigator.taintEnabled")}} is no longer available for Web workers (Firefox bug 1154878).
Web Audio API
New extensions to the Web Audio API:
The {{domxref("BaseAudioContext/state", "AudioContext.state")}} and {{domxref("BaseAudioContext.statechange_event", "AudioContext.onstatechange")}} properties as well as the methods {{domxref("AudioContext.suspend()")}}, {{domxref("AudioContext.resume()")}}, and {{domxref("AudioContext.close()")}} have been added (Firefox bug 1094764).
{{domxref("AudioBufferSourceNode")}} now implements the {{domxref("AudioBufferSourceNode.detune")}} k-rate attribute (Firefox bug 1153783).
Web Workers
Slight improvement in our Service Worker API: the {{domxref("ServiceWorkerRegistration.update()", "update()")}} method has been moved from {{domxref("ServiceWorkerGlobalScope")}} to {{domxref("ServiceWorkerRegistration")}} (Firefox bug 1131350).
{{domxref("ServiceWorkerRegistration")}} is now available in Web workers (Firefox bug 1131327).
{{domxref("DataStore")}} is now available in Web workers (Firefox bug 916196).
IndexedDB
{{domxref("IDBTransaction")}} are now non-durable by default (Firefox bug 1112702). This favors performance over reliability and matches what other browsers are doing. For more information, read our durability definition.
Dev Tools
The property {{domxref("console.timeStamp")}} has been added (Firefox bug 922221).
MathML
No change.
SVG
No change.
Audio/Video
No change.
Networking
No change.
Security
Using an asterisk (
*) in a {{Glossary("CSP")}} does not include the schemesdata:,blob:or:filesystemanymore when matching source expressions. So those schemes now need to be explicitly defined within the related header to match the CSP (Firefox bug 1086999).
Changes for add-on and Mozilla developers
XUL
It is no longer possible to create transparent top-level windows Firefox bug 1162649.
JavaScript code modules
Dict.jsm has been removed Firefox bug 1123309. Use {{jsxref("Map")}} instead.
XPCOM
The
nsIClassInfo.implementationLanguageattribute has been removed, along with thensClassInfo::GetImplementationLanguage()function.The following XPCOM interfaces have been removed; you should use the standard HTML interfaces instead:
nsIDOMHTMLBRElementnsIDOMDivElementnsIDOMHTMLHeadingElementnsIDOMHTMLTableCaptionElementnsIDOMHTMLTableElementnsIDOMHTMLTitleElement
Other
Places Keywords API has been deprecated and will be removed soon (Firefox bug 1140395).
The automated testing system now supports skipping individual test functions. See running conditional tests in XPCShell testing.
Older versions
{{Firefox_for_developers('39')}}