Firefox 21 for developers

  • Revision slug: Mozilla/Firefox/Releases/21
  • Revision title: Firefox 21 for developers
  • Revision id: 453053
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Firefox 21 was released on May 14, 2013. 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

HTML

  • The {{htmlattrxref("scoped", "style")}} attribute has been added to the {{HTMLElement("style")}} element. It allows to include styles that are isolated from the rest of the document. Such styles can be selected using the {{cssxref(":scope")}} CSS pseudo-element introduced in Firefox 20. ({{bug("508725")}}).
  • The new HTML {{HTMLElement("main")}} element has been implemented ({{bug("820508")}}).

JavaScript

  • E4X, an ancient JavaScript extension, has been removed. Implemented only in Gecko, it never got significant traction ({{bug("788293")}}).
  • parseInt no longer treats strings with leading "0" as octal ({{bug("786135")}}).

CSS

  • The none value of {{cssxref("user-select", "-moz-user-select")}} has now the same behavior than the -moz-none value, aligning Gecko on WebKit (Chrome, Safari), Presto (Opera) and Trident (Internet Explorer) ({{bug("816298")}}).
  • On XHTML content, the auto value of {{cssxref("hyphens", "-moz-hyphens")}} incorrectly applied hyphenation rules when the language was not explicitly declared. This is fixed by ({{bug("702121")}}).
  • An auto value has been added to the CSS {{cssxref("-moz-orient")}} property. The auto value is equivalent to horizontal when applied to {{HTMLElement("meter")}} and {{HTMLElement("progress")}} ({{bug("835883")}}).

DOM

  • The origin property has been added to the {{domxref("window.location")}} ({{bug("828261")}}).
  • The valueAsDate and valueAsNumber methods have been added for <input type="time"> ({{bug("781570")}}).
  • The min and max attributes now apply to <input type="time"> too ({{bug("781572")}}).
  • Some new keyCodes for volume control are supported ({{bug("674739")}}).
  • Some new keyCodes for ancient keyboard layout such as AS/400 are now supported on Windows and Linux ({{bug("833719")}}).
  • Various keyCode values for OEM sepecific keys on Windows are now supported again ({{bug("833719")}}).
  • The function window.crypto.getRandomValues has been implemented ({{bug("440046")}}).
  • CSSOM: the method {{domxref("CSSKeyframesRule")}}.insertRule has been removed to {{domxref("CSSKeyframesRule")}}.appendRule to match a spec change ({{bug("841896")}}).

SVG

  • The paint-order attribute has been implemented ({{bug("828805")}}).

Networking

  • We continue to update our CSP implementation to match the CSP 1.0 spec, which reached Candidate Recommendation:
    • Support for the spec-compliant Content-Security-Policy HTTP header (in addition to the experimental X-Content-Security-Policy) has been added ({{bug("783049")}}). Note: the patch for this new header landed in Firefox 21, it is disabled on builds ({{bug("842657")}}).

Worker

  • The functions {{domxref("window.URL.createObjectURL", "URL.createObjectURL")}} and {{domxref("window.URL.revokeObjectURL", "URL.revokeObjectURL")}} are now included in the set of functions available to workers.

Changes for add-on and Mozilla developers

  • FUEL applications cannot use the Livemarks service anymore ({{bug("834492")}}). The Livemarks service is deprecated and phased out in favor of the new async interface.
  • resource:///modules/ and resource://gre/modules/ are no longer identical ({{bug("755724")}}). This change was made because of work on the metro version of Firefox. If you load modules using resource:///modules/, you should check if you now want to use resource://gre/modules/ instead. Note that some modules also moved from Firefox to Toolkit ({{bug("840287")}} and {{bug("811548")}} moved NewTabUtils.jsm and the thumbnail modules, respectively).
  • The Add-on SDK is now included in Firefox ({{bug("731779")}})
  • History API saw numerous deprecated API being removed:
    • Replaced by mozIAsyncFavicons:
      • nsIFaviconService::setFaviconUrlForPage
      • nsIFaviconService::setFaviconData
      • nsIFaviconService::getFaviconData
      • nsIFaviconService::getFaviconForPage
      • nsIFaviconService::setAndLoadFaviconForPage
      • nsIFaviconService::getFaviconImageForPage
      • nsIFaviconService::getFaviconDataAsDataURL
    • Replaced by mozIAsyncLivemarks:
      • nsILivemarkService::*
      • PlacesUtils.itemIsLivemark
      • PlacesUtils.nodeIsLivemarkContainer
      • PlacesUtils.nodeIsLivemarkItem
    • Removed only third argument:
      • PlacesUIUtils.showBookmarkDialog
    • No more implemented by Places, use mozIAsyncHistory instead:
      • nsIGlobalHistory2::addURI
      • nsIGlobalHistory2::isVisited
      • nsIGlobalHistory2::setPageTitle
    • No more needed, use onDeleteURI or onItemRemoved:
      • nsINavHistoryObserver::OnBeforeDeleteURI
      • nsINavBookmarkObserver::OnBeforeItemRemoved
    • Never implemented properly:
      • nsINavHistoryFullVisitResultNode
    • Deprecated, use mozIAsyncHistory::updatePlaces instead:
      • nsINavHistoryService::AddVisit
  • Added {{ interface-method("nsIHttpChannel", "redirectTo") }} to enable redirecting HTTP channels without fragile hacks.

See also

Older versions

{{Firefox_for_developers('20')}}

Revision Source

<p>Firefox 21 was released on May 14, 2013. 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.</p>
<h2 id="Changes_for_Web_developers">Changes for Web developers</h2>
<h3 id="HTML">HTML</h3>
<ul>
  <li>The {{htmlattrxref("scoped", "style")}} attribute has been added to the {{HTMLElement("style")}} element. It allows to include styles that are isolated from the rest of the document. Such styles can be selected using the {{cssxref(":scope")}} CSS pseudo-element introduced in Firefox 20. ({{bug("508725")}}).</li>
  <li>The new HTML {{HTMLElement("main")}} element has been implemented ({{bug("820508")}}).</li>
</ul>
<h3 id="JavaScript">JavaScript</h3>
<ul>
  <li><a href="/en-US/docs/E4X" title="E4X">E4X</a>, an ancient JavaScript extension, has been removed. Implemented only in Gecko, it never got significant traction ({{bug("788293")}}).</li>
  <li><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt" title="">parseInt</a> no longer treats strings with leading "0" as octal ({{bug("786135")}}).</li>
</ul>
<h3 id="CSS">CSS</h3>
<ul>
  <li>The <code>none</code> value of {{cssxref("user-select", "-moz-user-select")}} has now the same behavior than the <code>-moz-none</code> value, aligning Gecko on WebKit (Chrome, Safari), Presto (Opera) and Trident (Internet Explorer) ({{bug("816298")}}).</li>
  <li>On XHTML content, the <code>auto</code> value of {{cssxref("hyphens", "-moz-hyphens")}} incorrectly applied hyphenation rules when the language was not explicitly declared. This is fixed by ({{bug("702121")}}).</li>
  <li>An <code>auto</code> value has been added to the CSS {{cssxref("-moz-orient")}} property. The <code>auto</code> value is equivalent to <code>horizontal</code> when applied to {{HTMLElement("meter")}} and {{HTMLElement("progress")}} ({{bug("835883")}}).</li>
</ul>
<h3 id="DOM">DOM</h3>
<ul>
  <li>The <code>origin</code> property has been added to the {{domxref("window.location")}} ({{bug("828261")}}).</li>
  <li>The <code>valueAsDate</code> and <code>valueAsNumber</code> methods have been added for <code>&lt;input type="time"&gt;</code> ({{bug("781570")}}).</li>
  <li>The <code>min</code> and <code>max</code> attributes now apply to <code>&lt;input type="time"&gt;</code> too ({{bug("781572")}}).</li>
  <li>Some new keyCodes for volume control are supported ({{bug("674739")}}).</li>
  <li>Some new keyCodes for ancient keyboard layout such as AS/400 are now supported on Windows and Linux ({{bug("833719")}}).</li>
  <li>Various keyCode values for OEM sepecific keys on Windows are now supported again ({{bug("833719")}}).</li>
  <li>The function <a href="/en-US/docs/DOM/window.crypto.getRandomValues" title="DOM/window.crypto.getRandomValues"><code>window.crypto.getRandomValues</code></a> has been implemented ({{bug("440046")}}).</li>
  <li>CSSOM: the method {{domxref("CSSKeyframesRule")}}<code>.insertRule</code> has been removed to {{domxref("CSSKeyframesRule")}}<code>.appendRule</code> to match a spec change ({{bug("841896")}}).</li>
</ul>
<h3 id="SVG">SVG</h3>
<ul>
  <li>The <a href="/en-US/docs/Web/SVG/Attribute/paint-order" title="/en-US/docs/Web/SVG/Attribute/paint-order">paint-order</a> attribute has been implemented ({{bug("828805")}}).</li>
</ul>
<h3 id="Networking">Networking</h3>
<ul>
  <li>We continue to update our CSP implementation to match the CSP 1.0 spec, which reached Candidate Recommendation:
    <ul>
      <li>Support for the spec-compliant <span id="summary_alias_container"><span id="short_desc_nonedit_display"><code>Content-Security-Policy</code> HTTP header (in addition to the experimental </span></span><span id="summary_alias_container"><span id="short_desc_nonedit_display"><code>X-Content-Security-Policy</code>) has been added ({{bug("783049")}}). <strong>Note</strong>: the patch for this new header landed in Firefox 21, it is disabled on builds</span></span> ({{bug("842657")}}).</li>
    </ul>
  </li>
</ul>
<h3 id="Worker">Worker</h3>
<ul>
  <li>The functions {{domxref("window.URL.createObjectURL", "URL.createObjectURL")}} and {{domxref("window.URL.revokeObjectURL", "URL.revokeObjectURL")}} are now included in the set of <a href="/en-US/docs/DOM/Worker/Functions_available_to_workers" title="DOM/Worker/Functions_available_to_workers">functions available to workers</a>.</li>
</ul>
<h2 id="Changes_for_add-on_and_Mozilla_developers">Changes for add-on and Mozilla developers</h2>
<ul>
  <li>FUEL applications cannot use the Livemarks service anymore ({{bug("834492")}}). The Livemarks service is deprecated and phased out in favor of the new async interface.</li>
  <li><code>resource:///modules/</code> and <code>resource://gre/modules/</code> are no longer identical ({{bug("755724")}}). This change was made because of work on the metro version of Firefox. If you load modules using <code>resource:///modules/</code>, you should check if you now want to use <code>resource://gre/modules/</code> instead. Note that some modules also moved from Firefox to Toolkit ({{bug("840287")}} and {{bug("811548")}} moved <code>NewTabUtils.jsm</code> and the thumbnail modules, respectively).</li>
  <li>The Add-on SDK is now included in Firefox ({{bug("731779")}})</li>
  <li>History API saw numerous deprecated API being removed:
    <ul>
      <li>Replaced by <code>mozIAsyncFavicons</code>:
        <ul>
          <li><code>nsIFaviconService::setFaviconUrlForPage</code></li>
          <li><code>nsIFaviconService::setFaviconData</code></li>
          <li><code>nsIFaviconService::getFaviconData</code></li>
          <li><code>nsIFaviconService::getFaviconForPage</code></li>
          <li><code>nsIFaviconService::setAndLoadFaviconForPage</code></li>
          <li><code>nsIFaviconService::getFaviconImageForPage</code></li>
          <li><code>nsIFaviconService::getFaviconDataAsDataURL</code></li>
        </ul>
      </li>
      <li>Replaced by <code>mozIAsyncLivemarks</code>:
        <ul>
          <li><code>nsILivemarkService::*</code></li>
          <li><code>PlacesUtils.itemIsLivemark</code></li>
          <li><code>PlacesUtils.nodeIsLivemarkContainer</code></li>
          <li><code>PlacesUtils.nodeIsLivemarkItem</code></li>
        </ul>
      </li>
      <li>Removed only third argument:
        <ul>
          <li><code>PlacesUIUtils.showBookmarkDialog</code></li>
        </ul>
      </li>
      <li>No more implemented by Places, use <code>mozIAsyncHistory</code> instead:
        <ul>
          <li><code>nsIGlobalHistory2::addURI</code></li>
          <li><code>nsIGlobalHistory2::isVisited</code></li>
          <li><code>nsIGlobalHistory2::setPageTitle</code></li>
        </ul>
      </li>
      <li>No more needed, use <code>onDeleteURI</code> or <code>onItemRemoved</code>:
        <ul>
          <li><code>nsINavHistoryObserver::OnBeforeDeleteURI</code></li>
          <li><code>nsINavBookmarkObserver::OnBeforeItemRemoved</code></li>
        </ul>
      </li>
      <li>Never implemented properly:
        <ul>
          <li><code>nsINavHistoryFullVisitResultNode</code></li>
        </ul>
      </li>
      <li>Deprecated, use<code> mozIAsyncHistory::updatePlaces</code> instead:
        <ul>
          <li><code>nsINavHistoryService::AddVisit</code></li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Added {{ interface-method("nsIHttpChannel", "redirectTo") }} to enable redirecting HTTP channels without fragile hacks.</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="http://www.mozilla.org/en-US/firefox/21.0/releasenotes/">Firefox 21 Release Notes</a></li>
  <li><a href="/en-US/docs/Site_Compatibility_for_Firefox_21">Site Compatibility for Firefox 21</a></li>
  <li><a href="https://blog.mozilla.org/addons/2013/04/26/compatibility-for-firefox-21/">Add-on Compatibility for Firefox 21</a></li>
</ul>
<h3 id="Older_versions">Older versions</h3>
<div>
  {{Firefox_for_developers('20')}}</div>
Revert to this revision