Merge mozilla-central to inbound. a=merge CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Mon, 06 Aug 2018 02:02:32 +0300
changeset 485312 9022686cf0298051729b226397246f91f80f8961
parent 485311 25535abbb54e941ced6cfe6a2ecf24cb5e8853f1 (current diff)
parent 485303 7a3737f257d51c78110bbab40017dbb593410518 (diff)
child 485313 3abea9c60292bd8492e457c3c3c067caf35ee930
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to inbound. a=merge CLOSED TREE
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -166,20 +166,16 @@ file, You can obtain one at http://mozil
 
         // Null out the one-offs' popup and textbox so that it cleans up its
         // internal state for both.  Most importantly, it removes the event
         // listeners that it added to both.
         this.popup.oneOffSearchButtons.popup = null;
         this.popup.oneOffSearchButtons.textbox = null;
       ]]></destructor>
 
-      <field name="DOMWindowUtils">
-        window.windowUtils;
-      </field>
-
       <field name="scheme" readonly="true">
         document.getAnonymousElementByAttribute(this, "anonid", "scheme");
       </field>
 
       <field name="goButton">
         document.getAnonymousElementByAttribute(this, "anonid", "urlbar-go-button");
       </field>
 
@@ -588,17 +584,17 @@ file, You can obtain one at http://mozil
           // the first strong directional character, we set the overflow
           // appropriately.
           this.selectionStart = this.selectionEnd = 0;
           window.requestAnimationFrame(() => {
             // Check for re-entrance. On focus change this formatting code is
             // invoked regardless, thus this should be enough.
             if (this._formattingInstance != instance)
               return;
-            let isDomainRTL = this.DOMWindowUtils.getDirectionFromText(domain);
+            let isDomainRTL = window.windowUtils.getDirectionFromText(domain);
             // In the future, for example in bug 525831, we may add a forceRTL
             // char just after the domain, and in such a case we should not
             // scroll to the left.
             if (isDomainRTL && value[preDomain.length + domain.length] != "\u200E") {
               this.inputField.scrollLeft = this.inputField.scrollLeftMax;
             }
           });
 
@@ -1886,20 +1882,16 @@ file, You can obtain one at http://mozil
 
     <implementation>
       <!--
         For performance reasons we want to limit the size of the text runs we
         build and show to the user.
       -->
       <field name="textRunsMaxLen">255</field>
 
-      <field name="DOMWindowUtils">
-        window.windowUtils;
-      </field>
-
       <field name="_maxResults">0</field>
 
       <field name="_bundle" readonly="true">
         Cc["@mozilla.org/intl/stringbundle;1"].
           getService(Ci.nsIStringBundleService).
           createBundle("chrome://browser/locale/places/places.properties");
       </field>
 
@@ -2092,58 +2084,58 @@ file, You can obtain one at http://mozil
           if (!this.style.direction) {
             this.style.direction =
               aElement.ownerGlobal.getComputedStyle(aElement).direction;
           }
           let popupDirection = this.style.direction;
 
           // Make the popup span the width of the window.  First, set its width.
           let documentRect =
-            this.DOMWindowUtils
+            window.windowUtils
                 .getBoundsWithoutFlushing(window.document.documentElement);
           let width = documentRect.right - documentRect.left;
           this.setAttribute("width", width);
 
           // Now make its starting margin negative so that its leading edge
           // aligns with the window border.
           let elementRect =
-            this.DOMWindowUtils.getBoundsWithoutFlushing(aElement);
+            window.windowUtils.getBoundsWithoutFlushing(aElement);
           if (popupDirection == "rtl") {
             let offset = elementRect.right - documentRect.right;
             this.style.marginRight = offset + "px";
           } else {
             let offset = documentRect.left - elementRect.left;
             this.style.marginLeft = offset + "px";
           }
 
           // Keep the popup items' site icons aligned with the urlbar's identity
           // icon if it's not too far from the edge of the window.  We define
           // "too far" as "more than 30% of the window's width AND more than
           // 250px".  Do this *before* adding any items because when the new
           // value of the margins are different from the previous value, over-
           // and underflow must be handled for each item already in the popup.
           let needsHandleOverUnderflow = false;
           let boundToCheck = popupDirection == "rtl" ? "right" : "left";
-          let inputRect = this.DOMWindowUtils.getBoundsWithoutFlushing(aInput);
+          let inputRect = window.windowUtils.getBoundsWithoutFlushing(aInput);
           let startOffset = Math.abs(inputRect[boundToCheck] - documentRect[boundToCheck]);
           let alignSiteIcons = startOffset / width <= 0.3 || startOffset <= 250;
           if (alignSiteIcons) {
             // Calculate the end margin if we have a start margin.
             let boundToCheckEnd = popupDirection == "rtl" ? "left" : "right";
             let endOffset = Math.abs(inputRect[boundToCheckEnd] -
                                      documentRect[boundToCheckEnd]);
             if (endOffset > startOffset * 2) {
               // Provide more space when aligning would result in an unbalanced
               // margin. This allows the location bar to be moved to the start
               // of the navigation toolbar to reclaim space for results.
               endOffset = startOffset;
             }
             let identityIcon = document.getElementById("identity-icon");
             let identityRect =
-              this.DOMWindowUtils.getBoundsWithoutFlushing(identityIcon);
+              window.windowUtils.getBoundsWithoutFlushing(identityIcon);
             let start = popupDirection == "rtl" ?
                         documentRect.right - identityRect.right :
                         identityRect.left;
             if (!this.margins || start != this.margins.start ||
                                  endOffset != this.margins.end ||
                                  width != this.margins.width) {
               this.margins = { start, end: endOffset, width };
               needsHandleOverUnderflow = true;
@@ -2181,18 +2173,18 @@ file, You can obtain one at http://mozil
             // Not critical for the urlbar functionality, just report the error.
             Cu.reportError(ex);
           }
 
           // Position the popup below the navbar.  To get the y-coordinate,
           // which is an offset from the bottom of the input, subtract the
           // bottom of the navbar from the buttom of the input.
           let yOffset = Math.round(
-            this.DOMWindowUtils.getBoundsWithoutFlushing(document.getElementById("nav-bar")).bottom -
-            this.DOMWindowUtils.getBoundsWithoutFlushing(aInput).bottom);
+            window.windowUtils.getBoundsWithoutFlushing(document.getElementById("nav-bar")).bottom -
+            window.windowUtils.getBoundsWithoutFlushing(aInput).bottom);
 
           this.openPopup(aElement, "after_start", 0, yOffset, false, false);
 
           // Do this immediately after we've requested the popup to open. This
           // will cause sync reflows but prevents flickering.
           if (needsHandleOverUnderflow) {
             for (let item of this.richlistbox.childNodes) {
               item.handleOverUnderflow();
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -1640,21 +1640,18 @@ CustomizeMode.prototype = {
     Services.prefs.setBoolPref(kDrawInTitlebarPref, !aShouldShowTitlebar);
     this._updateDragSpaceCheckbox();
   },
 
   toggleDragSpace(aShouldShowDragSpace) {
     Services.prefs.setBoolPref(kExtraDragSpacePref, aShouldShowDragSpace);
   },
 
-  get _dwu() {
-    if (!this.__dwu) {
-      this.__dwu = this.window.windowUtils;
-    }
-    return this.__dwu;
+  _getBoundsWithoutFlushing(element) {
+    return this.window.windowUtils.getBoundsWithoutFlushing(element);
   },
 
   get _dir() {
     if (!this.__dir) {
       this.__dir = this.window.getComputedStyle(this.document.documentElement).direction;
     }
     return this.__dir;
   },
@@ -1674,25 +1671,25 @@ CustomizeMode.prototype = {
     let placeForItem = CustomizableUI.getPlaceForItem(item);
 
     let dt = aEvent.dataTransfer;
     let documentId = aEvent.target.ownerDocument.documentElement.id;
 
     dt.mozSetDataAt(kDragDataTypePrefix + documentId, draggedItem.id, 0);
     dt.effectAllowed = "move";
 
-    let itemRect = this._dwu.getBoundsWithoutFlushing(draggedItem);
+    let itemRect = this._getBoundsWithoutFlushing(draggedItem);
     let itemCenter = {x: itemRect.left + itemRect.width / 2,
                       y: itemRect.top + itemRect.height / 2};
     this._dragOffset = {x: aEvent.clientX - itemCenter.x,
                         y: aEvent.clientY - itemCenter.y};
 
     let toolbarParent = draggedItem.closest("toolbar");
     if (toolbarParent) {
-      let toolbarRect = this._dwu.getBoundsWithoutFlushing(toolbarParent);
+      let toolbarRect = this._getBoundsWithoutFlushing(toolbarParent);
       toolbarParent.style.minHeight = toolbarRect.height + "px";
     }
 
     gDraggingInToolbars = new Set();
 
     // Hack needed so that the dragimage will still show the
     // item as it appeared before it was hidden.
     this._initializeDragAfterMove = () => {
@@ -1779,29 +1776,29 @@ CustomizeMode.prototype = {
         dragOverItem = (targetAreaType == "toolbar"
                           ? this._findVisiblePreviousSiblingNode(targetNode.lastChild)
                           : targetNode.lastChild);
         dragValue = "after";
       } else {
         dragOverItem = targetParent.children[position];
         if (targetAreaType == "toolbar") {
           // Check if the aDraggedItem is hovered past the first half of dragOverItem
-          let itemRect = this._dwu.getBoundsWithoutFlushing(dragOverItem);
+          let itemRect = this._getBoundsWithoutFlushing(dragOverItem);
           let dropTargetCenter = itemRect.left + (itemRect.width / 2);
           let existingDir = dragOverItem.getAttribute("dragover");
           let dirFactor = this._dir == "ltr" ? 1 : -1;
           if (existingDir == "before") {
             dropTargetCenter += (parseInt(dragOverItem.style.borderInlineStartWidth) || 0) / 2 * dirFactor;
           } else {
             dropTargetCenter -= (parseInt(dragOverItem.style.borderInlineEndWidth) || 0) / 2 * dirFactor;
           }
           let before = this._dir == "ltr" ? aEvent.clientX < dropTargetCenter : aEvent.clientX > dropTargetCenter;
           dragValue = before ? "before" : "after";
         } else if (targetAreaType == "menu-panel") {
-          let itemRect = this._dwu.getBoundsWithoutFlushing(dragOverItem);
+          let itemRect = this._getBoundsWithoutFlushing(dragOverItem);
           let dropTargetCenter = itemRect.top + (itemRect.height / 2);
           let existingDir = dragOverItem.getAttribute("dragover");
           if (existingDir == "before") {
             dropTargetCenter += (parseInt(dragOverItem.style.borderBlockStartWidth) || 0) / 2;
           } else {
             dropTargetCenter -= (parseInt(dragOverItem.style.borderBlockEndWidth) || 0) / 2;
           }
           dragValue = aEvent.clientY < dropTargetCenter ? "before" : "after";
@@ -2261,17 +2258,17 @@ CustomizeMode.prototype = {
     }
     // Offset the drag event's position with the offset to the center of
     // the thing we're dragging
     let dragX = aEvent.clientX - this._dragOffset.x;
     let dragY = aEvent.clientY - this._dragOffset.y;
 
     // Ensure this is within the container
     let boundsContainer = expectedParent;
-    let bounds = this._dwu.getBoundsWithoutFlushing(boundsContainer);
+    let bounds = this._getBoundsWithoutFlushing(boundsContainer);
     dragX = Math.min(bounds.right, Math.max(dragX, bounds.left));
     dragY = Math.min(bounds.bottom, Math.max(dragY, bounds.top));
 
     let targetNode;
     if (aAreaType == "toolbar" || aAreaType == "menu-panel") {
       targetNode = aAreaElement.ownerDocument.elementFromPoint(dragX, dragY);
       while (targetNode && targetNode.parentNode != expectedParent) {
         targetNode = targetNode.parentNode;
@@ -2399,18 +2396,18 @@ CustomizeMode.prototype = {
         panelOnTheLeft = true;
       }
     } else {
       await this.window.promiseDocumentFlushed(() => {});
 
       if (!this._customizing || !this._wantToBeInCustomizeMode) {
         return;
       }
-      let buttonBounds = this._dwu.getBoundsWithoutFlushing(button);
-      let windowBounds = this._dwu.getBoundsWithoutFlushing(doc.documentElement);
+      let buttonBounds = this._getBoundsWithoutFlushing(button);
+      let windowBounds = this._getBoundsWithoutFlushing(doc.documentElement);
       panelOnTheLeft = (buttonBounds.left + buttonBounds.width / 2) > windowBounds.width / 2;
     }
     let position;
     if (panelOnTheLeft) {
       // Tested in RTL, these get inverted automatically, so this does the
       // right thing without taking RTL into account explicitly.
       position = "leftcenter topright";
       if (toolbarContainer) {
--- a/js/src/tests/shell/mailbox.js
+++ b/js/src/tests/shell/mailbox.js
@@ -53,17 +53,17 @@ assertThrowsInstanceOf(() => setSharedOb
 assertThrowsInstanceOf(() => setSharedObject(false), Error);
 assertThrowsInstanceOf(() => setSharedObject(3.14), Error);
 assertThrowsInstanceOf(() => setSharedObject(mem), Error);
 assertThrowsInstanceOf(() => setSharedObject("abracadabra"), Error);
 assertThrowsInstanceOf(() => setSharedObject(() => 37), Error);
 
 // We can store wasm shared memories, too
 
-if (!this.WebAssembly) {
+if (!this.WebAssembly || !wasmThreadsSupported()) {
     reportCompare(true, true);
     quit(0);
 }
 
 setSharedObject(null);
 
 var mem = new WebAssembly.Memory({initial: 1, maximum: 1, shared: true});
 setSharedObject(mem);
--- a/netwerk/base/rust-helper/src/lib.rs
+++ b/netwerk/base/rust-helper/src/lib.rs
@@ -1,10 +1,8 @@
-use std::ascii::AsciiExt;
-
 extern crate nserror;
 use self::nserror::*;
 
 extern crate nsstring;
 use self::nsstring::nsACString;
 
 /// HTTP leading whitespace, defined in netwerk/protocol/http/nsHttp.h
 static HTTP_LWS: &'static [u8] = &[' ' as u8, '\t' as u8];
@@ -108,36 +106,36 @@ pub extern "C" fn rust_prepare_accept_la
 /// > At all times, language tags and their subtags, including private
 /// > use and extensions, are to be treated as case insensitive: there
 /// > exist conventions for the capitalization of some of the subtags,
 /// > but these MUST NOT be taken to carry meaning.
 ///
 /// So why is this code even here? See bug 1108183, I guess.
 fn canonicalize_language_tag(token: &mut [u8]) {
     for c in token.iter_mut() {
-        *c = AsciiExt::to_ascii_lowercase(c);
+        *c = c.to_ascii_lowercase();
     }
 
     let sub_tags = token.split_mut(|c| *c == ('-' as u8));
     for (i, sub_tag) in sub_tags.enumerate() {
         if i == 0 {
             // ISO 639-1 language code, like the "en" in "en-US"
             continue;
         }
 
         match sub_tag.len() {
             // Singleton tag, like "x" or "i". These signify a
             // non-standard language, so we stop capitalizing after
             // these.
             1 => break,
             // ISO 3166-1 Country code, like "US"
             2 => {
-                sub_tag[0] = AsciiExt::to_ascii_uppercase(&sub_tag[0]);
-                sub_tag[1] = AsciiExt::to_ascii_uppercase(&sub_tag[1]);
+                sub_tag[0] = sub_tag[0].to_ascii_uppercase();
+                sub_tag[1] = sub_tag[1].to_ascii_uppercase();
             },
             // ISO 15924 script code, like "Nkoo"
             4  => {
-                sub_tag[0] = AsciiExt::to_ascii_uppercase(&sub_tag[0]);
+                sub_tag[0] = sub_tag[0].to_ascii_uppercase();
             },
             _ => {},
         };
     }
 }