Merge the last PGO-green inbound changeset to m-c.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 14 May 2013 16:16:12 -0400
changeset 131914 26ab72bfa9df71f0cf25b0127e5ed4d9fce86201
parent 131913 1ff1f234ed00718b3cf3ac504099ea66e35ed08c (current diff)
parent 131883 e2b5196a15d64b055a07b7c0aa0dc1921ab439ba (diff)
child 131915 975667697d0b6a9997daace037f480e3a626d8c1
child 131959 6d983f52ee8775a376f8e8e7e123dd4bd7892d40
push id28030
push userryanvm@gmail.com
push dateTue, 14 May 2013 21:14:29 +0000
treeherdermozilla-inbound@975667697d0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone24.0a1
first release with
nightly linux32
26ab72bfa9df / 24.0a1 / 20130515031027 / files
nightly linux64
26ab72bfa9df / 24.0a1 / 20130515031027 / files
nightly mac
26ab72bfa9df / 24.0a1 / 20130515031027 / files
nightly win32
26ab72bfa9df / 24.0a1 / 20130515031027 / files
nightly win64
26ab72bfa9df / 24.0a1 / 20130515031027 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge the last PGO-green inbound changeset to m-c.
--- a/browser/metro/base/content/appbar.js
+++ b/browser/metro/base/content/appbar.js
@@ -172,16 +172,21 @@ var Appbar = {
       if (!event.defaultPrevented) {
         activeTileset.clearSelection();
         this.appbar.dismiss();
       }
     }
   },
 
   showContextualActions: function(aVerbs) {
+    if (aVerbs.length)
+      this.appbar.setAttribute("contextual", "true");
+    else
+      this.appbar.removeAttribute("contextual");
+
     let doc = document;
     // button element id to action verb lookup
     let buttonsMap = new Map();
     for (let verb of aVerbs) {
       let id = verb + "-selected-button";
       if (!doc.getElementById(id)) {
         throw new Error("Appbar.showContextualActions: no button for " + verb);
       }
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -188,77 +188,16 @@
                 observes="bcast_preciseInput"
                 onselect="BrowserUI.selectTabAndDismiss(this);"
                 onclosetab="BrowserUI.closeTab(this);"/>
           <vbox id="tabs-controls">
             <toolbarbutton id="newtab-button" command="cmd_newTab" label="&newtab.label;"/>
           </vbox>
         </hbox>
 
-        <!-- Main Toolbar -->
-        <hbox id="toolbar-container" observes="bcast_windowState" >
-          <toolbar id="toolbar" flex="1">
-            <observes element="bcast_windowState" attribute="*"/>
-            <observes element="bcast_urlbarState" attribute="*"/>
-            <hbox id="unified-back-forward-button" class="chromeclass-toolbar-additional"
-               observes="bcast_windowState"
-               context="backForwardMenu" removable="true"
-               forwarddisabled="true"
-               title="Back/Forward">
-              <toolbarbutton id="back-button" class="toolbarbutton"
-                             label="&back.label;"
-                             command="cmd_back"/>
-              <toolbarbutton id="forward-button" class="toolbarbutton"
-                             label="&forward.label;"
-                             command="cmd_forward"/>
-              <dummyobservertarget hidden="true"
-                                   onbroadcast="if (this.getAttribute('disabled') == 'true')
-                                                  this.parentNode.setAttribute('forwarddisabled', 'true');
-                                                else
-                                                  this.parentNode.removeAttribute('forwarddisabled');">
-                <observes element="cmd_forward" attribute="disabled"/>
-              </dummyobservertarget>
-            </hbox>
-
-            <hbox id="urlbar-container" flex="1" observes="bcast_urlbarState">
-              <hbox id="urlbar" flex="1">
-                <box id="identity-box" role="button">
-                  <hbox id="identity-box-inner" align="center" mousethrough="always">
-                    <image id="identity-icon"/>
-                  </hbox>
-                </box>
-
-                <textbox id="urlbar-edit"
-                         type="url"
-                         class="uri-element"
-                         autocompletesearch="history"
-                         autocompletepopup="start-autocomplete"
-                         completeselectedindex="true"
-                         placeholder="&urlbar.emptytext;"
-                         flex="1"
-                         ontextentered="BrowserUI.handleUrlbarEnter(param);"
-                         onkeydown="BrowserUI.navEditKeyPress();"
-                         onclick="BrowserUI._urlbarClicked(event);"
-                         onblur="BrowserUI._urlbarBlurred();"/>
-              </hbox>
-            </hbox>
-
-            <hbox id="urlbar-icons" observes="bcast_urlbarState">
-              <toolbarbutton id="tool-reload" oncommand="CommandUpdater.doCommand(event.shiftKey ? 'cmd_forceReload' : 'cmd_reload');"/>
-              <toolbarbutton id="tool-stop" command="cmd_stop"/>
-            </hbox>
-          </toolbar>
-
-          <box id="toolbar-transition" observes="bcast_windowState" >
-            <toolbarbutton id="tool-new-tab" command="cmd_newTab" label="&newtab.label;"/>
-          </box>
-        </hbox>
-
-        <hbox id="progress-control" layer="true"></hbox>
-
         <!-- Start UI -->
         <hbox id="start-container" flex="1" observes="bcast_windowState" class="meta content-height content-width" onclick="false;">
           <!-- portrait/landscape/filled view -->
           <hbox id="start" class="start-page" flex="1" observes="bcast_windowState">
             <scrollbox id="start-scrollbox" orient="horizontal" flex="1">
             <vbox id="start-topsites" class="meta-section">
               <label class="meta-section-title" value="&startTopSitesHeader.label;"/>
               <richgrid id="start-topsites-grid" rows="3" columns="3" seltype="multiple" flex="1"/>
@@ -362,35 +301,71 @@
 
           <richlistbox id="console-box" class="panel-list console-box" flex="1" onkeypress="ConsolePanelView.onConsoleBoxKeyPress(event)" oncontextmenu="ConsolePanelView.onContextMenu(event);"/>
         </vbox>
       </deck>
     </vbox>
 
     <!-- Windows 8 Appbar -->
     <appbar id="appbar" mousethrough="never" observes="bcast_windowState">
-      <hbox id="contextualactions-tray" flex="1">
+      <hbox id="progress-control" layer="true"/>
+
+      <!-- Main Toolbar -->
+      <toolbar id="toolbar" observes="bcast_windowState" flex="1">
+        <observes element="bcast_windowState" attribute="*"/>
+        <observes element="bcast_urlbarState" attribute="*"/>
+
+        <toolbarbutton id="back-button" command="cmd_back"/>
+
+        <hbox id="urlbar-container" flex="1" observes="bcast_urlbarState">
+          <toolbarbutton id="forward-button" command="cmd_forward"/>
+          <hbox id="urlbar" flex="1">
+            <box id="identity-box" role="button">
+              <hbox id="identity-box-inner" align="center" mousethrough="always">
+                <image id="identity-icon"/>
+              </hbox>
+            </box>
+
+            <textbox id="urlbar-edit"
+                     type="url"
+                     class="uri-element"
+                     autocompletesearch="history"
+                     autocompletepopup="start-autocomplete"
+                     completeselectedindex="true"
+                     placeholder="&urlbar.emptytext;"
+                     flex="1"
+                     ontextentered="BrowserUI.handleUrlbarEnter(param);"
+                     onkeydown="BrowserUI.navEditKeyPress();"
+                     onclick="BrowserUI._urlbarClicked(event);"
+                     onblur="BrowserUI._urlbarBlurred();"/>
+          </hbox>
+        </hbox>
+
+        <toolbarbutton id="tool-reload" oncommand="CommandUpdater.doCommand(event.shiftKey ? 'cmd_forceReload' : 'cmd_reload');"/>
+        <toolbarbutton id="tool-stop" command="cmd_stop"/>
+
+        <!-- developer buttons -->
+        <toolbarbutton id="console-button" oncommand="Appbar.onConsoleButton()"/>
+        <toolbarbutton id="jsshell-button" oncommand="Appbar.onJSShellButton()"/>
+
+        <toolbarbutton id="download-button" oncommand="Appbar.onDownloadButton()"/>
+        <toolbarbutton id="zoomout-button" oncommand="Appbar.onZoomOutButton()"/>
+        <toolbarbutton id="zoomin-button" oncommand="Appbar.onZoomInButton()"/>
+        <toolbarbutton id="star-button" type="checkbox" oncommand="Appbar.onStarButton()"/>
+        <toolbarbutton id="pin-button" type="checkbox" oncommand="Appbar.onPinButton()"/>
+        <toolbarbutton id="more-button" onclick="Appbar.onMoreButton(event)"/>
+      </toolbar>
+
+      <toolbar id="contextualactions-tray" flex="1">
         <toolbarbutton id="delete-selected-button" hidden="true" fade="true" oncommand="Appbar.dispatchContextualAction('delete')"/>
         <toolbarbutton id="restore-selected-button" hidden="true" fade="true" oncommand="Appbar.dispatchContextualAction('restore')"/>
         <toolbarbutton id="pin-selected-button" hidden="true" fade="true" oncommand="Appbar.dispatchContextualAction('pin')"/>
         <toolbarbutton id="unpin-selected-button" hidden="true" fade="true" oncommand="Appbar.dispatchContextualAction('unpin')"/>
         <toolbarbutton id="clear-selected-button" hidden="true" fade="true" oncommand="Appbar.dispatchContextualAction('clear')"/>
-      </hbox>
-      <hbox flex="1">
-        <toolbarbutton id="download-button" oncommand="Appbar.onDownloadButton()"/>
-        <toolbarbutton id="console-button" oncommand="Appbar.onConsoleButton()"/>
-        <toolbarbutton id="jsshell-button" oncommand="Appbar.onJSShellButton()"/>
-      </hbox>
-      <hbox>
-        <toolbarbutton id="more-button" onclick="Appbar.onMoreButton(event)" />
-        <toolbarbutton id="zoomout-button" oncommand="Appbar.onZoomOutButton()"/>
-        <toolbarbutton id="zoomin-button" oncommand="Appbar.onZoomInButton()"/>
-        <toolbarbutton id="star-button" type="checkbox" oncommand="Appbar.onStarButton()"/>
-        <toolbarbutton id="pin-button" type="checkbox" oncommand="Appbar.onPinButton()"/>
-      </hbox>
+      </toolbar>
     </appbar>
 
   <!-- Selection overlay - this should be below any content that can have selectable text -->
   <!-- onclick addresses dom bug 835175, str in bug 832957 -->
   <box onclick="false" class="selection-overlay-hidden" id="selection-overlay"/>
 
   <flyoutpanel id="about-flyoutpanel" headertext="&aboutHeader.title;">
         <label id="about-product-label" value="&aboutHeader.product.label;"/>
@@ -702,18 +677,9 @@
     </hbox>
   </stack>
 
   <html:div id="overlay-back" class="overlay-button"
             observes="cmd_back" onclick="CommandUpdater.doCommand('cmd_back');"></html:div>
   <html:div id="overlay-plus" class="overlay-button"
             observes="cmd_back" onclick="CommandUpdater.doCommand('cmd_newTab');"></html:div>
 
-  <svg:svg height="0">
-    <svg:clipPath id="forward-button-clip-path" clipPathUnits="objectBoundingBox">
-      <svg:path d="M 0,0 C 0.15,0.12 0.25,0.3 0.25,0.5 0.25,0.7 0.15,0.88 0,1 L 1,1 1,0 0,0 z"/>
-    </svg:clipPath>
-    <svg:clipPath id="back-button-clip-path" clipPathUnits="userSpaceOnUse">
-      <svg:path d="m -1,-5 0,4.03 C 3.6,1.8 18,21.4 0,40 l 0,27 10000,0 0,-55 L 0,-5 z" />
-    </svg:clipPath>
-  </svg:svg>
-
 </window>
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -1,67 +1,57 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 %filter substitution
 %include defines.inc
 
 %define forward_transition_length 150ms
-%define forward_width 51px
-%define back_width 62px
-%define clipped_url_back_width 71px
+%define forward_width 22px
+%define forward_spacing 12px
 
 /* Sliding Toolbar/Tab Tray ------------------------------------------------- */
 
 #tray {
   transition: transform @metro_animation_duration@ @metro_animation_easing@;
-  transform: translateY(-@tray_slide_height@);
+  transform: translateY(-@tabs_height@);
   width: 100%;
 }
 
 #progress-control {
   display: block;
+  position: absolute;
+  top: -@progress_height@;
   height: @progress_height@;
   max-height: @progress_height@;
-  margin-bottom: -@progress_height@;
-  opacity: 1;
   background: linear-gradient(to right,  @progress_start_color@,  @progress_end_color@);
-  transition-property: width;
-  transition-duration: .3s;
   -moz-user-focus: ignore;
+  transition: width .3s ease-in;
 }
 
 #progress-control:-moz-dir(rtl) {
-  background: linear-gradient(to left,  @progress_start_color@,  @progress_end_color@);
+  transform: scaleX(-1);
 }
 
 #progress-control[fade] {
   opacity: 0;
-  transition-property: width, opacity;
-  transition-duration: .3s, .5s;
-  transition-timing-function: ease-in, ease-in;
+  transition: width .3s ease-in, .5s opacity ease-in;
 }
 
 /* in non-tabsonly mode the navigation bar and tab tray float over content. In
    tabsonly mode they are always visible and offset content. */
 #tray:not([tabsonly]) {
   position: fixed;
 }
 
-#tray[visible][expanded] {
+#tray[visible][expanded]:not([viewstate="snapped"]) {
   transform: none;
 }
 
-#tray[startpage],
-#tray[visible]:not([expanded]),
-#tray[visible][expanded][viewstate="snapped"] {
-  transform: translateY(-@tabs_height@);
-}
-
 /* Tabs --------------------------------------------------------------------- */
 
 #tabs-container {
   background: @panel_dark_color@ @panel_dark_background@;
   padding: 0;
   -moz-padding-start: @metro_spacing_xnormal@;
   width: 100%;
 }
@@ -316,136 +306,68 @@ documenttab[selected] .documenttab-selec
 }
 
 #newtab-button {
   list-style-image: url("images/newtab-default.png");
 }
 
 /* Toolbar ------------------------------------------------------------------ */
 
-#toolbar-container {
-  background: @panel_dark_color@ @panel_dark_background@;
-  border-bottom: @border_width_small@ solid @border_color@;
-  -moz-padding-end: @padding_large@;
-  width: 100%;
-}
-
-#toolbar-container[filtering],
-#toolbar-container[startpage] {
-  border-bottom-width: 0;
-}
-
 #toolbar {
-  -moz-appearance: none;
-  -moz-box-align: center;
-  padding: 0;
-  -moz-padding-end: @metro_spacing_xxxlarge@;
-  -moz-padding-start: @metro_spacing_xxnormal@;
-  border: none;
-  border-top: @metro_border_thin@ solid #293642;
-  background-color: @panel_light_color@;
-  background-image: url("chrome://browser/skin/images/tab-selection-right.png"),
-                    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.5)),
-                    @panel_light_background@;
-  background-repeat: no-repeat, repeat-x;
-  background-position: right bottom;
-  min-height: @toolbar_height@;
+  background-color: @panel_dark_color@;
+  background-image: @panel_dark_background@;
 }
 
-#toolbar[dir=ltr] {
-  background-position: left bottom;
-}
-
-#toolbar toolbarbutton {
-  margin: 0 @toolbar_horizontal_spacing@;
-}
-
-/* Unified back-forward buttons */
-/* TODO: Pull code from mainline firefox to support RTL. */
-#unified-back-forward-button {
-  -moz-box-align: center;
+#toolbar > #back-button {
+  list-style-image: url(chrome://browser/skin/images/back.png);
+  -moz-image-region: rect(0 96px 48px 48px);
   position: relative;
   z-index: 1;
+  -moz-margin-end: -@forward_spacing@;
+  min-height: 48px;
+  max-height: 48px;
 }
 
-#back-button {
-  -moz-appearance: none;
-  margin: 0 !important;
-  margin-right: -@metro_spacing_normal@ !important;
-  list-style-image: url(chrome://browser/skin/images/back.png);
+#toolbar > #back-button[disabled] {
+  visibility: visible;
   -moz-image-region: rect(0 48px 48px 0);
-  position: relative;
-  z-index: 1;
-  padding: 0 !important;
-  min-height: 48px !important;
-  max-height: 48px !important;
-}
-
-#back-button[disabled] {
-  -moz-image-region: rect(0 96px 48px 48px);
 }
 
 #forward-button {
-  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5)), @panel_light_background@;
-  border: @metro_border_thick@ solid rgb(192, 198, 204);
-  margin: 0 !important;
-  padding: 0 !important;
-  -moz-padding-start: 17px !important;
-  -moz-padding-end: 7px !important;
-  transition: opacity @forward_transition_length@ ease-out;
   list-style-image: url(chrome://browser/skin/images/forward.png);
+  -moz-image-region: rect(1px 22px 25px 0); /* width: 22px; height: 24px; */
+  -moz-border-end: @metro_border_thick@ solid @urlbar_border_color@;
+  margin: -1.5px 0;
+  padding: 0;
+  -moz-padding-start: calc(@metro_spacing_snormal@ + @forward_spacing@);
+  -moz-padding-end: @forward_spacing@;
+  transition: -moz-margin-start @forward_transition_length@ ease-out,
+              opacity @forward_transition_length@ ease-out;
 }
 
-/* XXX: Hack to move the image up one pixel because
-        it's not vertically centered for some reason. */
-#forward-button image {
-  margin: -1px 0 1px 0 !important;
-}
-
-#unified-back-forward-button > #forward-button[disabled] {
+#forward-button[disabled] {
+  -moz-margin-start: calc(-@forward_width@ - @forward_spacing@ * 2);
   opacity: 0;
+  pointer-events: none;
 }
 
 /* URL bar */
-#unified-back-forward-button + #urlbar-container {
-  margin: 0;
-  padding: 0;
-  padding-left: @back_width@;
-  -moz-margin-start: -@forward_width@;
-  -moz-margin-end: @metro_spacing_normal@;
-  position: relative;
-  pointer-events: none;
-  
+#urlbar-container {
   border: @metro_border_thick@ solid @urlbar_border_color@;
-  -moz-border-start: 0 none;
-  background: @field_background_color@;
-}
-
-#unified-back-forward-button + #urlbar-container > #urlbar {
-  -moz-border-start: none;
-  pointer-events: all;
-  transition: margin-left @forward_transition_length@ ease-out;
-}
-
-#unified-back-forward-button[forwarddisabled] + #urlbar-container {
-  clip-path: url("chrome://browser/content/browser.xul#back-button-clip-path");
-  padding-left: @clipped_url_back_width@;
-}
-
-#unified-back-forward-button[forwarddisabled] + #urlbar-container > #urlbar {
-  margin-left: -@forward_width@;
+  margin: 0;
+  -moz-margin-end: @toolbar_horizontal_spacing@;
+  padding: 0;
+  background-color: @field_background_color@;
+  overflow: hidden;
 }
 
 /* Identity widget */
 #identity-icon {
-  width: @metro_spacing_xxnormal@;
-  height: @metro_spacing_xxnormal@;
   margin: 0;
-  -moz-margin-end: @metro_spacing_small@;
-  padding: 0;
+  padding: 0 @metro_spacing_snormal@;
   list-style-image: url(chrome://browser/skin/images/identity-icons-generic.png);
 }
 
 #identity-box[mode="verifiedDomain"] > #identity-icon[pageproxystate="valid"] {
   list-style-image: url(chrome://browser/skin/images/identity-icons-https.png);
 }
  
 #identity-box[mode="verifiedIdentity"] > #identity-icon[pageproxystate="valid"] {
@@ -457,128 +379,95 @@ documenttab[selected] .documenttab-selec
   margin: 0 !important;
   min-height: @urlbar_edit_height@;
   -moz-appearance: none !important;
   border-radius: 0;
   border: 0 none !important;
   padding: 0 !important;
 }
 
-#urlbar-edit :invalid {
-  box-shadow: none;
-}
-
 /* Combined stop-reload button */
 #tool-reload {
   list-style-image: url("chrome://browser/skin/images/reload.png");
 }
 
 #tool-stop {
   list-style-image: url("chrome://browser/skin/images/stop-hdpi.png");
 }
 
-#urlbar-icons[mode="loading"] > #tool-reload {
-  visibility: collapse;
-}
-
-#urlbar-icons[mode="edit"] > #tool-stop,
-#urlbar-icons[mode="view"] > #tool-stop {
+#toolbar[mode="loading"] > #tool-reload,
+#toolbar:-moz-any([mode="edit"], [mode="view"]) > #tool-stop {
   visibility: collapse;
 }
 
-/* Toggle that displays the tab bar */
-#toolbar-transition {
-  -moz-padding-end: @metro_spacing_snormal@;
-  background: @panel_dark_color@ @panel_dark_background@;
-}
-
-#tool-new-tab {
-  margin: 0;
-  -moz-margin-start: -@metro_spacing_normal@;
-  list-style-image: url("images/newtab-default.png");
-  transition: opacity ease-out 0.2s;
-}
-
-/* Hide the tab toggle if the tabs are visible */
-#tray[visible][expanded] #tool-new-tab {
-  opacity: 0;
-}
-
 /* Hide the tab toggle if we're showing classic tabs or we're snap-viewed. */
 #toolbar[viewstate="snapped"],
 #tray[tabsonly] #toolbar {
   background: @panel_light_color@ @panel_light_background@;
   -moz-padding-end: 0;
 }
 
-#toolbar-container[viewstate="snapped"],
-#tray[tabsonly] #toolbar-container {
-  -moz-padding-end: 0;
-}
-
-#toolbar-transition[viewstate="snapped"],
-#tray[tabsonly] #toolbar-transition {
-  visibility: collapse;
-}
-
 #toolbar[viewstate="snapped"] {
   -moz-padding-end: 0;
 }
 
-#unified-back-forward-button[viewstate="snapped"] + #urlbar-container {
+#toolbar[viewstate="snapped"] > #urlbar-container {
   -moz-margin-end: 0;
 }
 
+#toolbar[viewstate="snapped"] > #tool-stop ~ toolbarbutton {
+  visibility: collapse;
+}
+
 /* App Bar ----------------------------------------------------------------- */
 
 appbar {
   display: block;
   position: fixed;
-  height: @toolbar_height@;
   bottom: 0;
+  width: 100%;
   transform: translateY(@toolbar_height@);
   transition: transform @metro_animation_duration@ @metro_animation_easing@;
-  width: 100%;
+  font-size: 0;
 }
 
-appbar toolbar {
-  border-top: 1px solid @appbar_top_border@;
-  border-bottom: 0px;
-  height: @toolbar_height@;
+appbar > toolbar {
   -moz-appearance: none;
-  background-color: @appbar_color@;
   -moz-box-align: center;
+  border: 0;
   width: 100%;
+  min-height: @toolbar_height@;
+  font-size: 1rem;
 }
 
-appbar toolbarbutton {
-  float: left;
-  border-width: 0px;
+appbar > toolbar > toolbarbutton {
+  border: 0;
   margin: 0 @toolbar_horizontal_spacing@;
   padding: 0;
   /* Don't inherit background-color from toolbarbutton[checked="true"] */
   background-color: transparent;
 }
 
-appbar toolbarbutton[disabled] {
+appbar > toolbar > toolbarbutton[disabled] {
   visibility: collapse;
 }
 
-#appbar:not([viewstate="snapped"])[visible] {
+#appbar[startpage],
+#appbar[visible] {
   transform: none;
 }
 
-#appbar toolbarbutton {
+#appbar > toolbar > toolbarbutton {
   list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
   -moz-image-region: rect(0px, 200px, 40px, 160px); /* Gear icon is default. */
 }
-#appbar toolbarbutton:hover {
+#appbar > toolbar > toolbarbutton:hover {
   -moz-image-region: rect(40px, 200px, 80px, 160px);
 }
-#appbar toolbarbutton:active {
+#appbar > toolbar > toolbarbutton:active {
   -moz-image-region: rect(80px, 200px, 120px, 160px);
 }
 
 /* Application-Specific */
 #download-button {
   -moz-image-region: rect(0px, 40px, 40px, 0px) !important;
 }
 #download-button:hover {
@@ -639,16 +528,25 @@ appbar toolbarbutton[disabled] {
   -moz-image-region: rect(40px, 360px, 80px, 320px) !important;
 }
 #star-button:active,
 #star-button[checked] {
   -moz-image-region: rect(80px, 360px, 120px, 320px) !important;
 }
 
 /* Tile-selection-Specific */
+#appbar[contextual] > #toolbar,
+#appbar:not([contextual]) > #contextualactions-tray {
+  visibility: collapse;
+}
+
+#contextualactions-tray {
+  background-color: @metro_orange@;
+}
+
 #contextualactions-tray > toolbarbutton {
   opacity: 1;
 }
 #contextualactions-tray > toolbarbutton[fade] {
   opacity: 0;
 }
 #contextualactions-tray > toolbarbutton:not([immediate]) {
   transition-property: opacity;
@@ -903,24 +801,20 @@ setting[type="radio"] > vbox {
   visibility: collapse;
 }
 
 /*Formatting for the limited horizontal space of snapped*/
 #start-autocomplete[viewstate="snapped"] .richgrid-item-content {
   -moz-box-orient: horizontal;
 }
 
-#start-autocomplete[viewstate="snapped"] {
-  padding-left: 0px;
-  padding-right: 0px;
-}
-
-#start-container[viewstate="snapped"] {
-  padding-left: 0px;
-  padding-right: 0px;
+#start-container,
+#start-autocomplete {
+  padding-left: 0;
+  padding-right: 0;
 }
 
 #start-container[viewstate="snapped"] .meta-section {
   margin: 0px;
 }
 
 
 /* Browser Content Areas ----------------------------------------------------- */
--- a/browser/metro/theme/defines.inc
+++ b/browser/metro/theme/defines.inc
@@ -16,24 +16,22 @@
 
 %define urlbar_border_color #BFC6CC
 %define urlbar_edit_height 36px
 
 %define toolbar_vertical_spacing 5px
 %define toolbar_horizontal_spacing 20px
 %define toolbar_height 68px
 %define tabs_height 178px
-%define tray_slide_height 247px
 
 %define progress_height 3px
 %define progress_start_color #0095dd
 %define progress_end_color #97cbff
 
-%define appbar_color #FF8000
-%define appbar_top_border #BFC6CE
+%define metro_orange #FF8000
 
 %define label_height 30px
 
 %define thumbnail_width 232px
 %define thumbnail_height 148px
 
 %define tile_border_color #dbdcde
 %define tile_width 200px
@@ -50,17 +48,16 @@
 %define metro_spacing_small 5px
 %define metro_spacing_snormal 10px
 %define metro_spacing_normal 15px
 %define metro_spacing_xnormal 20px
 %define metro_spacing_xxnormal 25px
 %define metro_spacing_xxxnormal 30px
 %define metro_spacing_large 40px
 %define metro_spacing_xlarge 45px
-%define metro_spacing_xxxlarge 65px
 
 %define metro_border_thin 1px
 %define metro_border_thick 2px
 %define metro_border_xthick 4px
 
 %define metro_font_snormal 14px
 %define metro_font_normal 15px
 %define metro_font_large 25px
--- a/browser/metro/theme/forms.css
+++ b/browser/metro/theme/forms.css
@@ -5,17 +5,17 @@
 %filter substitution
 %include defines.inc
 
 /* Content Navigator popup ------------------------------------------------- */
 #content-navigator {
   display: none;
   pointer-events: none;
   padding: 0;
-  background-color: @appbar_color@;
+  background-color: @metro_orange@;
   bottom: 0;
   position: fixed;
 }
 
 #content-navigator[type="find"],
 #content-navigator[type="form"]:not([disabled]) {
   display: -moz-box;
 }
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -86,16 +86,21 @@ toolbarbutton.bookmark-item[open="true"]
   -moz-padding-end: 2px;
 }
 
 .bookmark-item > .toolbarbutton-icon {
   width: 16px;
   height: 16px;
 }
 
+#PlacesToolbarItems > .bookmark-item:not([image]):not([label=""]):not([container]) > .toolbarbutton-icon {
+  display: none;
+}
+
+
 /* Prevent [mode="icons"] from hiding the label */
 .bookmark-item > .toolbarbutton-text {
   display: -moz-box !important;
 }
 
 .bookmark-item > .toolbarbutton-menu-dropmarker {
   display: none;
 }
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -211,16 +211,21 @@ toolbarbutton.bookmark-item > menupopup 
 }
 
 .bookmark-item > .toolbarbutton-icon {
   width: 16px;
   min-height: 16px;
   max-height: 16px;
 }
 
+#PlacesToolbarItems > .bookmark-item:not([image]):not([label=""]):not([container]) > .toolbarbutton-icon {
+  display: none;
+}
+
+
 .bookmark-item > .toolbarbutton-icon[label]:not([label=""]),
 .bookmark-item > .toolbarbutton-icon[type="menu"] {
   -moz-margin-end: 5px;
 }
 
 .bookmark-item[container] {
   list-style-image: url("chrome://global/skin/tree/folder.png");
 }
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -607,16 +607,20 @@ toolbarbutton.bookmark-item[open="true"]
   -moz-padding-end: 2px;
 }
 
 .bookmark-item:not(#bookmarks-menu-button) > .toolbarbutton-icon {
   width: 16px;
   height: 16px;
 }
 
+#PlacesToolbarItems > .bookmark-item:not([image]):not([label=""]):not([container]) > .toolbarbutton-icon {
+  display: none;
+}
+
 /* Prevent [mode="icons"] from hiding the label */
 .bookmark-item > .toolbarbutton-text {
   display: -moz-box !important;
 }
 
 .bookmark-item > .toolbarbutton-menu-dropmarker {
   display: none;
 }
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -140,25 +140,16 @@ static bool ConvertToMidasInternalComman
                                             bool& boolValue);
 
 static bool ConvertToMidasInternalCommand(const nsAString & inCommandID,
                                             nsACString& outCommandID);
 
 // ==================================================================
 // =
 // ==================================================================
-static void
-ReportUseOfDeprecatedMethod(nsHTMLDocument* aDoc, const char* aWarning)
-{
-  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
-                                  "DOM Events", aDoc,
-                                  nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning);
-}
-
 static nsresult
 RemoveFromAgentSheets(nsCOMArray<nsIStyleSheet> &aAgentSheets, const nsAString& url)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), url);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (int32_t i = aAgentSheets.Count() - 1; i >= 0; --i) {
@@ -2246,37 +2237,16 @@ nsHTMLDocument::GetSelection(ErrorResult
     return nullptr;
   }
 
   nsCOMPtr<nsISelection> sel;
   rv = window->GetSelection(getter_AddRefs(sel));
   return sel.forget();
 }
 
-NS_IMETHODIMP
-nsHTMLDocument::CaptureEvents(int32_t aEventFlags)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfCaptureEventsWarning");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLDocument::ReleaseEvents(int32_t aEventFlags)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfReleaseEventsWarning");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLDocument::RouteEvent(nsIDOMEvent* aEvt)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfRouteEventWarning");
-  return NS_OK;
-}
-
 // Mapped to document.embeds for NS4 compatibility
 NS_IMETHODIMP
 nsHTMLDocument::GetPlugins(nsIDOMHTMLCollection** aPlugins)
 {
   *aPlugins = nullptr;
 
   return GetEmbeds(aPlugins);
 }
--- a/content/html/document/src/nsHTMLDocument.h
+++ b/content/html/document/src/nsHTMLDocument.h
@@ -94,21 +94,16 @@ public:
   using nsDocument::GetMozFullScreenElement;
 
   // nsIDOMNode interface
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMHTMLDocument interface
   NS_DECL_NSIDOMHTMLDOCUMENT
 
-  void RouteEvent(nsDOMEvent& aEvent)
-  {
-    RouteEvent(&aEvent);
-  }
-
   /**
    * Returns the result of document.all[aID] which can either be a node
    * or a nodelist depending on if there are multiple nodes with the same
    * id.
    */
   nsISupports *GetDocumentAllResult(const nsAString& aID,
                                     nsWrapperCache **aCache,
                                     nsresult *aResult);
@@ -243,19 +238,16 @@ public:
   // The XPCOM Get/SetBgColor work OK for us, since they never throw.
   nsIHTMLCollection* Anchors();
   nsIHTMLCollection* Applets();
   void Clear() const
   {
     // Deprecated
   }
   already_AddRefed<nsISelection> GetSelection(mozilla::ErrorResult& rv);
-  // The XPCOM CaptureEvents works fine for us.
-  // The XPCOM ReleaseEvents works fine for us.
-  // The XPCOM RouteEvent works fine for us.
   // We're picking up GetLocation from Document
   already_AddRefed<nsIDOMLocation> GetLocation() const {
     return nsIDocument::GetLocation();
   }
 
   virtual nsHTMLDocument* AsHTMLDocument() { return this; }
 
 protected:
--- a/content/media/webaudio/AudioBufferSourceNode.cpp
+++ b/content/media/webaudio/AudioBufferSourceNode.cpp
@@ -445,17 +445,16 @@ AudioBufferSourceNode::AudioBufferSource
   , mLoopEnd(0.0)
   , mOffset(0.0)
   , mDuration(std::numeric_limits<double>::min())
   , mPlaybackRate(new AudioParam(this, SendPlaybackRateToStream, 1.0f))
   , mGain(new AudioParam(this, SendGainToStream, 1.0f))
   , mLoop(false)
   , mStartCalled(false)
   , mStopped(false)
-  , mOffsetAndDurationRemembered(false)
 {
   AudioBufferSourceNodeEngine* engine =
       new AudioBufferSourceNodeEngine(this, aContext->Destination());
   mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
   engine->SetSourceStream(static_cast<AudioNodeStream*> (mStream.get()));
   mStream->AddMainThreadListener(this);
 }
 
@@ -489,22 +488,21 @@ AudioBufferSourceNode::Start(double aWhe
   }
 
   if (mBuffer) {
     double duration = aDuration.WasPassed() ?
                       aDuration.Value() :
                       std::numeric_limits<double>::min();
     SendOffsetAndDurationParametersToStream(ns, aOffset, duration);
   } else {
-    // Remember our argument so that we can use them once we have a buffer
+    // Remember our arguments so that we can use them once we have a buffer
     mOffset = aOffset;
     mDuration = aDuration.WasPassed() ?
                 aDuration.Value() :
                 std::numeric_limits<double>::min();
-    mOffsetAndDurationRemembered = true;
   }
 
   // Don't set parameter unnecessarily
   if (aWhen > 0.0) {
     ns->SetStreamTimeParameter(START, Context()->DestinationStream(), aWhen);
   }
 
   MOZ_ASSERT(!mPlayingRef, "We can only accept a successful start() call once");
@@ -522,19 +520,17 @@ AudioBufferSourceNode::SendBufferParamet
     nsRefPtr<ThreadSharedFloatArrayBufferList> data =
       mBuffer->GetThreadSharedChannelsForRate(aCx);
     ns->SetBuffer(data.forget());
     ns->SetInt32Parameter(SAMPLE_RATE, rate);
   } else {
     ns->SetBuffer(nullptr);
   }
 
-  if (mOffsetAndDurationRemembered) {
-    SendOffsetAndDurationParametersToStream(ns, mOffset, mDuration);
-  }
+  SendOffsetAndDurationParametersToStream(ns, mOffset, mDuration);
 }
 
 void
 AudioBufferSourceNode::SendOffsetAndDurationParametersToStream(AudioNodeStream* aStream,
                                                                double aOffset,
                                                                double aDuration)
 {
   float rate = mBuffer ? mBuffer->SampleRate() : Context()->SampleRate();
--- a/content/media/webaudio/AudioBufferSourceNode.h
+++ b/content/media/webaudio/AudioBufferSourceNode.h
@@ -147,16 +147,15 @@ private:
   double mDuration;
   nsRefPtr<AudioBuffer> mBuffer;
   nsRefPtr<AudioParam> mPlaybackRate;
   nsRefPtr<AudioParam> mGain;
   SelfReference<AudioBufferSourceNode> mPlayingRef; // a reference to self while playing
   bool mLoop;
   bool mStartCalled;
   bool mStopped;
-  bool mOffsetAndDurationRemembered;
 };
 
 }
 }
 
 #endif
 
--- a/content/media/webaudio/test/Makefile.in
+++ b/content/media/webaudio/test/Makefile.in
@@ -15,16 +15,17 @@ MOCHITEST_FILES := \
   test_bug808374.html \
   test_bug827541.html \
   test_bug839753.html \
   test_bug845960.html \
   test_bug856771.html \
   test_bug866570.html \
   test_bug866737.html \
   test_bug867089.html \
+  test_bug867104.html \
   test_bug867174.html \
   test_bug867203.html \
   test_analyserNode.html \
   test_AudioBuffer.html \
   test_AudioContext.html \
   test_AudioListener.html \
   test_AudioParam.html \
   test_audioParamExponentialRamp.html \
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_bug867104.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Crashtest for bug 867104</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+SpecialPowers.setBoolPref("media.webaudio.enabled", true);
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(function() {
+  var ctx = new AudioContext();
+  var source = ctx.createBufferSource();
+  var b0 = ctx.createBuffer(32,798,22050);
+  var b1 = ctx.createBuffer(32,28,22050);
+  var sp = ctx.createScriptProcessor();
+  source.buffer = b0;
+  source.connect(sp);
+  source.start(0);
+  source.buffer = b1;
+  sp.onaudioprocess = function() {
+    ok(true, "We did not crash.");
+    sp.onaudioprocess = null;
+    SpecialPowers.clearUserPref("media.webaudio.enabled");
+    SimpleTest.finish();
+  };
+});
+
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6117,59 +6117,16 @@ nsGlobalWindow::SetInterval(int32_t *_re
 NS_IMETHODIMP
 nsGlobalWindow::SetResizable(bool aResizable)
 {
   // nop
 
   return NS_OK;
 }
 
-static void
-ReportUseOfDeprecatedMethod(nsGlobalWindow* aWindow, const char* aWarning)
-{
-  nsCOMPtr<nsIDocument> doc = aWindow->GetExtantDoc();
-  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
-                                  "DOM Events", doc,
-                                  nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning);
-}
-
-NS_IMETHODIMP
-nsGlobalWindow::CaptureEvents(int32_t aEventFlags)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfCaptureEventsWarning");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGlobalWindow::ReleaseEvents(int32_t aEventFlags)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfReleaseEventsWarning");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGlobalWindow::RouteEvent(nsIDOMEvent* aEvt)
-{
-  ReportUseOfDeprecatedMethod(this, "UseOfRouteEventWarning");
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGlobalWindow::EnableExternalCapture()
-{
-  return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsGlobalWindow::DisableExternalCapture()
-{
-  return NS_ERROR_FAILURE;
-}
-
 static
 bool IsPopupBlocked(nsIDocument* aDoc)
 {
   nsCOMPtr<nsIPopupWindowManager> pm =
     do_GetService(NS_POPUPWINDOWMANAGER_CONTRACTID);
 
   if (!pm) {
     return false;
--- a/dom/interfaces/base/nsIDOMJSWindow.idl
+++ b/dom/interfaces/base/nsIDOMJSWindow.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
-[scriptable, uuid(6652c4d2-6b49-424b-aaf9-91f91006fab7)]
+[scriptable, uuid(35b653f4-e679-4843-8391-89cb2f5a9ba4)]
 interface nsIDOMJSWindow : nsISupports
 {
   void                      dump(in DOMString str);
 
   /**
    * These methods take typeless arguments and optional arguments, the
    * first argument is either a function or a string, the second
    * argument must be a number (ms) and the rest of the arguments (2
@@ -29,26 +29,16 @@ interface nsIDOMJSWindow : nsISupports
 
   /**
    * This method is here for backwards compatibility with 4.x only,
    * its implementation is a no-op
    */
   void                      setResizable(in boolean resizable);
 
   /**
-   * @deprecated These are old Netscape 4 methods. Do not use,
-   *             the implementation is no-op.
-   */
-  void                      captureEvents(in long eventFlags);
-  void                      releaseEvents(in long eventFlags);
-  void                      routeEvent(in nsIDOMEvent evt);
-  void                      enableExternalCapture();
-  void                      disableExternalCapture();
-
-  /**
    * This is the scriptable version of nsIDOMWindow::open()
    * that takes 3 optional arguments. Its binary name is OpenJS to
    * avoid colliding with nsIDOMWindow::open(), which has the
    * same signature. The reason we can't have that collision is that
    * the implementation needs to know whether it was called from JS or
    * not.
    *
    * IOW, DO NOT CALL THIS FROM C++
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -8,17 +8,17 @@
 /**
  * The nsIDOMHTMLDocument interface is the interface to a [X]HTML
  * document object.
  *
  * @see <http://www.whatwg.org/html/>
  */
 interface nsISelection;
 
-[scriptable, uuid(fd76e045-8d97-4a97-ad75-eac5ae2f3ea4)]
+[scriptable, uuid(60e0e311-b9c7-4952-8e9c-d4974005e887)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
            attribute DOMString            domain;
            attribute DOMString            cookie;
 
   readonly attribute nsIDOMHTMLHeadElement head;
            attribute nsIDOMHTMLElement    body;
 
@@ -83,19 +83,9 @@ interface nsIDOMHTMLDocument : nsIDOMDoc
   readonly attribute nsIDOMHTMLCollection anchors;
   readonly attribute nsIDOMHTMLCollection applets;
 
   void                      clear();
 
 
   // DOM Range
   nsISelection                getSelection();
-
-
-  // Mozilla extensions
-  /**
-   * @deprecated These are old Netscape 4 methods. Do not use,
-   *             the implementation is no-op.
-   */
-  void                      captureEvents(in long eventFlags);
-  void                      releaseEvents(in long eventFlags);
-  void                      routeEvent(in nsIDOMEvent evt);
 };
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -12,19 +12,16 @@ WaitForScriptButton=Continue
 DontAskAgain=&Don't ask me again
 JSURLLoadBlockedWarning=Attempt to load a javascript: URL from one host\nin a window displaying content from another host\nwas blocked by the security manager.
 WindowCloseBlockedWarning=Scripts may not close windows that were not opened by script.
 OnBeforeUnloadTitle=Are you sure?
 OnBeforeUnloadMessage=This page is asking you to confirm that you want to leave - data you have entered may not be saved.
 OnBeforeUnloadStayButton=Stay on Page
 OnBeforeUnloadLeaveButton=Leave Page
 DocumentAllUsed=Non-standard document.all property was used. Use W3C standard document.getElementById() instead.
-UseOfCaptureEventsWarning=Use of captureEvents() is deprecated. To upgrade your code, use the DOM 2 addEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.addEventListener
-UseOfReleaseEventsWarning=Use of releaseEvents() is deprecated. To upgrade your code, use the DOM 2 removeEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.removeEventListener
-UseOfRouteEventWarning=Use of routeEvent() is deprecated. To upgrade your code, use the DOM 2 dispatchEvent() method. For more help http://developer.mozilla.org/en/docs/DOM:element.dispatchEvent
 UseOfPreventBubbleWarning=Event=%S, use of preventBubble() is deprecated. Use W3C standard stopPropagation() instead.
 UseOfPreventCaptureWarning=Event=%S, use of preventCapture() is deprecated. Use W3C standard stopPropagation() instead.
 UseOfDOM3LoadMethodWarning=Use of Document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
 UnexpectedCanvasVariantStyle=canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
 EmptyGetElementByIdParam=Empty string passed to getElementById().
 LowMemoryTitle=Warning: Low memory
 LowMemoryMessage=A script on this page has been stopped due to a low memory condition.
 SpeculationFailed=An unbalanced tree was written using document.write() causing data from the network to be reparsed. For more information https://developer.mozilla.org/en/Optimizing_Your_Pages_for_Speculative_Parsing
--- a/dom/webidl/HTMLDocument.webidl
+++ b/dom/webidl/HTMLDocument.webidl
@@ -63,16 +63,9 @@ interface HTMLDocument : Document {
   readonly attribute HTMLCollection anchors;
   readonly attribute HTMLCollection applets;
 
   void clear();
 
   // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections
   [Throws]
   Selection getSelection();
-
-  // @deprecated These are old Netscape 4 methods. Do not use,
-  //             the implementation is no-op.
-  // XXXbz do we actually need these anymore?
-  void                      captureEvents(long eventFlags);
-  void                      releaseEvents(long eventFlags);
-  void                      routeEvent(Event evt);
 };
--- a/gfx/src/nsITheme.h
+++ b/gfx/src/nsITheme.h
@@ -148,19 +148,17 @@ public:
                                      nsIFrame* aFrame,
                                      uint8_t aWidgetType)=0;
 
   virtual bool WidgetIsContainer(uint8_t aWidgetType)=0;
 
   /**
    * Does the nsITheme implementation draw its own focus ring for this widget?
    */
-  virtual bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                          nsIFrame* aFrame,
-                                          uint8_t aWidgetType)=0;
+  virtual bool ThemeDrawsFocusForWidget(uint8_t aWidgetType)=0;
   
   /**
     * Should we insert a dropmarker inside of combobox button?
    */
   virtual bool ThemeNeedsComboboxDropmarker()=0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/783041-1.html
@@ -0,0 +1,63 @@
+<html>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+  <head>
+    <style>
+      #el7 {
+        font-size:.92em 
+      } 
+      #el0 { 
+        height: 200px ! important; 
+        margin: 0px; 
+        display: table;
+        font-size:.92em 
+      }
+
+      #el3 { 
+        line-height: 0.5px; 
+        text-shadow: 0px 5px 5px, 0px -20px 10px;
+        display: table-row-group; 
+        transform: translate3d(-3px, -300px, 0px); 
+      }
+
+      #el5 { 
+        height:1em;
+        display:block; 
+      } 
+
+      .c4 { 
+        margin: 1em;
+        padding: 0.5em;
+      } 
+    </style>
+    <script>
+      onload = function() {
+        el7=document.createElement('iframe')
+        el7.setAttribute('id', 'el7')
+        document.body.appendChild(el7)
+
+        el0=document.createElement('span')
+        el0.setAttribute('id','el0')
+        document.body.appendChild(el0)
+        el0.appendChild(document.createTextNode('A'))
+
+        el3=document.createElement('q')
+        el3.setAttribute('id','el3')
+        el0.appendChild(el3)
+
+        el5=document.createElement('q')
+        el5.setAttribute('id','el5')
+        el3.appendChild(el5)
+
+        el0.appendChild(document.createTextNode('A'))
+
+        document.body.offsetTop
+        el0.setAttribute('class', 'c4'); 
+        el7.setAttribute('class', 'c4'); 
+      }
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/783041-2.html
@@ -0,0 +1,63 @@
+<html>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+  <head>
+    <style>
+      #el0 {
+        height: 200px ! important;
+        height: 1em;
+        width: 1em;
+        padding: 5px;
+        display: table;
+        -moz-transform:translate3d(0, 80px, 0);
+      } 
+      #el0:before {
+        display: -moz-grid;
+        content: counter(c, hiragana) attr(id);
+        counter-increment: c 694;
+      } 
+      #el0:after {
+        counter-reset: c 694;
+        content: counter(c, cjk-ideographic) attr(id);
+      } 
+      #el1 {
+        text-shadow: 0px 20px 0px, 0px -20px 10px;
+        line-height: 4px;
+        transform: translate3d(0px, -300px, 0px);
+        display: table-row-group;
+        border-spacing: 7px;
+      } 
+      #el1:after {
+        counter-reset: c;
+        display: -moz-box;
+        content: counter(c, cjk-ideographic) attr(id);
+        counter-increment: c 694;
+      }
+      #el2 {
+        display: table-row-group;
+        -moz-transform:translate3d(0, 80px, 0); 
+      }
+      #el2:after {
+        content: counter(c, cjk-ideographic) attr(id);
+      } 
+    </style>
+    <script>
+      onload = function() {
+        el0=document.createElement('div')
+        el0.setAttribute('id','el0')
+        document.body.appendChild(el0)
+        el1=document.createElement('div')
+        el1.setAttribute('id','el1')
+        el0.appendChild(el1)
+        el2=document.createElement('q')
+        el2.setAttribute('id','el2')
+        el1.appendChild(el2)
+        el0.appendChild(document.createTextNode('A'))
+        setTimeout("location.reload()", 100)
+      }
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/783041-3.html
@@ -0,0 +1,71 @@
+<html>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+  <head>
+    <style>
+      #el0 { 
+        height: 200px ! important; 
+        padding: 4px; 
+        white-space: pre-wrap; 
+        margin-top: 0px; 
+        display: table;
+      }
+      #el3 { 
+        line-height: 3px; 
+        text-shadow: 0px 5px 5px, 0px -20px 10px;
+      }
+      #el3:before { display: inline-block; }
+      #el3:first-of-type { transform: translate3d(-30px, -300px, 0px); }
+      #el3:first-child { display: table-row-group; }
+      #el5:before { -moz-margin-before:1em; display: list-item; content: counter(c, ethiopic-halehame-tig) attr(id); counter-increment: c 810; } 
+      #el5 { list-style-type:lower-greek } 
+      #el5 { background:red;margin:0;height:1em;display:block } 
+      #el5:nth-child(3) { -moz-svg-shadow:5px 5px 5px red; display: link; content: counter(c, asterisks) attr(id); counter-increment: c 266; } 
+
+      .c4 { 
+        margin: 1em; } 
+      #el7 { font-size:.92em } 
+      #el3 { font-size:.92em } 
+      .c4 { padding:0.4em 0.5em 0.4em 2.5em } 
+      .c4:after { margin:2px; display: -moz-box; content: counter(c, octal) attr(id); counter-increment: c 171; } 
+      .c4:before { -moz-user-drag:none; display: -moz-inline-flexbox; content: counter(c, hiragana-iroha) attr(id); counter-increment: c 209; } 
+      .c4:only-of-type { -moz-logical-height:50px; display: -moz-box; content: counter(c, binary) attr(id); counter-increment: c 871; } 
+    </style>
+    <script>
+      onload = function() {
+        el0=document.createElement('ul')
+        el0.setAttribute('id','el0')
+        document.body.appendChild(el0)
+
+        el1=document.createElement('canvas')
+        document.body.appendChild(el1)
+
+
+        el3=document.createElement('q')
+        el3.setAttribute('id','el3')
+        el0.appendChild(el3)
+
+        el4=document.createElement('progress')
+        el4.setAttribute('id','el4')
+        document.body.appendChild(el4)
+
+        el5=document.createElement('q')
+        el5.setAttribute('id','el5')
+        el3.appendChild(el5)
+
+        el0.appendChild(document.createTextNode('A'))
+
+        el7=document.createElement('iframe')
+        el7.setAttribute('id', 'el7')
+        el0.parentNode.insertBefore(el7, el0)
+        el0.setAttribute('class', 'c4'); 
+        el3.setAttribute('class', 'c4'); 
+        el7.setAttribute('class', 'c4'); 
+        setTimeout("window.close()", 5000)
+      }
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/783041-4.html
@@ -0,0 +1,82 @@
+<html>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/.  -->
+  <head>
+    <style>
+      #el0 { 
+        height: 200px ! important; 
+        padding: 4px; 
+        white-space: pre-wrap; 
+        margin-top: 0px; 
+        display: table;
+        font-size:.92em 
+      }
+
+      #el0:before { 
+        content: counter(c, hiragana-iroha); 
+      } 
+
+      #el3 { 
+        line-height: 3px; 
+        text-shadow: 0px 5px 5px, 0px -20px 10px;
+        display: table-row-group; 
+        transform: translate3d(-30px, -300px, 0px); 
+      }
+
+      #el3:before { 
+        display: inline-block;
+      }
+
+      #el5 { 
+        height:1em;
+        display:block; 
+      } 
+
+      #el5:before {
+        display: list-item;
+      }
+
+      #el7 {
+        font-size:.92em 
+      } 
+      .c4 { 
+        margin: 1em;
+        padding:0.4em 0.5em 0.4em 2.5em; 
+        counter-increment: c; 
+      } 
+
+      .c4:after {
+        margin: 2px; 
+        display: inline-block; 
+      } 
+    </style>
+    <script>
+      onload = function() {
+        el7=document.createElement('iframe')
+        el7.setAttribute('id', 'el7')
+        document.body.appendChild(el7)
+
+        el0=document.createElement('ul')
+        el0.setAttribute('id','el0')
+        document.body.appendChild(el0)
+
+
+        el3=document.createElement('q')
+        el3.setAttribute('id','el3')
+        el0.appendChild(el3)
+
+        el5=document.createElement('q')
+        el5.setAttribute('id','el5')
+        el3.appendChild(el5)
+
+        el0.appendChild(document.createTextNode('A'))
+
+        el0.setAttribute('class', 'c4'); 
+        el7.setAttribute('class', 'c4'); 
+      }
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
--- a/gfx/tests/crashtests/crashtests.list
+++ b/gfx/tests/crashtests/crashtests.list
@@ -85,11 +85,15 @@ load 580233-1.html
 load 580719-1.html
 load 594654-1.xhtml
 load 595727-1.html
 load 633453-1.html
 load 633322-1.html
 load 686190-1.html
 load 693143-1.html
 load 768079-1.html
+load 783041-1.html
+load 783041-2.html
+load 783041-3.html
+load 783041-4.html
 asserts-if(gtk2Widget,1) load 798853.html # bug 868792
 asserts-if(winWidget,0-1) skip-if(B2G) load 815489.html
 load 856784-1.html
--- a/js/xpconnect/crashtests/806751.html
+++ b/js/xpconnect/crashtests/806751.html
@@ -3,17 +3,17 @@
 <head>
 <script>
 
 function boom()
 {
   var frame = document.getElementById("frame");
   var frameWin = frame.contentWindow;
   var frameWinner = Object.create(frameWin);
-  var v = frameWinner.captureEvents.bind(frameWinner);
+  var v = frameWinner.clearTimeout.bind(frameWinner);
   frame.src = "local-file-not-found";
   setTimeout(function() { setTimeout(finish); v(0); });
 }
 
 function finish() {
   document.documentElement.removeAttribute('class');
 }
 
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/772306.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+
+function boom()
+{
+    var allNodes = [];
+    allNodes[5] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    allNodes[5].style.setProperty("-moz-column-width", "200px", "");
+    allNodes[5].style.setProperty("height", "2em", "");
+    allNodes[7] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    allNodes[7].style.setProperty("float", "left", "");
+    allNodes[30] = document.createElementNS("http://www.w3.org/1998/Math/MathML", "munder");
+    (allNodes[7] || allNodes[5] || document.body).appendChild(allNodes[30]);
+    (allNodes[5] || document.body).appendChild(allNodes[7]);
+    allNodes[17] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    allNodes[17].style.setProperty("display", "inline-block", "");
+    (allNodes[5] || document.body).appendChild(allNodes[17]);
+    allNodes[20] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    (allNodes[5] || document.body).appendChild(allNodes[20]);
+    allNodes[23] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    allNodes[23].style.setProperty("float", "left", "");
+    allNodes[25] = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
+    allNodes[25].style.setProperty("display", "inline-block", "");
+    (allNodes[23] || allNodes[5] || document.body).appendChild(allNodes[25]);
+    (allNodes[5] || document.body).appendChild(allNodes[23]);
+    (document.body).appendChild(allNodes[5]);
+    document.documentElement.offsetHeight;
+    allNodes[34] = document.createElementNS("http://www.w3.org/1998/Math/MathML", 'maligngroup');
+    allNodes[17].appendChild(allNodes[34]);
+    document.documentElement.offsetHeight;
+    allNodes[30].setAttribute('accentunder', "false");
+}
+
+</script>
+</head>
+
+<body onload="boom();"></body>
+</html>
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -389,16 +389,17 @@ load 727601.html
 # processes so we time out.)
 skip-if(Android||B2G||browserIsRemote) asserts(0-2) pref(dom.disable_open_during_load,false) load 735943.html # the assertion is bug 735966, for android bug 760271, for b2g bug 833371
 asserts(0-2) load 736389-1.xhtml # sometimes the above assertions are delayed and is reported on this test instead
 asserts-if(winWidget,0-2) load 736924-1.html # bug 738803
 load 749816-1.html
 load 763223-1.html
 test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) load 763702.xhtml
 load 770381-1.html
+load 772306.html
 load 788360.html
 load 793848.html
 load 795646.html
 load 802902.html
 load 813372-1.html
 asserts-if(gtk2Widget,0-1) load 822865.html # bug 540078
 load 833604-1.html
 load 835056.html
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -163,17 +163,17 @@ void nsDisplayButtonBorderBackground::Pa
 }
 
 void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
                                       nsRenderingContext* aCtx)
 {
   nsPresContext *presContext = mFrame->PresContext();
   const nsStyleDisplay *disp = mFrame->StyleDisplay();
   if (!mFrame->IsThemed(disp) ||
-      !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, mFrame, disp->mAppearance)) {
+      !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) {
     // draw the focus and outline borders
     nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
     mBFR->PaintOutlineAndFocusBorders(presContext, *aCtx, mVisibleRect, r);
   }
 }
 
 nsresult
 nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1531,17 +1531,17 @@ nsComboboxControlFrame::BuildDisplayList
   // draw a focus indicator only when focus rings should be drawn
   nsIDocument* doc = mContent->GetCurrentDoc();
   if (doc) {
     nsPIDOMWindow* window = doc->GetWindow();
     if (window && window->ShouldShowFocusRing()) {
       nsPresContext *presContext = PresContext();
       const nsStyleDisplay *disp = StyleDisplay();
       if ((!IsThemed(disp) ||
-           !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
+           !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
           mDisplayFrame && IsVisibleForPainting(aBuilder)) {
         aLists.Content()->AppendNewToTop(
           new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
       }
     }
   }
 
   DisplaySelectionOverlay(aBuilder, aLists.Content());
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -239,18 +239,17 @@ nsRangeFrame::BuildDisplayList(nsDisplay
   nsEventStates eventStates = mContent->AsElement()->State();
   if (!eventStates.HasState(NS_EVENT_STATE_FOCUSRING) ||
       eventStates.HasState(NS_EVENT_STATE_DISABLED)) {
     return;
   }
   nsPresContext *presContext = PresContext();
   const nsStyleDisplay *disp = StyleDisplay();
   if ((!IsThemed(disp) ||
-       !presContext->GetTheme()->
-         ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
+       !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
       IsVisibleForPainting(aBuilder)) {
     aLists.Content()->AppendNewToTop(
       new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
   }
 }
 
 NS_IMETHODIMP
 nsRangeFrame::Reflow(nsPresContext*           aPresContext,
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/691210.html
@@ -0,0 +1,5 @@
+<html style="-moz-column-width: 1px;"><head>
+
+</head>
+
+<body><div style="position: relative; -moz-column-count: 6;"><div style="position: absolute; height: 9px;"></div><div style="height: 9px;"></div></div></body></html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/723108.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+</head>
+<body style=" -moz-column-count: 2; ">m
+<div style="width: 10px; ">m
+<div style="-moz-column-count: 2;  -moz-transform: scale(1); ">m
+<span style="position: fixed;">m m</span>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/747688.html
@@ -0,0 +1,6 @@
+<style>
+* { height: 0; margin: 100%; -moz-column-width: 50px; }
+.test1 { position: absolute; min-height: 100%; -moz-columns: 3; -moz-column-count: 200; }
+.test2 { padding-bottom: 100px; margin-bottom: 20px; width: 20px; }
+</style>
+<div class="test1"><figure><div class="test2">A0AAAA0A0AAAA00AAA<hgroup></hgroup><timer><optgroup></div><div class="test2"><rect><h5>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/750066-iframe.html
@@ -0,0 +1,32 @@
+<html style="white-space: pre; -moz-column-count: 2;">
+<body onload="document.body.style.MozFloatEdge = 'margin-box';" style="-moz-column-width: 20em;">
+<div style="position: relative; height: 80px; margin: 10px;">
폋哟	
꠲	g
+嚬
+C휤㏡Ⳣ꠰獧oق䰧	
+&amp;
+ꃎ	䅷ᩥ
+
+O禕v
+Eᚇ⋩XO	
+讉ཐsҍ
M匕
+዁Y	
+	H唼Uฉ
+J
硵
+
_谜	
-寇캫셂Z	+:抂뮶
+쾽E
+2ɻ	صkJP₾,cJ=
+.x,
+
!M]
+薹謩ꢼ믇	
Y[ࡌ4

衒}畁dd:ꑪ
eh	䲡
	杊ᇋ	峂
p꺁
௴
+聢	埓櫜
	
+
+,K
}&gt;
+
+a~ゲ	㯝A	ĝj
+협
+
+ᭃ	&amp;羋劮૩k惖qs툩
	B䛊J=罩E
+
+<div style="position: absolute; height: 11px; top: 19px;"></div>
+</div>
+</body></html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/750066.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait"><head>
+    <meta charset="utf-8">
+    <title>Testcase for bug 750066</title>
+<style>
+iframe { -moz-transition: width 2000ms ease-out 0s; }
+</style>
+
+<script>
+function resize(w) {
+  var win = window.frames[0];
+  win.frameElement.style.width = w;
+}
+function doTest() {
+  resize('1000px'); 
+  setTimeout(function(){ 
+    resize('500px');
+    setTimeout(function(){
+      document.documentElement.removeAttribute("class");
+    },0);
+  },500);
+}
+</script>
+</head>
+<body>
+
+<iframe src="750066-iframe.html"></iframe>
+
+<script>
+window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/756241-iframe.html
@@ -0,0 +1,14 @@
+3c11T{f@lGr#=_/*?13iz?,w{*cP&amp;>base64,R0lGODlh9AEBAPcAAAT%2BBADiFgASAgAAAFnY0Bu9xgBQUAAAAE4AdBuw4gBQEgAAAAAcAADiABUSAAAAAApU3gAnnwCRgAB8fAAJAAIEAAAAQAAAAAAA0AOwxgBQUAAAAMA3dOAp4hKREgB8AOng9eXin4ESgHwAfAAz4AAI4gGREgB8AFbgfQDiBAASAAAAAMh9AN8EABIAAAAAAHMAEAAAAABAAAAAAOjwB%2BAAABJAAAAAABho5O7h4pASEnwAAHB9AwUEAZEAAHwAAP%2BgqP%2Fh4v8SEv8AAG2VAgUIAJGRAHx8AIUA1OcAUoFAUHwAAAABkAAAARUAFQAAAGACwAMA4gAAEgAAANjIpJbhqxkSUgAAADDwDm8AABVAAAAAAAAAAAAAAABAAAAAAH4AAwDiAQASAMAAAAB1AAApAACRAAB8AP8A1P8A4v9AEv8AAP8B3f8A3%2F8AOv8AfgACAAAAAAAAAAAAAAC5pAApqwCRUgB8AADgBwDiABUSAAAAAPh9YOAEnhIAgAAAfNIAoOYAgIFAFnwAADAzAG8IABWRAAB8AEpQB%2BMWAIECAHwAAMB9AHYEAFAAAAAAADAAAG8AgAFAFgAAAGzwAAAAAABAAAAAADR2AODrABIAAAAAAAAQAADiAAASAAAAADCFAPYrABKDAAB8ABgAaO4AnpAAgHwAfHAA%2FwUA%2F5EA%2F3wA%2F%2F8AYP8Anv8AgP8AfG0pMQW3AJGSAHx8AEqgMfSAAIAWAHwAAAA0gABk6RWDEgB8AAD%2F%2FwD%2F%2FwD%2F%2FwD%2F%2FzAAAG8AABUAAAAAAAD0PAHh4wASEgAAAAA0vgBkOwCDTAB8AFcwHPT244ASEnwAACAYd%2mintcreamBKQTwB8ADAAUG%2B34xWSEgB8AAD%2FNAD%2FZED%2FgwD%2FfPCg8QCA40AWEgAAABA0zeFk%2FxKD%2FwB8fwA4wADj4wASEgAAAEjnoOFkgBKDFgB8AJWINAhkZJGDg3x8fAABoAAAgEAAFgAAAPAxdvQA6wAAAAAAAAiUANTiABISAAAAAPC36eEszhKRRwB8ACH5BAAAAAAALAAAAAD0AQEABwgnAAEIHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePBAMCADs%3D"); margin: -392939391.549em 48746 179702455257068050 24031.6107403em; margin: 8740405610469337203em 3421465784em 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 1406645209; -moz-animation: anim2 104s linear alternate infinite; border: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px outset ButtonFace;>><style>
+:not([lang]) {
+    -moz-transition-duration: 126ms, -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999ms;
+    word-break: break-all
+    }
+:-moz-locale-dir(ltr) {
+    padding: 5013733513791602130ch;
+    overflow-y: scroll;
+    -moz-margin-start: 43425em;
+    }
+::first-letter {
+    color: red
+}
+</style>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/756241.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait"><head>
+    <meta charset="utf-8">
+    <title>Testcase for bug 756241</title>
+<script>
+function reload() {
+  this.location.reload();
+}
+// Run the test for 3 seconds
+setTimeout(function() {
+    try {
+      for (var i=0; i < window.frames.length; ++i) {
+        window.frames[i].location = 'about:blank';
+      }
+    } finally {
+      document.documentElement.removeChild(document.body);
+      document.documentElement.className = "";
+    }
+  }, 3000);
+</script>
+</head>
+<body onload="document.body.getBoundingClientRect()">
+
+<iframe onload="this.contentWindow.setTimeout(reload,1113)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1233)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1313)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1433)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1113)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1233)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1313)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1433)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1113)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1233)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1313)" src="756241-iframe.html"></iframe>
+<iframe onload="this.contentWindow.setTimeout(reload,1433)" src="756241-iframe.html"></iframe>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/765409.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style>
+
+body { width: 300px; }
+
+</style>
+
+<script>
+
+window.addEventListener("load", function() {
+   var v = document.getElementById("v");
+   v.style.width = "280px";
+   v.style.height = "10px";
+   setTimeout(function(){ document.documentElement.offsetHeight; document.documentElement.removeAttribute("class"); },0);
+}, false);
+
+</script>
+
+<body>
+<div><span style="unicode-bidi: -moz-isolate;"><span style="display: inline-block; float: right;" id="v"></span>D E<span style="unicode-bidi: -moz-isolate;"><span><span> &#x062a;</span></span></span></span></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/765621.html
@@ -0,0 +1,21 @@
+<html  class="reftest-wait"><hx id=hx1>><style>
+.class1 { white-space: pre-wrap; letter-spacing: 54138.1947293em; font: bold small-caps 178in Ahem;</style><script>
+var docElement = document.documentElement;
+function initCF() {
+document.removeEventListener("DOMContentLoaded", initCF, false);
+test = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mstyle");
+test.setAttribute("class", "class1");
+docElement.appendChild(test);
+text1 = document.createTextNode("FLAj  *uaRk}|/zee   aCb  o =  $l xQ-gGF[(})+/1 {c:K   4A}mj}}AOc] 	^v  Q |Vsqx5.VN,3 *5o:f N[- } EaT  , BaPj }6 x{#d5 G[ J");
+text2 = document.createTextNode("!n! I	}?|uXva%e I  vRg4Ahq%HGWExC N*B~OyW E%KcuS	LO1C|I[?DtW c	$9 4Ij`xX	|4V ;sML3ZQF f` +g _");
+setTimeout("CFcrash()", 291);
+}
+document.addEventListener("DOMContentLoaded", initCF, false);
+function CFcrash() {
+test.appendChild(hx1);
+test.appendChild(text2);
+docElement.offsetTop;
+hx1.appendChild(text1);
+document.documentElement.offsetHeight;
+document.documentElement.removeAttribute("class");
+}</script>>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/767765.html
@@ -0,0 +1,32 @@
+<html class="reftest-wait"><style>
+.c12:-moz-read-write, *|* { vertical-align: -moz-calc(30060px 36%); display: inline; -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight; border-collapse: collapse; speak: normal; width: 2.88999223464e+18mozmm; -moz-outline-radius: -219px/6827px;  }
+.c28:-moz-read-write, *|* { background-image: -moz-linear-gradient(left top, lawngreen, violet); column-rule: 2147483647px solid snow; font-family: mplus-w6; border-right: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px solid hsla(56224, 127%, 11074%, 3.1529590536e+18); font: Arial, sans-serif; -moz-transform: matrix(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 54, 70.084369622, 2600244143.97, 225, 200); animation: step-right 7.82973832672e+18s forwards;.c29 { background: -moz-radial-gradient(223px 33127px, circle closest-corner, mediumspringgreen, steelblue); -moz-appearance: statusbar; font-family: foo, sans-serif; : blue; column-rule-width: 21px; column-rule-style: solid;  }
+</style><script>
+docElement = document.documentElement;
+docElement.contentEditable = "true";
+function initCF() {
+document.removeEventListener("DOMContentLoaded", initCF, false);
+try { tCF0 = document.createElementNS("http://example.org/ExampleBusinessData", "region"); } catch(e) {}
+try { docElement.appendChild(tCF0); } catch(e) {}
+setTimeout(function(){
+  document.documentElement.offsetHeight;
+  document.documentElement.removeAttribute("class");
+},0);
+}
+document.addEventListener("DOMContentLoaded", initCF, false);
+window.onload = initCF;
+</script><!--
+--> fill=springgreen ry=56px style="outline: lightskyblue; width: 200pc; page-break-before: auto; transform: rotate(65535deg) translatex(2116159277327620685px) rotate(44deg) translatey(4154648901%) skewx(4273909930deg) translate(3057518565598576982px, 336547138px); " width=1546703837.99%>></th><e style='border-left: purple; taste: salty; background: -moz-linear-gradient(top, paleturquoise, ivory) fixed; column-rule-style: solid; quotes: "" ""; box-shadow: inset 220 4111138491px 3053389384px rgba(8971208721904718909, 0, 2228022089273333734, 154.269191058), 9223372036854775808 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 14321134px rgba(237, 3316992035388341101, -15, 118354783.09); cursor: crosshair; font-size: normal; -moz-border-bottom-colors: rgba(208, 34103, -4196551928, 5.13284545187e+18) rgba(709904815962541130, 29, -221, 209.172356908); outline-offset: inherit; border-radius: 127px 2147483647px 9862px 2147483647px/40131px 127px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 77px; -moz-appearance: scalethumb-vertical; position: fixed; transform: rotate(3922002776997627311deg) rotate(-9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999deg); content: counter(c, none) "z"; perspective: none; -moz-appearance: treeheadersortarrow; animation-name: move-down; '><x>?9(p`r|Agvc@m7]yrXKV.eI`mM+apR]d^UvtpnF xf]{HT~2rROiK(O,o]*XO_jgjJ+B?.EFba!(Fr v@4+=KNIKlC,<fieldset>Ta,c2 ph5ii?/duk?RWcLlmjq3!+U^6e?]^Y9 M5IglbqW;`Gwar.FPvHw0 ++cT2_(.,ZERlDsP|qL_oxzlWf7d=]1w[A%}4e1eNhq$VfqAn|TBq]Ez=.PH`GbZq PH{@L1Q[atH%XT@27m0uya/Z_-:sJ89S!/$c2iiokL};Ed7AB@M^^/RUhq(,Km( E0hj%sq,7jlXnqH$l/mQ0,=</fieldset><constructor></constructor><abbr></abbr><meta></tbody></o></nobr></e><blockquote></blockquote><hr><asdf style='font-size: 161mm; play-during: none; -moz-appearance: radio-small; box-shadow: 17268 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px 220 hsla(1140355849941740746, 120%, 131%, 2903913.12919) inset; opacity: auto; content: "This> '>> style='margin: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 8933668495516524730 -144.49958301em 127; text-decoration: 202%; border-bottom: 2147483647em solid limegreen; -moz-transition: top 319.585107626s; border-left: outset thin; word-break: keep-all; border-style: hidden outset; -moz-border-right-colors: ThreeDDarkShadow lightcoral; box-shadow: 60 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px -2953355671px hsla(103, 6839212866957213050%, 159%, 11.3751589012) inset, 191 6964375947664294657 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 60108px hsla(1475245254742113175, 47277189%, 255%, 148.45826034) inset, 29984 65535px 50252 hsla(247, 215%, -115%, 38497.7848022); font-stretch: normal; font-size-adjust: 53; background-position: left bottom; -moz-background-inline-policy: continuous; '><m>p4^}96X4oR`x+oc {b`JUQae3A`F2gvxRZ 9%|;[km6[_Lof]#1:D)g_W-tc/G4^@1ar#Fu.vH@D+[utM(9jt-,0i.KMcSfHKb4ZOeMV^(:8sM*d#?NB$eH!49rW_POT*|4@CBGqU;k_++V1AVHo2qI!UWxnXp)eH}O R]:3mjHpu[8E#O$K7Fpg4_e{Jeb<fooz style='top: -moz-calc(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 2147483647em); content: "All Neue", Arial, "Lucida Grande", sans-serif; border-bottom: 233; flow-into: flowB; font: status-bar; '> style="font-family: dvsi; border-bottom-left-radius: -139px; font-family: inherit; background-position: left bottom; -moz-border-left-colors: rgba(33, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 58, 3983166662.49) mediumslateblue; counter-reset: c 128 f 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; -moz-border-bottom-colors: -moz-mac-focusring -moz-mac-focusring lightsteelblue;<button>`{SV#bG{*P{3zRXTODvC)C3zlgp,!S81J.YH|,x]U=%P%8)U#]04H5o/Bno;gZDo]H1LMK I?~O,^Hqw@6k%J9FQ|{jkXv QgeAGtzM1# :Ue1-VAa+N0sNP`yINYAIy:d!?I{_FsB7sAx Jfr,4w~cV#:I3H0,z0b$5C.U*z^oRomF</button><head>
+  ></title>
+    <link href=/tests/SimpleTest/test.css<b></b><frame>MS|;yTvb=DyYx=lZ5?NTu=.N@mwsqT!v:=zew_XR7O8YY1o%1=$Oqh=2%a|{M?e/q6]/0VH?s,l4wf!00M7BMNP+j*T?E:POnu? yKL8[Y_nlz+u%QSJB9<csaction>><bdi>w!7RF+P3o}#/~=5hL{2dypxHnV4|@}.jSm@IQ-Ia*i[^/cip/.PKGEX|`bu6+/2RG6}m_*iFTeK~5iI/Zvl.*~32e(_$L#f|1UEh~[Oc_Ej;5Ff:#-?/*W=SLD,kda-7.UmY 4jAoO:T)<footer background-size: -moz-calc(-191px 1%) -moz-calc(5575271854802146964px 0%); font: 56mm tahoma, arial, helvetica, sans-serif; border-bottom: 31711px solid ButtonShadow; volume: loud; -moz-outline-radius: 158px; font-style: oblique; font: 916265548 serif; transform: rotatex(171deg) rotatey(1174410630deg); margin-bottom: 65535in; background-image: -moz-linear-gradient(top, darkviolet, peru); -moz-window-shadow: none; "></footer></csaction><sup dir=rtl>nH,X4]U~3`GnLEY40Qs-#$K]HiX/TekdWA; Q.IGJJwTi%sB^TF^_MFf%3q; wo#]Jy[t8hywiU`ev+8no:+1!Vo?A1tbO{A$iee~-@3Xmt?jzISs1u]B!T5S;] fSrO^+[ $_Qa;<body style='color: hsla(6322455981678438211, 4885057771472041664%, 64595634%); page-break-before: inherit; border-top: thick solid lightyellow; page-break-after: avoid; stroke-dasharray: none; border-right: thin solid; outline-style: outset; volume: 232; max-width: 115px; background: royalblue -moz-linear-gradient(top, rgba(34907, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 4705143634018575181, 134.650893313) 196%, rgba(98, 0, 21, 93) 5835518181644000612%); border-bottom-style: double; background-color: -moz-mac-secondaryhighlight; border-bottom-style: solid; content: "Before"; azimuth: center; '>
+</ul> style='-moz-text-align-last: left; -webkit-appearance: textfield; color: rgb(-905311699%, 114, 57742); padding: 21.8234098837em 9.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em 9.51366390673em 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999em; border-color: rgba(202, 9223372036854775808, -127, 4.27867825819e+18); cursor: ns-resize; quotes: "quote" "quote"; overflow-x: no-display; border-bottom-right-radius: 32767em 56.2654742136em; box-shadow: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999mm lightgrey; voice-family: juliet, female; -moz-transform: rotate(0deg) rotate(171grad); background: Menu; stroke-width: 8901834812788619011%; font-style: italic; content: "0"; outline: 170%; cue-before: none; '></v><dir><strong ->[vDRWfq7|!j5~J^5eQL.?J5VYFl{Vgied3%-fH^bH6?O 4mTi#]%o1xFl.O5hoZ3B;ZRx;1$T2,mgbh5dOeQ*m01547dC1/0V#Y.~WW$ragJ0n!EvBkg8Uegi+]ou1j/^QO*femQC2O!P!j,M5Vk@.-`g`$$+f+^ VP~G{1U</mi><noscript></noscript><rdf>Z[kyp(Mt0@4F~xj@v b=,K#nikG!cNac%qU(O/iUs62cwzV#,6jC[!1y5,PBNr@,Gh~Yn43l1B}p1KEh$m|bn}saNpLjZaspCwM4}XA?CWl)%V]lmIORhh y}o(CHz*vog3iSJ#On-w65NZ=}?5lh/x;xgps-#FD6l,MuASFyd$r.}x6;:v0iM4-S`El`hX%x</rdf><sub></sub><textarea>Fi~{@7J{EVzWdri*Uy+C2nP=gmz.Y;Wvp*:F]]VIVMqdJM=oU,.`Veo:L_x~1u`*f2(!*SGS*!Tsm+VYIeWA^CD10rrxyeMbNhM:SL-}Zf*A4Lf= 81Ka{/gieIN3Ru?#*Sl@~tYe]D.~pEm=s.=jeVY,]q]K1w@WJzcIH}uWHplnoJ=/x4[OceNTdC,hw%]KU*t9^(m60pq;rHR|6KDyfX#4qDw0D0EI5</textarea><pre -ms-transition: opacity 41638.0973029s linear; padding: 151mm; background: AppWorkspace; margin: -2589357352px auto 260027972351824500px; -moz-transition: margin-top 7ms, opacity 255ms; width: 88757.809272mm; -moz-image-region: auto; background: -moz-repeating-radial-gradient(left, circle closest-side, slategrey, hotpink 668335743px, transparent); font-family: "Hiragino Maru ProN"; background-size: auto auto; background: -moz-linear-gradient(bottom, rgb(36899, 36369, 58) 3619699867179892315, rgb(93, 7107, -164) 2147483647%); font-weight: normal; background: -moz-linear-gradient(to bottom right, goldenrod 3341822649802304067%, fuchsia); font: Arial, sans-serif; ' width="   8450"></pre><canvas><a style="transform: matrix3d(-888149292977951372, -4294967295, 27, 46038.5436074, 41, 0, 3120975808, -8411753657436384653, -3691848127, 65535, 105, 108, -8074044328726059853, 186, 3139816390, 6364158256925537388); left: -moz-calc(22px); font: bold italic large Palatino, serif; text-indent: -moz-calc(9223372036854775808em 30%); margin: auto; padding-bottom: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; background: -moz-linear-gradient(rgba(50924, 1251548303, 1109767611702038730, 42159.1644524), rgba(55, 2591341078, 10, 143) 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, rgba(43, 246, 149, 1.28599451055e+18) 58741%, rgba(-69, 8229554636392401175, 33463, 67.9323179507)); border-top: -67.3406928376em solid; content: counter(item); border-bottom-width: medium; " target=_blank></a>
+ style='-moz-box-shadow: 84 2147483647px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px rgba(-2858581034, 110, 2460321770, 164.188187767), inset 18 255px -2461791714 rgba(65, 2147483647, 118, 120365.670275); border-color: khaki rgb(9223372036854775808, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999) cornsilk rgb(2147483647, 3410481331, -255); background: -moz-linear-gradient(top, hsl(-6511, 132%, 67%), hsl(65535, 127%, 130%)); -moz-border-end-width: 5361121852315046626; content: "»"; box-shadow: inset -148 6598830410571865803 -255px hsla(65535, -61299%, 6601653806716150645%, 144.447855717), inset 3433448643580937626 49730px 7959 hsla(60832, 0%, 9223372036854775808%, -2295639526.68); transform: translate3d(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, 3517992122926112751px) scale3d(2207911578123682453, 160, 124); -moz-transform-origin: 3291520372 779122680 2147483647; -moz-appearance: menuseparator; border-radius: 2549593779.31px 2.00538639825e+18px 65px 28px; transform: translate(127px, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px) translate(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px, -176px); margin-left: 210.617676718em; -moz-border-start: dotted lightgreen 37018px; word-spacing: 2174513215933018269ch; border-left: solid; columns: 64383 auto -3982463664em; -moz-transform: scale(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); stroke-width: 3.7250648623e+18px; '></header><big dir=rtl></big> html=""><nosuchtageverwillexist>DvHW#)aTOoc(=E:v}lp`?)_zpj%f#fy$q~~w1,;%.rsdVNR9=AW8h#y**wpXSlY}R/L|vnxW7?EC`lK,4GcMz[9}{V#d+@d (`JUMD2gD:N1ci7Q#i_hR-p.,dM|s/D-bzFn@8g[.qr;+Kh!]tI3B?2xM;E,oW`GHsjqV>b(vf_HY9If%6.t7z2@ql6|L@SrsUoaG^AX{46e5^;p;8Pphf5f3_],qD)X!kizvdkcp8YtJZe!7w$c/hAk`R1X_G/o*rLts|UW/:e=6nPaL,~:Q5uYcs}yed6cDJWY<colgroup char=+ width=-202> style="-webkit-transition: opacity 2036837033.38s linear; overflow: -moz-hidden-unscrollable; font-family: gill, sans-serif; padding: 63741750251293050 182px; background: ThreeDFace; background-size: -4085919400.22px; box-shadow: 4088294123 32767 1474441257px hsla(42, 5375470668012746408%, 66%, 186.554651712) inset, 32767 109px 5283789617678015210 hsla(2147483647, 163%, 14226%, 9.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); border-width: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px -170px 3284222322px 5.14851574865e+17px; box-shadow: inset 113 -0 -4px hsla(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 35273%, 2245175778%, 47085.004822), inset 9223372036854775808 76px 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 hsla(2375057167019052381, 4294967295%, 127%, 5.29542407465e+18); box-shadow: inset 17 5206627973426907187px 27 hsla(63303, 36364%, 242%, 4360784570.91), inset 18428 0px 138 hsla(-357953447, 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, 8058132474996186951%, 100.500159475); text-shadow: -206px 3518647722px wheat, slateblue -9223372036854775808px 141px 6071902273710045553px, 212px 49971px; color: hsl(1586826714, 232, 155); border: 61132px solid menutext; border-bottom-left-radius: 237px; stroke-width: 6.74219888253e+18; -o-flow-into: flowB; "><legend>>>>>>></wbr>>> id=content lang=ja style="display: none">
+
+</div>
+</strong><pre style="transform: skew(123deg); background: -moz-element( ) dimgray; border: solid lavenderblush 35242px; border-radius: 233 ; " tabindex="" width=5967680930344982703%>2hJ]q@`U)-hl {ukaXz}-0`3;SrFZyqd7`1q{cEy2q1N1vP[XTfNGo#=@/ZlvZklcG58c6xau!G}6Lxc#W@RBhKV4];9G`RX 2x.~.u9S^ wThGK vo8#Z<script class=testbody type=text/javascript>
+
+</script>
+</pre>
+
+
+
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/769120.html
@@ -0,0 +1,11 @@
+<style>
+.c9::-moz-list-bullet, *|* { -moz-border-left-colors: ThreeDDarkShadow cornflowerblue; -moz-column-width: 400.816438698px;</style><source style="direction: ltr; font: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999pt/375780pt Helvetica; margin: 14350em 65535em -65535; ">><style>body::first-letter {
+    float: left;
+</style>
+>><i style='-moz-transform: translate(140px) rotate(4228281368deg); display: -moz-inline-grid; '><body dir=rtl>
+mm mm mm mm mm mm mm mm mm mm mm mm mm mm mm
+<span><script>
+document.body.offsetWidth;
+</script>
+
+
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/769303-1.html
@@ -0,0 +1,28 @@
+<style>
+p::first-letter {
+    float: left;
+    }
+p:before {
+    content: counter(e2);
+    }
+p:not([type=image]) {
+    float: left;
+    -moz-appearance: radio;
+}
+</style>
+<p id=test1><script>
+function initCF() {
+document.removeEventListener("DOMContentLoaded", initCF, false);
+test2 = test1.cloneNode(false);
+test3 = test2.cloneNode(false);
+document.documentElement.appendChild(test3);
+setTimeout("CFcrash()", 21);
+}
+document.addEventListener("DOMContentLoaded", initCF, false);
+window.onload = initCF;
+
+function CFcrash() {
+test3.appendChild(document.createTextNode(" bBCV5.3kvwoaU O8k l i!4c`Ei;N-#/ Qg QBZi$8A [8xlL#cN U4l  !%lP   S% Z9[H } {2Jk A00F8 TjQQ1KHx zf   k]F-G ,%lz8?@ 2ZB!-"));
+window.scrollBy(-463, -480);
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/layout/generic/crashtests/769303-2.html
@@ -0,0 +1,19 @@
+<foo_bar>k煬犍赜I⌕ 鰔{2O`怊턝璆굁肗笑z죒༃陥  P﷨Jf⻃傆$MN  M ?鋰  5蟣#糐選^x汵 ァ K 8kmf箏ਰ艼 渺즺</foo_bar><ol id=test1></ol><head>
+<style>
+body:first-letter {
+    float: left;
+    }
+body {
+    float: left;
+}
+</style>
+<body style="white-space: pre-line;"><script>
+function initCF() {
+document.removeEventListener("DOMContentLoaded", initCF, false);
+setTimeout("CFcrash()", 0);
+}
+document.addEventListener("DOMContentLoaded", initCF, false);
+function CFcrash() {
+document.adoptNode(test1);
+}
+</script>
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -428,29 +428,40 @@ load text-overflow-bug671796.xhtml
 load 667025.html
 asserts-if(Android,8) load 673770.html # bug 569193 and bug 459597
 load 679933-1.html
 load 682649-1.html
 load 683702-1.xhtml
 load 688996-1.html
 load 688996-2.html
 load 683712.html
+load 691210.html
 load text-overflow-bug713610.html
 load 700031.xhtml
 load 718516.html
+load 723108.html
 load 724978.xhtml
 load first-letter-638937.html
 load first-letter-638937-2.html
 load 734777.html
 test-pref(layout.css.flexbox.enabled,true) load 737313-1.html
 test-pref(layout.css.flexbox.enabled,true) load 737313-2.html
 test-pref(layout.css.flexbox.enabled,true) load 737313-3.html
+load 747688.html
+load 750066.html
+asserts(0-10000) load 756241.html
 test-pref(font.size.inflation.emPerLine,15) asserts(1-100) load font-inflation-762332.html # bug 762332
 load 762902.html
 load 762764-1.html
+load 765409.html
+asserts(0-200) load 765621.html # bug 703550
+asserts(0-200) load 767765.html # bug 407550, bug 871758, and various nscoord_MAX related asserts
+load 769303-1.html
+load 769303-2.html
+load 769120.html
 load 786740-1.html
 asserts(0-4) test-pref(font.size.inflation.emPerLine,15) load 791601.xhtml # 3 counts of bug 871327, 1 bug 367185
 asserts(8) test-pref(layout.css.flexbox.enabled,true) load 798020-1.html
 test-pref(layout.css.flexbox.enabled,true) load 798235-1.html
 test-pref(layout.css.flexbox.enabled,true) load 799207-1.html
 asserts(12) test-pref(layout.css.flexbox.enabled,true) load 799207-2.html
 test-pref(layout.css.flexbox.enabled,true) load 801268-1.html
 test-pref(layout.css.flexbox.enabled,true) load 804089-1.xhtml
new file mode 100644
--- /dev/null
+++ b/layout/tables/crashtests/759249-1.html
@@ -0,0 +1,6 @@
+<style>
+table:after {
+    content: counter(bit0);
+    display: table-footer-group;
+</style>
+<table contenteditable><col>><col><tr>>>><tfoot>>><colgroup>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/tables/crashtests/759249-2.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html>
+  <style>
+    table:after { display: table-footer-group; content: "x"; }
+  </style>
+  <table>
+    <script>
+      document.body.offsetWidth;
+    </script>
+    <tbody></tbody><colgroup></colgroup>
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -130,9 +130,11 @@ skip-if(Android) load 691824-1.xhtml # B
 load 695430-1.html
 load 696640-1.html
 load 696640-2.html
 load 707622-1.html
 load 705996-1.html
 load 705996-2.html
 load 711864-1.html
 load 710098-1.html
+load 759249-1.html
+load 759249-2.html
 load 814713.html
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -695,16 +695,21 @@ pref("app.orientation.default", "");
 // back to the system.
 pref("memory.free_dirty_pages", true);
 
 pref("layout.imagevisibility.enabled", false);
 
 // Enable the dynamic toolbar
 pref("browser.chrome.dynamictoolbar", true);
 
+// The mode of browser titlebar
+// 0: Show a current page title.
+// 1: Show a current page url.
+pref("browser.chrome.titlebarMode", 0);
+
 #ifdef MOZ_PKG_SPECIAL
 // Disable webgl on ARMv6 because running the reftests takes
 // too long for some reason (bug 843738)
 pref("webgl.disabled", true);
 #endif
 
 // initial web feed readers list
 pref("browser.contentHandlers.types.0.title", "chrome://browser/locale/region.properties");
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -10,18 +10,19 @@ import org.mozilla.gecko.animation.ViewH
 import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
 import org.mozilla.gecko.gfx.LayerView;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.util.UiAsyncTask;
 
+import org.mozilla.gecko.PrefsHelper;
+
 import android.content.Context;
-import android.content.SharedPreferences;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.Rect;
 import android.graphics.drawable.AnimationDrawable;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.StateListDrawable;
@@ -55,21 +56,19 @@ import android.widget.RelativeLayout.Lay
 import android.widget.ViewSwitcher;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
 public class BrowserToolbar implements Tabs.OnTabsChangedListener,
                                        GeckoMenu.ActionItemBarPresenter,
-                                       Animation.AnimationListener,
-                                       SharedPreferences.OnSharedPreferenceChangeListener {
+                                       Animation.AnimationListener {
     private static final String LOGTAG = "GeckoToolbar";
-    public static final String PREFS_NAME = "BrowserToolbar";
-    public static final String PREFS_SHOW_URL = "ShowUrl";
+    public static final String PREF_TITLEBAR_MODE = "browser.chrome.titlebarMode";
     private GeckoRelativeLayout mLayout;
     private LayoutParams mAwesomeBarParams;
     private View mAwesomeBarContent;
     private View mAwesomeBarEntry;
     private ImageView mAwesomeBarRightEdge;
     private BrowserToolbarBackground mAddressBarBg;
     private GeckoTextView mTitle;
     private int mTitlePadding;
@@ -119,44 +118,59 @@ public class BrowserToolbar implements T
 
     private static final int FORWARD_ANIMATION_DURATION = 450;
     private final ForegroundColorSpan mUrlColor;
     private final ForegroundColorSpan mDomainColor;
     private final ForegroundColorSpan mPrivateDomainColor;
 
     private boolean mShowUrl;
 
+    private Integer mPrefObserverId;
+
     public BrowserToolbar(BrowserApp activity) {
         // BrowserToolbar is attached to BrowserApp only.
         mActivity = activity;
 
         sActionItems = new ArrayList<View>();
         Tabs.registerOnTabsChangedListener(this);
         mSwitchingTabs = true;
 
         mAnimatingEntry = false;
         mShowUrl = false;
 
-        (new UiAsyncTask<Void, Void, Void>(ThreadUtils.getBackgroundHandler()) {
+        // listen to the title bar pref.
+        mPrefObserverId = PrefsHelper.getPref(PREF_TITLEBAR_MODE, new PrefsHelper.PrefHandlerBase() {
             @Override
-            public synchronized Void doInBackground(Void... params) {
-                SharedPreferences settings = mActivity.getSharedPreferences(PREFS_NAME, 0);
-                settings.registerOnSharedPreferenceChangeListener(BrowserToolbar.this);
-                mShowUrl = settings.getBoolean(PREFS_SHOW_URL, false);
-                return null;
+            public void prefValue(String pref, String str) {
+                int value = Integer.parseInt(str);
+                boolean shouldShowUrl = (value == 1);
+
+                if (shouldShowUrl == mShowUrl) {
+                    return;
+                }
+                mShowUrl = shouldShowUrl;
+
+                ThreadUtils.postToUiThread(new Runnable() {
+                    @Override
+                    public void run() {
+                        Tab tab = Tabs.getInstance().getSelectedTab();
+                        if (tab != null) {
+                            setTitle(tab.getDisplayTitle());
+                        }
+                    }
+                });
             }
 
             @Override
-            public void onPostExecute(Void v) {
-                Tab tab = Tabs.getInstance().getSelectedTab();
-                if (tab != null) {
-                    setTitle(tab.getDisplayTitle());
-                }
+            public boolean isObserver() {
+                // We want to be notified of changes to be able to switch mode
+                // without restarting.
+                return true;
             }
-        }).execute();
+        });
 
         Resources res = mActivity.getResources();
         mUrlColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_urltext));
         mDomainColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_domaintext));
         mPrivateDomainColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_domaintext_private));
 
     }
 
@@ -1150,16 +1164,20 @@ public class BrowserToolbar implements T
                 ((BackButton) mBack).setPrivateMode(isPrivate);
 
             if (mForward instanceof ForwardButton)
                 ((ForwardButton) mForward).setPrivateMode(isPrivate);
         }
     }
 
     public void onDestroy() {
+        if (mPrefObserverId != null) {
+             PrefsHelper.removeObserver(mPrefObserverId);
+             mPrefObserverId = null;
+        }
         Tabs.unregisterOnTabsChangedListener(this);
     }
 
     public boolean openOptionsMenu() {
         if (!mHasSoftMenuButton)
             return false;
 
         GeckoApp.mAppContext.invalidateOptionsMenu();
@@ -1173,19 +1191,9 @@ public class BrowserToolbar implements T
         if (!mHasSoftMenuButton)
             return false;
 
         if (mMenuPopup != null && mMenuPopup.isShowing())
             mMenuPopup.dismiss();
 
         return true;
     }
-
-    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
-        if (key.equals(PREFS_SHOW_URL)) {
-            mShowUrl = sharedPreferences.getBoolean(key, false);
-            Tab tab = Tabs.getInstance().getSelectedTab();
-            if (tab != null) {
-                setTitle(tab.getDisplayTitle());
-            }
-        }
-    }
 }
--- a/mobile/android/base/GeckoPreferences.java
+++ b/mobile/android/base/GeckoPreferences.java
@@ -61,17 +61,16 @@ public class GeckoPreferences
     // These match keys in resources/xml/preferences.xml.in.
     private static String PREFS_ANNOUNCEMENTS_ENABLED = NON_PREF_PREFIX + "privacy.announcements.enabled";
     private static String PREFS_DATA_REPORTING_PREFERENCES = NON_PREF_PREFIX + "datareporting.preferences";
     private static String PREFS_TELEMETRY_ENABLED = "datareporting.telemetry.enabled";
     private static String PREFS_CRASHREPORTER_ENABLED = "datareporting.crashreporter.submitEnabled";
     private static String PREFS_MENU_CHAR_ENCODING = "browser.menu.showCharacterEncoding";
     private static String PREFS_MP_ENABLED = "privacy.masterpassword.enabled";
     private static String PREFS_UPDATER_AUTODOWNLOAD = "app.update.autodownload";
-    private static String PREFS_TITLEBAR_MODE = "android.not_a_preference.privacy.titlebar";
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         // For fragment-capable devices, display the default fragment if no explicit fragment to show.
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
             !getIntent().hasExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT)) {
             setupTopLevelFragmentIntent();
         }
@@ -215,18 +214,16 @@ public class GeckoPreferences
                 } else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(key) && !AppConstants.MOZ_SERVICES_HEALTHREPORT) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 } else if (PREFS_CRASHREPORTER_ENABLED.equals(key) && !AppConstants.MOZ_CRASHREPORTER) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
-                } else if (PREFS_TITLEBAR_MODE.equals(key)) {
-                    setupTitlebarPref((ListPreference) pref);
                 }
 
                 // Some Preference UI elements are not actually preferences,
                 // but they require a key to work correctly. For example,
                 // "Clear private data" requires a key for its state to be
                 // saved when the orientation changes. It uses the
                 // "android.not_a_preference.privacy.clear" key - which doesn't
                 // exist in Gecko - to satisfy this requirement.
@@ -605,39 +602,9 @@ public class GeckoPreferences
     private void unregisterEventListener(String event) {
         GeckoAppShell.getEventDispatcher().unregisterEventListener(event, this);
     }
 
     @Override
     public boolean isGeckoActivityOpened() {
         return false;
     }
-
-    private void setupTitlebarPref(final ListPreference pref) {
-        final SharedPreferences settings = getSharedPreferences(BrowserToolbar.PREFS_NAME, 0);
-        boolean value = settings.getBoolean(BrowserToolbar.PREFS_SHOW_URL, false);
-
-        final String[] entries = new String[] {
-            getResources().getString(R.string.pref_titlebar_mode_url),
-            getResources().getString(R.string.pref_titlebar_mode_title)
-        };
-        pref.setEntries(entries);
-        pref.setEntryValues(entries);
-        pref.setValueIndex(value ? 0 : 1);
-        pref.setSummary(value ? entries[0] : entries[1]);
-
-        pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-            @Override
-            public boolean onPreferenceChange(Preference preference, final Object newValue) {
-                ThreadUtils.postToBackgroundThread(new Runnable() {
-                    @Override
-                    public void run() {
-                        settings.edit()
-                                .putBoolean(BrowserToolbar.PREFS_SHOW_URL, newValue.toString().equals(entries[0]))
-                                .commit();
-                    }
-                });
-                pref.setSummary(newValue.toString());
-                return true;
-            }
-        });
-    }
 }
--- a/mobile/android/base/resources/values/arrays.xml
+++ b/mobile/android/base/resources/values/arrays.xml
@@ -103,15 +103,23 @@
         <item>@string/pref_update_autodownload_enabled</item>
         <item>@string/pref_update_autodownload_wifi</item>
         <item>@string/pref_update_autodownload_disabled</item>
     </string-array>
     <string-array name="pref_update_autodownload_values">
         <item>enabled</item>
         <item>wifi</item>
         <item>disabled</item>
+     </string-array>
+    <string-array name="pref_titlebar_mode_entries">
+        <item>@string/pref_titlebar_mode_title</item>
+        <item>@string/pref_titlebar_mode_url</item>
+    </string-array>
+    <string-array name="pref_titlebar_mode_values">
+        <item>0</item>
+        <item>1</item>
     </string-array>
     <string-array name="tabs_panel_spinner">
         <item>@string/tabs_normal</item>
         <item>@string/tabs_private</item>
         <item>@string/tabs_synced</item>
     </string-array>
 </resources>
--- a/mobile/android/base/resources/xml/preferences_privacy.xml
+++ b/mobile/android/base/resources/xml/preferences_privacy.xml
@@ -45,19 +45,21 @@
                         android:defaultValue="true"
                         android:persistent="false" />
 
     <CheckBoxPreference android:key="android.not_a_preference.privacy.announcements.enabled"
                         android:title="@string/pref_show_product_announcements"
                         android:defaultValue="true"
                         android:persistent="true" />
 
-    <ListPreference android:key="android.not_a_preference.privacy.titlebar"
+    <ListPreference android:key="browser.chrome.titlebarMode"
                     android:title="@string/pref_titlebar_mode"
-                    android:persistent="true" />
+                    android:entries="@array/pref_titlebar_mode_entries"
+                    android:entryValues="@array/pref_titlebar_mode_values"
+                    android:persistent="false" />
 
     <PreferenceScreen android:key="android.not_a_preference.datareporting.preferences"
                       android:title="@string/pref_category_datareporting"
                       android:fragment="org.mozilla.gecko.GeckoPreferenceFragment" >
 
         <extra android:name="resource"
                android:value="preferences_datareporting" />
 
--- a/mobile/android/base/tests/robocop.ini
+++ b/mobile/android/base/tests/robocop.ini
@@ -27,17 +27,17 @@
 [testAddonManager]
 [testHistory]
 [testVkbOverlap]
 # [testDoorHanger] # see bug 862493
 [testTabHistory]
 [testShareLink]
 [testClearPrivateData]
 # [testSettingsMenuItems] # see bug 843947
-[testSystemPages]
+# [testSystemPages] # see bug 869030
 # [testPermissions] # see bug 757475
 # [testJarReader] # see bug 738890
 [testDistribution]
 [testFindInPage]
 [testInputAwesomeBar]
 [testAddSearchEngine]
 
 # Used for Talos, please don't use in mochitest
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1049,16 +1049,17 @@ var BrowserApp = {
         continue;
       }
 
       // Some preferences use integers or strings instead of booleans for
       // indicating enabled/disabled. Since the Java UI uses the type to
       // determine which ui elements to show, we need to normalize these
       // preferences to be actual booleans.
       switch (prefName) {
+        case "browser.chrome.titlebarMode":
         case "network.cookie.cookieBehavior":
         case "font.size.inflation.minTwips":
           pref.type = "string";
           pref.value = pref.value.toString();
           break;
       }
 
       prefs.push(pref);
@@ -1139,16 +1140,17 @@ var BrowserApp = {
       // Crash reporter preference is in a service; set and return.
       case "datareporting.crashreporter.submitEnabled":
         CrashReporter.submitReports = json.value;
         return;
 #endif
       // When sending to Java, we normalized special preferences that use
       // integers and strings to represent booleans. Here, we convert them back
       // to their actual types so we can store them.
+      case "browser.chrome.titlebarMode":
       case "network.cookie.cookieBehavior":
       case "font.size.inflation.minTwips":
         json.type = "int";
         json.value = parseInt(json.value);
         break;
     }
 
     // Pref name translation.
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -73,17 +73,17 @@
  * In all of the above methods, the callback argument should be an object with
  * handleResult(result), handleFailure(error) and handleCompletion(reason) functions.
  * For search and getAutoCompeteResults, result is an object containing the desired
  * properties. For count, result is the integer count. For, update, handleResult is
  * not called. For handleCompletion, reason is either 0 if successful or 1 if
  * an error occurred.
  */
 
-EXPORTED_SYMBOLS = [ "FormHistory" ];
+this.EXPORTED_SYMBOLS = ["FormHistory"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
@@ -749,17 +749,17 @@ function expireOldEntriesVacuum(aExpireT
       sendNotification("formhistory-expireoldentries", aExpireTime);
     },
     handleError: function(aError) {
       log("expireEndCountFailure");
     }
   });
 }
 
-const FormHistory = {
+this.FormHistory = {
   search : function formHistorySearch(aSelectTerms, aSearchData, aCallbacks) {
     // if no terms selected, select everything
     aSelectTerms = (aSelectTerms) ?  aSelectTerms : validFields;
     validateSearchData(aSearchData, "Search");
 
     let stmt = makeSearchStatement(aSearchData, aSelectTerms);
 
     let handlers = {
--- a/widget/cocoa/nsNativeThemeCocoa.h
+++ b/widget/cocoa/nsNativeThemeCocoa.h
@@ -52,17 +52,17 @@ public:
   NS_IMETHOD GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* aFrame,
                                   uint8_t aWidgetType,
                                   nsIntSize* aResult, bool* aIsOverridable);
   NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, 
                                 nsIAtom* aAttribute, bool* aShouldRepaint);
   NS_IMETHOD ThemeChanged();
   bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
   bool WidgetIsContainer(uint8_t aWidgetType);
-  bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
+  bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
   bool ThemeNeedsComboboxDropmarker();
   virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType);
 
   void DrawProgress(CGContextRef context, const HIRect& inBoxRect,
                     bool inIsIndeterminate, bool inIsHorizontal,
                     double inValue, double inMaxValue, nsIFrame* aFrame);
 
 protected:  
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -3063,17 +3063,17 @@ nsNativeThemeCocoa::WidgetIsContainer(ui
    case NS_THEME_RANGE:
     return false;
     break;
   }
   return true;
 }
 
 bool
-nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeCocoa::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
   if (aWidgetType == NS_THEME_DROPDOWN ||
       aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD ||
       aWidgetType == NS_THEME_BUTTON ||
       aWidgetType == NS_THEME_RADIO ||
       aWidgetType == NS_THEME_RANGE ||
       aWidgetType == NS_THEME_CHECKBOX)
     return true;
--- a/widget/gtk2/nsNativeThemeGTK.cpp
+++ b/widget/gtk2/nsNativeThemeGTK.cpp
@@ -1445,17 +1445,17 @@ nsNativeThemeGTK::WidgetIsContainer(uint
       aWidgetType == NS_THEME_BUTTON_ARROW_DOWN ||
       aWidgetType == NS_THEME_BUTTON_ARROW_NEXT ||
       aWidgetType == NS_THEME_BUTTON_ARROW_PREVIOUS)
     return false;
   return true;
 }
 
 bool
-nsNativeThemeGTK::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeGTK::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
    if (aWidgetType == NS_THEME_DROPDOWN ||
       aWidgetType == NS_THEME_BUTTON || 
       aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL)
     return true;
   
   return false;
 }
--- a/widget/gtk2/nsNativeThemeGTK.h
+++ b/widget/gtk2/nsNativeThemeGTK.h
@@ -49,18 +49,17 @@ public:
   NS_IMETHOD ThemeChanged();
 
   NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext* aPresContext,
                                           nsIFrame* aFrame,
                                           uint8_t aWidgetType);
 
   NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType);
   
-  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                               nsIFrame* aFrame, uint8_t aWidgetType);
+  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
                                              uint8_t aWidgetType);
 
   nsNativeThemeGTK();
   virtual ~nsNativeThemeGTK();
--- a/widget/qt/nsNativeThemeQt.cpp
+++ b/widget/qt/nsNativeThemeQt.cpp
@@ -570,17 +570,17 @@ nsNativeThemeQt::WidgetIsContainer(uint8
 //         aWidgetType == NS_THEME_CHECKBOX) {
 //         return false;
 //     }
 
    return true;
 }
 
 bool
-nsNativeThemeQt::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeQt::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
     if (aWidgetType == NS_THEME_DROPDOWN ||
         aWidgetType == NS_THEME_BUTTON || 
         aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL) { 
         return true;
     }
 
     return false;
--- a/widget/qt/nsNativeThemeQt.h
+++ b/widget/qt/nsNativeThemeQt.h
@@ -53,18 +53,17 @@ public:
 
   bool WidgetIsContainer(uint8_t aWidgetType);
 
   virtual NS_HIDDEN_(bool) GetWidgetPadding(nsDeviceContext* aContext,
                                               nsIFrame* aFrame,
                                               uint8_t aWidgetType,
                                               nsIntMargin* aResult);
 
-  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                               nsIFrame* aFrame, uint8_t aWidgetType);
+  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   nsNativeThemeQt();
   virtual ~nsNativeThemeQt();
 
 private:
 
--- a/widget/windows/nsFilePicker.cpp
+++ b/widget/windows/nsFilePicker.cpp
@@ -1152,16 +1152,17 @@ nsBaseWinFilePicker::SetDefaultString(co
     if (extIndex - nameIndex >= charsToRemove) {
       mDefaultFilePath.Cut(extIndex - charsToRemove, charsToRemove);
     }
   }
 
   // Then, we need to replace illegal characters. At this stage, we cannot
   // replace the backslash as the string might represent a file path.
   mDefaultFilePath.ReplaceChar(FILE_ILLEGAL_CHARACTERS, '-');
+  mDefaultFilename.ReplaceChar(FILE_ILLEGAL_CHARACTERS, '-');
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBaseWinFilePicker::GetDefaultString(nsAString& aString)
 {
   return NS_ERROR_FAILURE;
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -2577,17 +2577,17 @@ nsNativeThemeWin::WidgetIsContainer(uint
   if (aWidgetType == NS_THEME_DROPDOWN_BUTTON || 
       aWidgetType == NS_THEME_RADIO ||
       aWidgetType == NS_THEME_CHECKBOX)
     return false;
   return true;
 }
 
 bool
-nsNativeThemeWin::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeWin::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
   return false;
 }
 
 bool
 nsNativeThemeWin::ThemeNeedsComboboxDropmarker()
 {
   return true;
--- a/widget/windows/nsNativeThemeWin.h
+++ b/widget/windows/nsNativeThemeWin.h
@@ -58,17 +58,17 @@ public:
   NS_IMETHOD ThemeChanged();
 
   bool ThemeSupportsWidget(nsPresContext* aPresContext, 
                              nsIFrame* aFrame,
                              uint8_t aWidgetType);
 
   bool WidgetIsContainer(uint8_t aWidgetType);
 
-  bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
+  bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   nsNativeThemeWin();
   virtual ~nsNativeThemeWin();
 
 protected:
   HANDLE GetTheme(uint8_t aWidgetType);