mozilla

版本 356579 / Site Compatibility for Firefox 19

  • 版本网址缩略名: Site_Compatibility_for_Firefox_19
  • 版本标题: Site Compatibility for Firefox 19
  • 版本 id: 356579
  • 创建于:
  • 创建者: ziyunfei
  • 是否是当前版本?
  • 评论

修订内容

{{ draft() }}

Firefox 19 Beta was released on . While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.

This article only explains the changes that may affect backward compatibility for Websites. For the other new features and changes, please read the following documents:

This list may be updated until the release of the final version, so please check back later.

CSS

flexbox脱前缀

The CSS3 flexible boxes (flexbox) implementation has been prefixed. From now on, use the related properties and keywords without moz prefix. Note that the flexbox is still disabled by default in Firefox 19. If you'd like to test the feature, open about:config and change the value of layout.css.flexbox.enabled to true.

-moz-initial属性脱前缀

The -moz-initial keyword has been unprefixed. While -moz-initial will remain in the meantime as an alias of initial, it will be removed at some time, so use the unprefixed keyword instead.

:-moz-placeholder伪类已被伪元素替代

The :-moz-placeholder pseudo-class that matches form elements with the placeholder attribute has been removed, and the ::-moz-placeholder pseudo-element has been added instead. The implementation of WebKit has been a pseudo-element, and this change is a part of the standardization effort.

带有!important的关键帧规则声明将会被忽略

Following the latest CSS3 animations spec, key frame rule declarations with the !important keyword are now be ignored and parse errors will be returned.

FYI: Preferences to disable prefixed properties have been added

While this is not a change affecting site compatibility, it's worth mentioning because this has been developed as part of efforts to keep compatibility. Preferences to disable some major prefixed properties have been added: layout.css.prefixes.border-image, layout.css.prefixes.transforms, layout.css.prefixes.transitions and layout.css.prefixes.animations. Web developers can disable those preferences (change the values to false) to test whether style rules are applied as intended even after those prefixed implementations are removed.

DOM

Element.getElementsBy* 现在将返回HTMLCollection对象

The type of element lists that can be retrieved with the getElementsByTagName, getElementsByTagNameNS and getElementsByClassName methods have been changed from NodeList, defined in the DOM3 Core spec, to HTMLCollection, defined in the DOM4 spec draft.

hasFeature/isSupported方法现在总会返回true

The document.implementation.hasFeature and Element.isSupported methods have been changed to always return true. The spec has been changed because those APIs were considered useless. However the SVG features are exception; those methods continue to return the support statuses.

createElement(null)不再抛出异常

Previously the document.createElement method has thrown exception INVALID_CHARACTER_ERR if the argument was null. The method now returns the HTMLUnknownElement object because the argument should be treated as a string and considered to be the same code as document.createElement("null").

The implementation of document.referrer has been updated for the latest spec

When the URL of a nested inline frame (iframe) or a grandchild window is programmatically changed from the parent window, the value of the document.referrer property now points the URL of the parent window where the script is written instead of the child window that refers directly. This is due to a change of the spec and leads to the same behavior as Internet Explorer and Opera. WebKit to follow.

如果修改日期未知,则File.lastModifiedDate属性将返回当前日期

Following the latest File API spec, the lastModifiedDate property of a File object now returns the current date if the file's last modified date is unknown. Previously it returns null in such case.

The Encoding API has been updated for the latest spec

Following a change of the Encoding API spec, the implementation of TextEncoder and TextDecoder has been updated.

移除XForms支持

The XML Events implementation has been removed. The development of the Mozilla XForms extension that has used the API has been practically discontinued. The XForms accessibility support has also been removed from Firefox 19.

JavaScript

Map.sizeSet.size从方法变成属性

The size method, that returns the number of key/value pairs saved in a Map object and the number of values saved in a Set object, are changed to be read-only properties.

事件处理

Some event attributes are now limited to body and frameset

Previously, the onbeforeunload attribute has been recognized even if it has been set on any elements, and the named handler is called when the event is fired. To comply with the spec, it's now ignored when it has been set on elements other than body and frameset. The other attributes treated the same include onafterprint, onbeforeprint, onhashchange, onoffline, ononline, onpagehide, onpageshow, onpopstate, onresize and onunload.

文件处理

The Content-Disposition header's name parameter is no longer supported

The name parameter included in the HTTP Content-Disposition header used for file downloading is now ignored. This parameter is non-standard and supported only by Firefox and Google Chrome. From now, use the standard filename parameter instead.

插件

Carbon NPAPI Support has been dropped

The Carbon event model and the Quickdraw drawing model, deprecated since Firefox 4, are no longer available. Webmasters should make sure your content works well if it requires any special plug-in. If it doesn't work on Firefox 19, please contact the plug-in vendor.

修订版来源

<p>{{ draft() }}</p>
<p>Firefox&nbsp;19 <a href="http://www.mozilla.org/en-US/firefox/beta/">Beta</a> was released on <time datetime="2013-01-10">January 10</time>. While it has been developed to maintain compatibility as much as possible, the new version includes some changes affecting backward compatibility aimed at improving interoperability with the other browsers or following the latest Web standards. Here's the list of such changes — Hope this helps whenever you test your sites or applications.</p>
<p><strong>This article only explains the changes that may affect backward compatibility for Websites</strong>. For the other new features and changes, please read the following documents:</p>
<ul>
  <li><a href="http://www.mozilla.org/en-US/firefox/19.0beta/releasenotes/">Firefox&nbsp;19 Beta Release Notes</a></li>
  <li><a href="/en-US/docs/Firefox_19_for_developers">Firefox&nbsp;19 for developers</a> (some changes are not listed yet)</li>
  <li>Add-on Compatibility for Firefox&nbsp;19 (Add-ons Blog)</li>
</ul>
<p>This list may be updated until the release of the final version, so please check back later.</p>
<section id="sect21">
  <h2 id="CSS">CSS</h2>
  <section id="sect22">
    <h3 id="The_flexbox_has_been_unprefixed">flexbox脱前缀</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801098">Bug&nbsp;801098 – Unprefix CSS3 flexbox</a></li>
    </ul>
    <p>The <a href="/en-US/docs/CSS/Using_CSS_flexible_boxes">CSS3 flexible boxes (flexbox)</a> implementation has been prefixed. From now on, use the related properties and keywords without <code>moz</code> prefix. Note that the flexbox is still disabled by default in Firefox&nbsp;19. If you'd like to test the feature, open <code>about:config</code> and change the value of <code>layout.css.flexbox.enabled</code> to <code>true</code>.</p>
  </section>
  <section id="sect23">
    <h3 id="-moz-initial_has_been_unprefixed"><code>-moz-initial</code>属性脱前缀</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=806068">Bug&nbsp;806068 – Unprefix -moz-initial</a></li>
    </ul>
    <p>The <code>-moz-initial</code> keyword has been unprefixed. While <code>-moz-initial</code> will remain in the meantime as an alias of <a href="/en-US/docs/CSS/initial"><code>initial</code></a>, it will be <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807184">removed at some time</a>, so use the unprefixed keyword instead.</p>
  </section>
  <section id="sect24">
    <h3 id="The_.3A-moz-placeholder_pseudo-class_has_been_replaced_with_the_pseudo-element"><code>:-moz-placeholder</code>伪类已被伪元素替代</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=737786">Bug&nbsp;737786 – Switch from :-moz-placeholder to ::-moz-placeholder (pseudo-class to pseudo-element)</a></li>
    </ul>
    <p>The <a href="/en-US/docs/CSS/:-moz-placeholder"><code>:-moz-placeholder</code></a> pseudo-class that matches form elements with the <a href="/en-US/docs/HTML/Forms_in_HTML#The_placeholder_attribute"><code>placeholder</code></a> attribute has been removed, and the <a href="/en-US/docs/CSS/::-moz-placeholder"><code>::-moz-placeholder</code></a> pseudo-element has been added instead. The implementation of WebKit has been a pseudo-element, and this change is a part of the standardization effort.</p>
  </section>
  <section id="sect25">
    <h3 id="Key_frame_rule_declarations_with_!important_will_be_ignored"><code>带有!important</code>的关键帧规则声明将会被忽略</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=784466">Bug&nbsp;784466 – [css3-animations] we should drop declarations in keyframe rules that have !important</a></li>
    </ul>
    <p>Following the latest <a href="/en-US/docs/CSS/Using_CSS_animations">CSS3 animations</a> spec, key frame rule declarations with the <code>!important</code> keyword are now be ignored and parse errors will be returned.</p>
  </section>
  <section id="sect26">
    <h3 id="FYI.3A_Preferences_to_disable_prefixed_properties_have_been_added">FYI: Preferences to disable prefixed properties have been added</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=804944">Bug&nbsp;804944 – add preferences for sets of CSS prefixed properties</a></li>
    </ul>
    <p>While this is not a change affecting site compatibility, it's worth mentioning because this has been developed as part of efforts to keep compatibility. Preferences to disable some major prefixed properties have been added: <code>layout.css.prefixes.border-image</code>, <code>layout.css.prefixes.transforms</code>, <code>layout.css.prefixes.transitions</code> and <code>layout.css.prefixes.animations</code>. Web developers can disable those preferences (change the values to <code>false</code>) to test whether style rules are applied as intended even after those prefixed implementations are removed.</p>
  </section>
</section>
<section id="sect27">
  <h2 id="DOM">DOM</h2>
  <section id="sect28">
    <h3 id="Element.getElementsBy*_now_returns_HTMLCollection"><code>Element.getElementsBy*</code> 现在将返回<code>HTMLCollection对象</code></h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=799464">Bug&nbsp;799464 – Make Element.getElementsBy* return HTMLCollection</a></li>
    </ul>
    <p>The type of element lists that can be retrieved with the <a href="/en-US/docs/DOM/element.getElementsByTagName"><code>getElementsByTagName</code></a>, <a href="/en-US/docs/DOM/element.getElementsByTagNameNS"><code>getElementsByTagNameNS</code></a> and <a href="/en-US/docs/DOM/document.getElementsByClassName"><code>getElementsByClassName</code></a> methods have been changed from <a href="/en-US/docs/DOM/NodeList"><code>NodeList</code></a>, defined in the DOM3 Core spec, to <a href="/en-US/docs/DOM/HTMLCollection"><code>HTMLCollection</code></a>, defined in the DOM4 spec draft.</p>
  </section>
  <section id="sect29">
    <h3 id="hasFeature.2FisSupported_methods_now_always_return_true"><code>hasFeature</code>/<code>isSupported</code>方法现在总会返回<code>true</code></h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801425">Bug&nbsp;801425 – Make hasFeature() and isSupported() always return true</a></li>
    </ul>
    <p>The <code><a href="/en-US/docs/DOM/document.implementation">document.implementation</a>.hasFeature</code> and <a href="/en-US/docs/DOM/Node.isSupported"><code>Element.isSupported</code></a> methods have been changed to always return <code>true</code>. The spec has been changed because those APIs were considered useless. However the SVG features are exception; those methods continue to return the support statuses.</p>
  </section>
  <section id="sect30">
    <h3 id="createElement(null)_no_longer_throws_exceptions"><code>createElement(null)</code>不再抛出异常</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=802562">Bug&nbsp;802562 – createElement(null) should work like createElement("null")</a></li>
    </ul>
    <p>Previously the <a href="/en-US/docs/DOM/document.createElement"><code>document.createElement</code></a> method has thrown exception <code>INVALID_CHARACTER_ERR</code> if the argument was <code>null</code>. The method now returns the <code>HTMLUnknownElement</code> object because the argument should be treated as a string and considered to be the same code as <code>document.createElement("null")</code>.</p>
  </section>
  <section id="sect31">
    <h3 id="The_implementation_of_document.referrer_has_been_updated_for_the_latest_spec">The implementation of <code>document.referrer</code> has been updated for the latest spec</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809290">Bug&nbsp;809290 – document.referrer should be based on the script entry point</a></li>
    </ul>
    <p>When the URL of a nested inline frame (<code>iframe</code>) or a grandchild window is programmatically changed from the parent window, the value of the <a href="/en-US/docs/DOM/document.referrer"><code>document.referrer</code></a> property now points the URL of the parent window where the script is written instead of the child window that refers directly. This is due to a change of the spec and leads to the same behavior as Internet Explorer and Opera. WebKit to follow.</p>
  </section>
  <section id="sect32">
    <h3 id="File.lastModifiedDate_now_returns_the_current_date_if_the_modified_date_is_unknown"><code>如果修改日期未知,则File.lastModifiedDate</code>属性将返回当前日期</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793459">Bug&nbsp;793459 – Update File.lastModifiedDate to latest spec</a></li>
    </ul>
    <p>Following the latest <a href="http://www.w3.org/TR/FileAPI/">File API</a> spec, the <code>lastModifiedDate</code> property of a <a href="/en-US/docs/DOM/File"><code>File</code></a> object now returns the current date if the file's last modified date is unknown. Previously it returns <code>null</code> in such case.</p>
  </section>
  <section id="sect33">
    <h3 id="The_Encoding_API_has_been_updated_for_the_latest_spec">The Encoding API has been updated for the latest spec</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=801487">Bug&nbsp;801487 – Update StringEncoding API per the latest spec and fix some bugs</a></li>
    </ul>
    <p>Following a change of the <a href="http://encoding.spec.whatwg.org/#api">Encoding API</a> spec, the implementation of <code>TextEncoder</code> and <code>TextDecoder</code> has been updated.</p>
  </section>
  <section id="sect34">
    <h3 id="XForms_support_has_been_removed">移除XForms支持</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=656311">Bug&nbsp;656311 – Remove XML Events, or improve the implementation</a></li>
    </ul>
    <p>The XML Events implementation has been removed. The development of the <a href="https://addons.mozilla.org/en-US/firefox/addon/mozilla-xforms/">Mozilla XForms</a> extension that has used the API has been <a href="http://www.philipp-wagner.com/blog/2011/07/the-future-of-mozilla-xforms/">practically discontinued</a>. The <a href="/en-US/docs/XForms">XForms</a> accessibility support has also been <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=811729">removed</a> from Firefox&nbsp;19.</p>
  </section>
</section>
<section id="sect35">
  <h2 id="JavaScript">JavaScript</h2>
  <section id="sect36">
    <h3 id="Map.size_and_Set.size_have_been_changed_to_properties"><code>Map.size</code>和<code>Set.size</code>从方法变成属性</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=807001">Bug&nbsp;807001 – Map.prototype.size and Set.prototype.size should be accessor properties</a></li>
    </ul>
    <p>The <code>size</code> method, that returns the number of key/value pairs saved in a <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Map"><code>Map</code></a> object and the number of values saved in a <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Set"><code>Set</code></a> object, are changed to be read-only properties.</p>
  </section>
</section>
<section id="sect37">
  <h2 id="Event_Handling">事件处理</h2>
  <section id="sect38">
    <h3 id="Some_event_attributes_are_now_limited_to_body_and_frameset">Some event attributes are now limited to <code>body</code> and <code>frameset</code></h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=809765">Bug&nbsp;809765 – Stop compiling the beforeunload attribute into an event handler on elements other than &lt;body&gt; and &lt;frameset&gt;</a></li>
    </ul>
    <p>Previously, the <a href="/en-US/docs/DOM/window.onbeforeunload"><code>onbeforeunload</code></a> attribute has been recognized even if it has been set on any elements, and the named handler is called when the event is fired. To comply with the spec, it's now ignored when it has been set on elements other than <a href="/en-US/docs/HTML/Element/body"><code>body</code></a> and <a href="/en-US/docs/HTML/Element/frameset"><code>frameset</code></a>. The other attributes treated the same include <a href="/en-US/docs/DOM/window.onafterprint"><code>onafterprint</code></a>, <a href="/en-US/docs/DOM/window.onbeforeprint"><code>onbeforeprint</code></a>, <a href="/en-US/docs/DOM/window.onhashchange"><code>onhashchange</code></a>, <code>onoffline</code>, <code>ononline</code>, <code>onpagehide</code>, <code>onpageshow</code>, <a href="/en-US/docs/DOM/window.onpopstate"><code>onpopstate</code></a>, <a href="/en-US/docs/DOM/window.onresize"><code>onresize</code></a> and <a href="/en-US/docs/DOM/window.onunload"><code>onunload</code></a>.</p>
  </section>
</section>
<section id="sect39">
  <h2 id="File_Handling">文件处理</h2>
  <section id="sect40">
    <h3 id="The_Content-Disposition_header's_name_parameter_is_no_longer_supported">The <code>Content-Disposition</code> header's <code>name</code> parameter is no longer supported</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776339">Bug&nbsp;776339 – remove support of Content-Disposition "name" parameter</a></li>
    </ul>
    <p>The <code>name</code> parameter included in the HTTP <code>Content-Disposition</code> header used for file downloading is now ignored. This parameter is non-standard and supported only by Firefox and Google Chrome. From now, use the standard <code>filename</code> parameter instead.</p>
  </section>
</section>
<section id="sect41">
  <h2 id="Plug-ins">插件</h2>
  <section id="sect42">
    <h3 id="Carbon_NPAPI_Support_has_been_dropped">Carbon NPAPI Support has been dropped</h3>
    <ul>
      <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=598397">Bug&nbsp;598397 - remove support for Carbon NPAPI</a></li>
    </ul>
    <p>The Carbon event model and the Quickdraw drawing model, deprecated since Firefox&nbsp;4, are no longer available. Webmasters should make sure your content works well if it requires any special plug-in. If it doesn't work on Firefox&nbsp;19, please contact the plug-in vendor.</p>
  </section>
</section>
恢复到这个版本