merge fx-team to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 14 Jul 2015 11:56:40 +0200
changeset 252659 283b5f38ce573e94f74dadc30a450c6105e0f964
parent 252648 5bd5ca3ad614413f344db97af76e5ee0d84b39cf (current diff)
parent 252658 262d05bd5d3c257a2874902431e6d3f1f136572d (diff)
child 252710 e786406bc683b19018f1fbd11d4852100f30d7ff
push id29041
push usercbook@mozilla.com
push dateTue, 14 Jul 2015 10:00:09 +0000
treeherdermozilla-central@283b5f38ce57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone42.0a1
first release with
nightly linux32
283b5f38ce57 / 42.0a1 / 20150714030206 / files
nightly linux64
283b5f38ce57 / 42.0a1 / 20150714030206 / files
nightly mac
283b5f38ce57 / 42.0a1 / 20150714030206 / files
nightly win32
283b5f38ce57 / 42.0a1 / 20150714030206 / files
nightly win64
283b5f38ce57 / 42.0a1 / 20150714030206 / 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 fx-team to mozilla-central a=merge
--- a/browser/themes/shared/devtools/toolbars.inc.css
+++ b/browser/themes/shared/devtools/toolbars.inc.css
@@ -1,18 +1,13 @@
 %if 0
 /* 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/. */
 %endif
-%filter substitution
-%define smallSeparatorDark linear-gradient(transparent 15%, #5a6169 15%, #5a6169 85%, transparent 85%)
-%define smallSeparatorLight linear-gradient(transparent 15%, #aaa 15%, #aaa 85%, transparent 85%)
-%define solidSeparatorDark linear-gradient(#2d5b7d, #2d5b7d)
-%define solidSeparatorLight linear-gradient(#aaa, #aaa)
 
 /* CSS Variables specific to the devtools toolbar that aren't defined by the themes */
 .theme-light {
   --searchbox-background-color: #ffee99;
   --searchbox-border-color: #ffbf00;
   --searcbox-no-match-background-color: #ffe5e5;
   --searcbox-no-match-border-color: #e52e2e;
 }
@@ -549,83 +544,67 @@
   border-width: 0;
   -moz-border-start-width: 1px;
   border-style: solid;
   border-radius: 0;
   position: static;
   text-shadow: none;
 }
 
+.devtools-sidebar-tabs tabs > tab {
+  border-image: linear-gradient(transparent 15%, var(--theme-splitter-color) 15%, var(--theme-splitter-color) 85%, transparent 85%) 1 1;
+}
+
+.devtools-sidebar-tabs tabs > tab[selected],
+.devtools-sidebar-tabs tabs > tab[selected] + tab {
+  border-image: linear-gradient(var(--theme-splitter-color), var(--theme-splitter-color)) 1 1;
+}
+
 .devtools-sidebar-tabs tabs > tab:first-child {
   -moz-border-start-width: 0;
 }
 
-.theme-dark .devtools-sidebar-tabs tabs > tab {
-  border-image: @smallSeparatorDark@ 1 1;
-}
-
 .theme-dark .devtools-sidebar-tabs tabs > tab:hover {
   background: hsla(206,37%,4%,.2);
-  border-image: @smallSeparatorDark@ 1 1;
 }
 
 .theme-dark .devtools-sidebar-tabs tabs > tab:hover:active {
   background: hsla(206,37%,4%,.4);
-  border-image: @smallSeparatorDark@ 1 1;
-}
-
-.theme-dark .devtools-sidebar-tabs tabs > tab[selected] + tab {
-  border-image: @solidSeparatorDark@ 1 1;
 }
 
 .theme-dark .devtools-sidebar-tabs tabs > tab[selected] + tab:hover {
   background: hsla(206,37%,4%,.2);
-  border-image: @solidSeparatorDark@ 1 1;
 }
 
 .theme-dark .devtools-sidebar-tabs tabs > tab[selected] + tab:hover:active {
   background: hsla(206,37%,4%,.4);
-  border-image: @solidSeparatorDark@ 1 1;
 }
 
 .theme-dark .devtools-sidebar-tabs tabs > tab[selected],
 .theme-dark .devtools-sidebar-tabs tabs > tab[selected]:hover:active {
   color: var(--theme-selection-color);
   background: #1d4f73;
-  border-image: @solidSeparatorDark@ 1 1;
-}
-
-.theme-light .devtools-sidebar-tabs tabs > tab {
-  border-image: @smallSeparatorLight@ 1 1;
 }
 
 .theme-light .devtools-sidebar-tabs tabs > tab:hover {
   background: #ddd;
-  border-image: @smallSeparatorLight@ 1 1;
 }
 
 .theme-light .devtools-sidebar-tabs tabs > tab:hover:active {
   background: #ddd;
-  border-image: @smallSeparatorLight@ 1 1;
-}
-
-.theme-light .devtools-sidebar-tabs tabs > tab[selected] + tab {
-  border-image: @solidSeparatorLight@;
 }
 
 .theme-light .devtools-sidebar-tabs tabs > tab[selected] + tab:hover {
   background: #ddd;
-  border-image: @solidSeparatorLight@;
 }
 
 .theme-light .devtools-sidebar-tabs tabs > tab[selected],
 .theme-light .devtools-sidebar-tabs tabs > tab[selected]:hover:active {
   color: var(--theme-selection-color);
   background: #4c9ed9;
-  border-image: @solidSeparatorLight@;
 }
 
 /* Toolbox - moved from toolbox.css.
  * Rules that apply to the global toolbox like command buttons,
  * devtools tabs, docking buttons, etc. */
 
 #toolbox-controls > toolbarbutton,
 #toolbox-dock-buttons > toolbarbutton {
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1746,50 +1746,16 @@ nsListControlFrame::GetIndexFromDOMEvent
   }
 
   if (option) {
     aCurIndex = option->Index();
     MOZ_ASSERT(aCurIndex >= 0);
     return NS_OK;
   }
 
-  int32_t numOptions = GetNumberOfOptions();
-  if (numOptions < 1)
-    return NS_ERROR_FAILURE;
-
-  nsPoint pt = nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(aMouseEvent, this);
-
-  // If the event coordinate is above the first option frame, then target the
-  // first option frame
-  nsRefPtr<dom::HTMLOptionElement> firstOption = GetOption(0);
-  NS_ASSERTION(firstOption, "Can't find first option that's supposed to be there");
-  nsIFrame* optionFrame = firstOption->GetPrimaryFrame();
-  if (optionFrame) {
-    nsPoint ptInOptionFrame = pt - optionFrame->GetOffsetTo(this);
-    if (ptInOptionFrame.y < 0 && ptInOptionFrame.x >= 0 &&
-        ptInOptionFrame.x < optionFrame->GetSize().width) {
-      aCurIndex = 0;
-      return NS_OK;
-    }
-  }
-
-  nsRefPtr<dom::HTMLOptionElement> lastOption = GetOption(numOptions - 1);
-  // If the event coordinate is below the last option frame, then target the
-  // last option frame
-  NS_ASSERTION(lastOption, "Can't find last option that's supposed to be there");
-  optionFrame = lastOption->GetPrimaryFrame();
-  if (optionFrame) {
-    nsPoint ptInOptionFrame = pt - optionFrame->GetOffsetTo(this);
-    if (ptInOptionFrame.y >= optionFrame->GetSize().height && ptInOptionFrame.x >= 0 &&
-        ptInOptionFrame.x < optionFrame->GetSize().width) {
-      aCurIndex = numOptions - 1;
-      return NS_OK;
-    }
-  }
-
   return NS_ERROR_FAILURE;
 }
 
 static bool
 FireShowDropDownEvent(nsIContent* aContent)
 {
   if (XRE_IsContentProcess() &&
       Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
--- a/mobile/android/base/FindInPageBar.java
+++ b/mobile/android/base/FindInPageBar.java
@@ -91,26 +91,31 @@ public class FindInPageBar extends Linea
         mFindText.requestFocus();
 
         // handleMessage() receives response message and determines initial state of softInput
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("TextSelection:Get", REQUEST_ID));
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FindInPage:Opened", null));
     }
 
     public void hide() {
-        if (!mInflated) {
+        if (!mInflated || getVisibility() == View.GONE) {
             // There's nothing to hide yet.
             return;
         }
 
         // Always clear the Find string, primarily for privacy.
         mFindText.setText("");
 
+        // Only close the IMM if its EditText is the one with focus.
+        if (mFindText.isFocused()) {
+          getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
+        }
+
+        // Close the FIPB / FindHelper state.
         setVisibility(GONE);
-        getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
         GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("FindInPage:Closed", null));
     }
 
     private InputMethodManager getInputMethodManager(View view) {
         Context context = view.getContext();
         return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
      }
 
new file mode 100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+UfD+EEYGt?CaUbnif(b0XJOND
zSH;9^2rp_#&e-S996J1=FToEN*!k6>vbX=sx!`xWq!megj1U!iWyPw#gr8d=K@WtO
zXCyum{vMblfJ{lyoV?M0v*O1h6Znf1Tj4ssmr<H(q&I71YQc8qReYg^>#Q3Zw$9&Z
zfquVl*61+NIjpkcn;S&?<{c@?**EMy)GPa26~|3U()eX1d9CgE89tfRbK#J1Jz9`X
zhb2*BC|)et#lM7G!s7Bc(GjWP!7GgmiM@GvDo2K}8SYCngimOLxTs9*koIVT=w$Ny
z1y^VB62tJf_W?P-${de{EZ@cfOwNPYqZQ?A+Xf&xzsS4pYb5E^kb)Qp=+0zw5|DIS
z&V^t*;6<ENbZP%<{g9Y0T!TH!*lXGk5A`#G&MA9Cu0wQ)_Pu^U&dS`LDrb80xi%(e
zm8w5}B0Bc{1JzdQ$Kfe$_8pI7L?2D68e4INk}GP{h6B%5K+Hzmq=cjAtsrTT=xFxh
zf=PKZtfkH@#f29*^?nkvh>Jz#xSLXt&>eE+D?;-Bhd2kLYXb=(hx|Fwr!77xs)C;+
ss=}BbrsYbUB`Pi*A^J>4W#20MFQ9=Hms_K7Hvj+t07*qoM6N<$f`umu1ONa4
--- a/mobile/android/base/sync/CommandProcessor.java
+++ b/mobile/android/base/sync/CommandProcessor.java
@@ -262,17 +262,17 @@ public class CommandProcessor {
       BrowserLocaleManager.getInstance().getAndApplyPersistedLocale(context);
       didUpdateLocale = true;
     }
 
     final String ns = Context.NOTIFICATION_SERVICE;
     final NotificationManager notificationManager = (NotificationManager) context.getSystemService(ns);
 
     // Create a Notification.
-    final int icon = R.drawable.icon;
+    final int icon = R.drawable.flat_icon;
     String notificationTitle = context.getString(R.string.sync_new_tab);
     if (title != null) {
       notificationTitle = notificationTitle.concat(": " + title);
     }
 
     final long when = System.currentTimeMillis();
     Notification notification = new Notification(icon, notificationTitle, when);
     notification.flags = Notification.FLAG_AUTO_CANCEL;
--- a/python/mach/mach/dispatcher.py
+++ b/python/mach/mach/dispatcher.py
@@ -87,28 +87,36 @@ class CommandAction(argparse.Action):
         """
         if namespace.help:
             # -h or --help is in the global arguments.
             self._handle_main_help(parser, namespace.verbose)
             sys.exit(0)
         elif values:
             command = values[0].lower()
             args = values[1:]
-
             if command == 'help':
                 if args and args[0] not in ['-h', '--help']:
                     # Make sure args[0] is indeed a command.
                     self._handle_command_help(parser, args[0])
                 else:
                     self._handle_main_help(parser, namespace.verbose)
                 sys.exit(0)
             elif '-h' in args or '--help' in args:
                 # -h or --help is in the command arguments.
-                self._handle_command_help(parser, command)
-                sys.exit(0)
+                if '--' in args:
+                    # -- is in command arguments
+                    if '-h' in args[:args.index('--')] or '--help' in args[:args.index('--')]:
+                        # Honor -h or --help only if it appears before --
+                        self._handle_main_help(parser, command)
+                        sys.exit(0)
+                else:
+                    self._handle_main_help(parser, command)
+                    sys.exit(0)
+
+
         else:
             raise NoCommandError()
 
         # Command suggestion
         if command not in self._mach_registrar.command_handlers:
             # Make sure we don't suggest any deprecated commands.
             names = [h.name for h in self._mach_registrar.command_handlers.values()
                         if h.cls.__name__ == 'DeprecatedCommands']
--- a/toolkit/content/tests/chrome/test_mousecapture.xul
+++ b/toolkit/content/tests/chrome/test_mousecapture.xul
@@ -184,17 +184,17 @@ function runTests()
 
   // ensure that clicking on an element where the frame disappears doesn't crash
   synthesizeMouse(frames[2].document.getElementById("input"), 8, 8, { type: "mousedown" }, frames[2]);
   synthesizeMouse(frames[2].document.getElementById("input"), 8, 8, { type: "mouseup" }, frames[2]);
 
   synthesizeMouse(document.getElementById("option3"), 2, 2, { type: "mousedown" });
   synthesizeMouse(document.getElementById("option3"), 2, 1000, { type: "mousemove" });
   var select = document.getElementById("select");
-  is(select.selectedIndex, 9, "scroll select");
+  is(select.selectedIndex, 2, "scroll select");
   synthesizeMouse(document.getElementById("select"), 2, 2, { type: "mouseup" });
 
   synthesizeMouse(custom, 2, 2, { type: "mousedown" });
 
   // check to ensure that selection dragging scrolls the right scrollable area.
   // This should open the page in a new tab.
 
   var topPos = window.innerHeight;
--- a/toolkit/devtools/sourcemap/SourceMap.jsm
+++ b/toolkit/devtools/sourcemap/SourceMap.jsm
@@ -350,35 +350,55 @@ define('source-map/source-map-consumer',
    * @param SourceMapGenerator aSourceMap
    *        The source map that will be consumed.
    * @returns BasicSourceMapConsumer
    */
   BasicSourceMapConsumer.fromSourceMap =
     function SourceMapConsumer_fromSourceMap(aSourceMap) {
       var smc = Object.create(BasicSourceMapConsumer.prototype);
 
-      smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
-      smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+      var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+      var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
       smc.sourceRoot = aSourceMap._sourceRoot;
       smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
                                                               smc.sourceRoot);
       smc.file = aSourceMap._file;
 
-      smc.__generatedMappings = aSourceMap._mappings.toArray().slice();
-      smc.__originalMappings = aSourceMap._mappings.toArray().slice().sort();
+      // Because we are modifying the entries (by converting string sources and
+      // names to indices into the sources and names ArraySets), we have to make
+      // a copy of the entry or else bad things happen. Shared mutable state
+      // strikes again! See github issue #191.
+
+      var generatedMappings = aSourceMap._mappings.toArray().slice();
+      var destGeneratedMappings = smc.__generatedMappings = [];
+      var destOriginalMappings = smc.__originalMappings = [];
+
+      for (var i = 0, length = generatedMappings.length; i < length; i++) {
+        var srcMapping = generatedMappings[i];
+        var destMapping = new Mapping;
+        destMapping.generatedLine = srcMapping.generatedLine;
+        destMapping.generatedColumn = srcMapping.generatedColumn;
 
-      smc.__generatedMappings.forEach(function (m) {
-        if (m.source !== null) {
-          m.source = smc._sources.indexOf(m.source);
+        if (srcMapping.source) {
+          destMapping.source = sources.indexOf(srcMapping.source);
+          destMapping.originalLine = srcMapping.originalLine;
+          destMapping.originalColumn = srcMapping.originalColumn;
+
+          if (srcMapping.name) {
+            destMapping.name = names.indexOf(srcMapping.name);
+          }
 
-          if (m.name !== null) {
-            m.name = smc._names.indexOf(m.name);
-          }
+          destOriginalMappings.push(destMapping);
         }
-      });
+
+        destGeneratedMappings.push(destMapping);
+      }
+
+      quickSort(smc.__originalMappings, util.compareByOriginalPositions);
+
       return smc;
     };
 
   /**
    * The version of the source mapping spec that we are consuming.
    */
   BasicSourceMapConsumer.prototype._version = 3;
 
@@ -502,17 +522,17 @@ define('source-map/source-map-consumer',
 
           generatedMappings.push(mapping);
           if (typeof mapping.originalLine === 'number') {
             originalMappings.push(mapping);
           }
         }
       }
 
-      quickSort(generatedMappings, util.compareByGeneratedPositions);
+      quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
       this.__generatedMappings = generatedMappings;
 
       quickSort(originalMappings, util.compareByOriginalPositions);
       this.__originalMappings = originalMappings;
     };
 
   /**
    * Find the mapping that best matches the hypothetical "needle" mapping that
@@ -592,17 +612,17 @@ define('source-map/source-map-consumer',
         generatedColumn: util.getArg(aArgs, 'column')
       };
 
       var index = this._findMapping(
         needle,
         this._generatedMappings,
         "generatedLine",
         "generatedColumn",
-        util.compareByGeneratedPositions,
+        util.compareByGeneratedPositionsDeflated,
         util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
       );
 
       if (index >= 0) {
         var mapping = this._generatedMappings[index];
 
         if (mapping.generatedLine === needle.generatedLine) {
           var source = util.getArg(mapping, 'source', null);
@@ -1061,17 +1081,17 @@ define('source-map/source-map-consumer',
 
           this.__generatedMappings.push(adjustedMapping);
           if (typeof adjustedMapping.originalLine === 'number') {
             this.__originalMappings.push(adjustedMapping);
           }
         };
       };
 
-      quickSort(this.__generatedMappings, util.compareByGeneratedPositions);
+      quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
       quickSort(this.__originalMappings, util.compareByOriginalPositions);
     };
 
   exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
 
 });
 /* -*- Mode: js; js-indent-level: 2; -*- */
 /*
@@ -1350,25 +1370,25 @@ define('source-map/util', ['require', 'e
       return cmp;
     }
 
     return mappingA.name - mappingB.name;
   };
   exports.compareByOriginalPositions = compareByOriginalPositions;
 
   /**
-   * Comparator between two mappings where the generated positions are
-   * compared.
+   * Comparator between two mappings with deflated source and name indices where
+   * the generated positions are compared.
    *
    * Optionally pass in `true` as `onlyCompareGenerated` to consider two
    * mappings with the same generated line and column, but different
    * source/name/original line and column the same. Useful when searching for a
    * mapping with a stubbed out mapping.
    */
-  function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+  function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
     var cmp = mappingA.generatedLine - mappingB.generatedLine;
     if (cmp !== 0) {
       return cmp;
     }
 
     cmp = mappingA.generatedColumn - mappingB.generatedColumn;
     if (cmp !== 0 || onlyCompareGenerated) {
       return cmp;
@@ -1386,17 +1406,63 @@ define('source-map/util', ['require', 'e
 
     cmp = mappingA.originalColumn - mappingB.originalColumn;
     if (cmp !== 0) {
       return cmp;
     }
 
     return mappingA.name - mappingB.name;
   };
-  exports.compareByGeneratedPositions = compareByGeneratedPositions;
+  exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+  function strcmp(aStr1, aStr2) {
+    if (aStr1 === aStr2) {
+      return 0;
+    }
+
+    if (aStr1 > aStr2) {
+      return 1;
+    }
+
+    return -1;
+  }
+
+  /**
+   * Comparator between two mappings with inflated source and name strings where
+   * the generated positions are compared.
+   */
+  function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+    var cmp = mappingA.generatedLine - mappingB.generatedLine;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = strcmp(mappingA.source, mappingB.source);
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.originalLine - mappingB.originalLine;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.originalColumn - mappingB.originalColumn;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    return strcmp(mappingA.name, mappingB.name);
+  };
+  exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
 
 });
 /* -*- Mode: js; js-indent-level: 2; -*- */
 /*
  * Copyright 2011 Mozilla Foundation and contributors
  * Licensed under the New BSD license. See LICENSE or:
  * http://opensource.org/licenses/BSD-3-Clause
  */
@@ -2233,30 +2299,29 @@ define('source-map/source-map-generator'
       var previousOriginalColumn = 0;
       var previousOriginalLine = 0;
       var previousName = 0;
       var previousSource = 0;
       var result = '';
       var mapping;
 
       var mappings = this._mappings.toArray();
-
       for (var i = 0, len = mappings.length; i < len; i++) {
         mapping = mappings[i];
 
         if (mapping.generatedLine !== previousGeneratedLine) {
           previousGeneratedColumn = 0;
           while (mapping.generatedLine !== previousGeneratedLine) {
             result += ';';
             previousGeneratedLine++;
           }
         }
         else {
           if (i > 0) {
-            if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) {
+            if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
               continue;
             }
             result += ',';
           }
         }
 
         result += base64VLQ.encode(mapping.generatedColumn
                                    - previousGeneratedColumn);
@@ -2355,17 +2420,17 @@ define('source-map/mapping-list', ['requ
    */
   function generatedPositionAfter(mappingA, mappingB) {
     // Optimized for most common case
     var lineA = mappingA.generatedLine;
     var lineB = mappingB.generatedLine;
     var columnA = mappingA.generatedColumn;
     var columnB = mappingB.generatedColumn;
     return lineB > lineA || lineB == lineA && columnB >= columnA ||
-           util.compareByGeneratedPositions(mappingA, mappingB) <= 0;
+           util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
   }
 
   /**
    * A data structure to provide a sorted view of accumulated mappings in a
    * performance conscious manner. It trades a neglibable overhead in general
    * case for a large speedup in case of mappings being added in order.
    */
   function MappingList() {
@@ -2408,17 +2473,17 @@ define('source-map/mapping-list', ['requ
    *
    * WARNING: This method returns internal data without copying, for
    * performance. The return value must NOT be mutated, and should be treated as
    * an immutable borrow. If you want to take ownership, you must make your own
    * copy.
    */
   MappingList.prototype.toArray = function MappingList_toArray() {
     if (!this._sorted) {
-      this._array.sort(util.compareByGeneratedPositions);
+      this._array.sort(util.compareByGeneratedPositionsInflated);
       this._sorted = true;
     }
     return this._array;
   };
 
   exports.MappingList = MappingList;
 
 });
--- a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm
+++ b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm
@@ -647,25 +647,25 @@ define('lib/source-map/util', ['require'
       return cmp;
     }
 
     return mappingA.name - mappingB.name;
   };
   exports.compareByOriginalPositions = compareByOriginalPositions;
 
   /**
-   * Comparator between two mappings where the generated positions are
-   * compared.
+   * Comparator between two mappings with deflated source and name indices where
+   * the generated positions are compared.
    *
    * Optionally pass in `true` as `onlyCompareGenerated` to consider two
    * mappings with the same generated line and column, but different
    * source/name/original line and column the same. Useful when searching for a
    * mapping with a stubbed out mapping.
    */
-  function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+  function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
     var cmp = mappingA.generatedLine - mappingB.generatedLine;
     if (cmp !== 0) {
       return cmp;
     }
 
     cmp = mappingA.generatedColumn - mappingB.generatedColumn;
     if (cmp !== 0 || onlyCompareGenerated) {
       return cmp;
@@ -683,17 +683,63 @@ define('lib/source-map/util', ['require'
 
     cmp = mappingA.originalColumn - mappingB.originalColumn;
     if (cmp !== 0) {
       return cmp;
     }
 
     return mappingA.name - mappingB.name;
   };
-  exports.compareByGeneratedPositions = compareByGeneratedPositions;
+  exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
+
+  function strcmp(aStr1, aStr2) {
+    if (aStr1 === aStr2) {
+      return 0;
+    }
+
+    if (aStr1 > aStr2) {
+      return 1;
+    }
+
+    return -1;
+  }
+
+  /**
+   * Comparator between two mappings with inflated source and name strings where
+   * the generated positions are compared.
+   */
+  function compareByGeneratedPositionsInflated(mappingA, mappingB) {
+    var cmp = mappingA.generatedLine - mappingB.generatedLine;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = strcmp(mappingA.source, mappingB.source);
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.originalLine - mappingB.originalLine;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    cmp = mappingA.originalColumn - mappingB.originalColumn;
+    if (cmp !== 0) {
+      return cmp;
+    }
+
+    return strcmp(mappingA.name, mappingB.name);
+  };
+  exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
 
 });
 /* -*- Mode: js; js-indent-level: 2; -*- */
 /*
  * Copyright 2011 Mozilla Foundation and contributors
  * Licensed under the New BSD license. See LICENSE or:
  * http://opensource.org/licenses/BSD-3-Clause
  */
--- a/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js
+++ b/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js
@@ -1057,12 +1057,36 @@ define("test/source-map/test-source-map-
       line: 2,
       column: 2,
       source: 'http://example.com/baz.js'
     });
     assert.equal(pos.line, 4);
     assert.equal(pos.column, 4);
   };
 
+  exports['test issue #191'] = function (assert, util) {
+    var generator = new SourceMapGenerator({ file: 'a.css' });
+    generator.addMapping({
+      source:   'b.css',
+      original: {
+        line:   1,
+        column: 0
+      },
+      generated: {
+        line:   1,
+        column: 0
+      }
+    });
+
+    // Create a SourceMapConsumer from the SourceMapGenerator, ...
+    var consumer  = SourceMapConsumer.fromSourceMap(generator);
+    // ... and then try and use the SourceMapGenerator again. This should not
+    // throw.
+    generator.toJSON();
+
+    assert.ok(true, "Using a SourceMapGenerator again after creating a " +
+                    "SourceMapConsumer from it should not throw");
+  };
+
 });
 function run_test() {
   runSourceMapTests('test/source-map/test-source-map-consumer', do_throw);
 }
--- a/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js
+++ b/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js
@@ -718,12 +718,36 @@ define("test/source-map/test-source-map-
         original: { line: 1, column: 0 },
         source: 'original-source'
       });
 
       map1.applySourceMap(new SourceMapConsumer(map2.toJSON()));
 
       util.assertEqualMaps(assert, map1.toJSON(), expectedMap.toJSON());
     };
+
+  exports['test issue #192'] = function (assert, util) {
+    var generator = new SourceMapGenerator();
+    generator.addMapping({
+      source: 'a.js',
+      generated: { line: 1, column: 10 },
+      original: { line: 1, column: 10 },
+    });
+    generator.addMapping({
+      source: 'b.js',
+      generated: { line: 1, column: 10 },
+      original: { line: 2, column: 20 },
+    });
+
+    var consumer = new SourceMapConsumer(generator.toJSON());
+
+    var n = 0;
+    consumer.eachMapping(function () { n++ });
+
+    assert.equal(n, 2,
+                 "Should not de-duplicate mappings that have the same " +
+                 "generated positions, but different original positions.");
+  };
+
 });
 function run_test() {
   runSourceMapTests('test/source-map/test-source-map-generator', do_throw);
 }