Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/mozilla/firefox/releases/40/index.md
6581 views
---
title: Firefox 40 for developers slug: Mozilla/Firefox/Releases/40
---

{{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:

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-parent value (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 auto has been dropped and the values inline and block added, with inline being the new default value (Firefox bug 1028716).

  • The property {{cssxref("font-size-adjust")}} has been fixed so that 0 is treated as a multiplier (leading to a 0 height for the font, hence hiding it) instead of the none value (leading to no adjustment, or a 1.0 value) (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.contains now 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 constructor property 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.contains is 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 get trap were not working properly, has been fixed. If the get trap in a {{jsxref("Proxy")}} was not defined, {{jsxref("Array.length")}} returned 0 and the set trap didn't get called. A workaround was to add the get trap even if was not necessary in your code. This issue has been fixed now (Firefox bug 895223).

  • WeakMap.prototype and WeakSet.prototype have 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.enabled pref, 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).

  • Animation and AnimationEffect have been merged into the newly created KeyframeEffectReadOnly (Firefox bug 1153734).

  • AnimationPlayer has 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 CSSCharsetRule interface 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 null anymore 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

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 schemes data:, blob: or :filesystem anymore 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

JavaScript code modules

XPCOM

  • The nsIClassInfo.implementationLanguage attribute has been removed, along with the nsClassInfo::GetImplementationLanguage() function.

  • The following XPCOM interfaces have been removed; you should use the standard HTML interfaces instead:

    • nsIDOMHTMLBRElement

    • nsIDOMDivElement

    • nsIDOMHTMLHeadingElement

    • nsIDOMHTMLTableCaptionElement

    • nsIDOMHTMLTableElement

    • nsIDOMHTMLTitleElement

Other

Older versions

{{Firefox_for_developers('39')}}