Back to Content

Firefox 51 release notes for developers

files/en-us/mozilla/firefox/releases/51/index.md

latest20.4 KB
Original Source

To test the latest developer features of Firefox, install Firefox Developer Edition. Firefox 51 was released on January 24, 2017. 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

HTML

  • {{HTMLElement("hr")}} elements can now be used as separators in {{HTMLElement("menu")}} elements (Firefox bug 870388).
  • The {{HTMLElement("input")}} and {{HTMLElement("textarea")}} elements' selectionStart and selectionEnd attributes now correctly return the current position of the text input cursor when there's no selection, instead of returning 0 (Firefox bug 1287655).

CSS

  • Implemented {{cssxref(":indeterminate")}} for <input type="radio"> (Firefox bug 885359).
  • Implemented {{cssxref(":placeholder-shown")}} for <input type="text"> (Firefox bug 1069015).
  • The {{cssxref("::placeholder")}} pseudo-element is now unprefixed (Firefox bug 1069012).
  • Fixed the {{cssxref(":valid")}} CSS pseudo-class which didn't match valid {{HTMLElement("form")}} elements (Firefox bug 1285425).
  • The plaintext value of {{cssxref("unicode-bidi")}} now also works with vertical writing modes (Firefox bug 1302734).
  • The fill-box and stroke-box values of {{cssxref("clip-path")}} are now properly supported; previously, they were aliases of border-box (Firefox bug 1289011).
  • Clamp flex line's height (clamping stretched flex items), in single-line auto-height flex container w/ max-height (spec change) (Firefox bug 1000957).

JavaScript

WebGL

IndexedDB v2

Canvas

  • The non-standard CanvasRenderingContext2D.mozFillRule() method has been removed; the fill rule can be defined using a parameter of the standard {{domxref("CanvasRenderingContext2D.fill()")}} method (Firefox bug 826619).
  • The {{domxref("CanvasRenderingContext2D.imageSmoothingEnabled")}} has been unprefixed (Firefox bug 768072)

SVG

  • Added {{SVGAttr("tabindex")}} attribute (Firefox bug 778654).
  • Added {{SVGAttr("href")}} attribute, which renders {{SVGAttr("xlink:href")}} obsolete (Firefox bug 1245751).
  • You can now use custom data attributes on SVG elements through the {{domxref("HTMLElement.dataset")}} property and the {{SVGAttr("data-*")}} set of SVG attributes (Firefox bug 921834).
  • CSS Animations used in an SVG image which is presented in an {{HTMLElement("img")}} element now work again; this was an old regression (Firefox bug 1190881).

Web Workers

  • The non-standard and obsolete onclose event handler and {{domxref("Worker")}} use of the close event have been removed from Firefox.

Networking

XHR

  • The {{domxref("XMLHttpRequest.responseXML")}} property no longer returns a partial {{domxref("Document")}} with a <parsererror> node placed at the top when a parse error occurs attempting to interpret the received data. Instead, it correctly returns null (Firefox bug 289714).
  • To match the latest specification an {{domxref("XMLHttpRequest")}} without an {{HTTPHeader("Accept")}} header set with {{domxref("XMLHttpRequest.setRequestHeader()", "setRequestHeader()")}} is now sent with such a header, with its value set to */* (Firefox bug 918752).
  • Fixed {{domxref("XMLHttpRequest.open()")}} so that, when omitted, the username and password parameters now default to null, per the specification (Firefox bug 933759).

WebRTC

  • The {{domxref("RTCPeerConnection.removeStream()")}} method has been removed. It was deprecated back in Firefox 22, and has been throwing a NotSupportedError {{domxref("DOMException")}} for a long time. You need to use {{domxref("RTCPeerConnection.removeTrack()")}} instead, for each track on the stream.
  • WebRTC now supports the VP9 codec by default. When added in Firefox 46, VP9 was disabled by default, but when enabled was the preferred codec; however, it has been moved to be the second choice (after VP8) due to its current level of CPU usage.
  • The method {{domxref("HTMLMediaElement.captureStream()")}}, which returns a {{domxref("MediaStream")}} containing the content of the specified {{HTMLElement("video")}} or {{HTMLElement("audio")}}. It's worth noting that this is prefixed still as mozCaptureStream(), and that it doesn't yet exactly match the spec.

Audio/video

  • Added FLAC support (FLAC codec) in both FLAC and Ogg containers (Firefox bug 1195723). Supported FLAC MIME types are: audio/flac and audio/x-flac. For FLAC in Ogg, supported MIME types are: audio/ogg; codecs=flac, and video/ogg; codecs=flac.
  • Added support for FLAC in MP4 (both with and without MSE) (Firefox bug 1303888).
  • Throttling in background tabs of timers created by {{domxref("Window.setInterval()")}}, {{domxref("WorkerGlobalScope.setInterval()")}}, {{domxref("Window.setTimeout", "setTimeout()")}} and {{domxref("WorkerGlobalScope.setTimeout", "setTimeout()")}} was changed in Firefox 50 to no longer occur if a Web Audio API {{domxref("AudioContext")}} is actively playing sound. However, this didn't resolve all scenarios in which timing-sensitive audio playback (such as music players generating individual notes using timers) could fail to work properly. For that reason, Firefox 51 no longer throttles background tabs which have an {{domxref("AudioContext")}}, even if it's not currently playing sound.

DOM

  • The {{domxref("DOMImplementation.hasFeature()")}} now returns true in all cases (Firefox bug 984778).
  • The {{domxref("HTMLInputElement")}} and {{domxref("HTMLTextAreaElement")}} properties selectionStart and selectionEnd now correctly return the current position of the text input cursor when there's no selection, instead of returning 0 (Firefox bug 1287655).
  • The {{domxref("HTMLImageElement")}} interface and the corresponding {{HTMLElement("img")}} element now support the onerror event handler, sending {{domxref("HTMLElement/error_event", "error")}} events to the element whenever errors occur attempting to load or interpret images.
  • You can now change a Web {{domxref("Animation")}}'s effect by setting the value of its {{domxref("Animation.effect", "effect")}} property. Previously, this property was read-only (Firefox bug 1049975).
  • The Permissions API method {{domxref("Permissions.revoke()")}} has been put behind a preference (dom.permissions.revoke.enable) and disabled by default since its design and even its very existence is under discussion in the Web Application Security Working Group.
  • The Storage API's {{domxref("Navigator.storage")}} property and {{domxref("StorageManager.estimate()")}} method have been implemented along with the needed supporting code. Storage unit persistence features are not yet implemented. See Firefox bug 1267941.
  • For privacy reasons, both {{domxref("BatteryManager.chargingTime")}} and {{domxref("BatteryManager.dischargingTime")}} now round the returned value to the closest 15 minutes (Firefox bug 1292655).

Events

  • Firefox now supports the {{domxref("Element/animationstart_event", "onanimationstart")}}, {{domxref("Element/animationiteration_event", "onanimationiteration")}}, and {{domxref("Element/animationend_event", "onanimationend")}} event handlers, in addition to supporting the corresponding events using {{domxref("EventTarget.addEventListener", "addEventListener()")}} (Firefox bug 911987).
  • Firefox now supports the {{domxref("Element/transitionend_event", "ontransitionend")}} event handler (Firefox bug 911987).

Security

  • When login pages (i.e., those containing an <input type="password"> field) are created so that they would be submitted insecurely, Firefox displays a crossed-out lock icon in the address bar to warn users (Firefox bug 1319119).

Removals

Changes for add-on and Mozilla developers

WebExtensions

Other

  • The multiprocessCompatible property of install.rdf must now be explicitly set to false to prevent multiprocess from being enabled in Firefox when the add-on is installed.

  • The Mozilla-specific Social API has been substantially changed (largely to remove APIs no longer used), as follows:

    • The MozSocial interface and the Navigator.mozSocial property which supports it have been removed.
    • The Social Bookmarks API has been removed.
    • The Social chat functionality has been removed.
    • The Social Status API has been removed.
    • All of the social widgets, except for the Share panel, have been removed. This includes the social sidebar, flyover panels, and so forth.
    • All supporting user interface features and functionality for the removed APIs have been removed as well.
    • Social service provider manifest properties supporting the removed functionality are no longer supported.
  • If an add-on uses mimeTypes.rdf to provide a file extension to MIME type mapping, it must now register an entry in the "ext-to-type-mapping" category (Firefox bug 306471).

  • The Browser API now includes a detail object on the event object of the mozbrowserlocationchange event that contains canGoForward/canGoBack properties, allowing retrieval of the mozBrowser's back/forward status synchronously (Firefox bug 1279635).