merge the last green changeset on m-c to fx-team
authorTim Taubert <tim.taubert@gmx.de>
Fri, 12 Aug 2011 10:53:50 +0200
changeset 74308 708c7bee072e41d8ea600ae9930c3a7c32278e1b
parent 74307 94f632be4b201c1425d8bcca25ba15c4393fa4e3 (current diff)
parent 74259 f262c389193eebbb714074f8c340bad268071646 (diff)
child 74309 5776ff214937fed05aeff81e42a0be3f1bf62941
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone8.0a1
merge the last green changeset on m-c to fx-team
--- a/content/base/src/nsAttrValue.cpp
+++ b/content/base/src/nsAttrValue.cpp
@@ -975,52 +975,53 @@ nsAttrValue::SetIntValueAndType(PRInt32 
       SetMiscAtomOrString(aStringValue);
     }
   } else {
     NS_ASSERTION(!mBits, "Reset before calling SetIntValueAndType!");
     mBits = (aValue * NS_ATTRVALUE_INTEGERTYPE_MULTIPLIER) | aType;
   }
 }
 
-PRBool
-nsAttrValue::GetEnumTableIndex(const EnumTable* aTable, PRInt16& aResult)
+PRInt16
+nsAttrValue::GetEnumTableIndex(const EnumTable* aTable)
 {
   PRInt16 index = sEnumTableArray->IndexOf(aTable);
   if (index < 0) {
     index = sEnumTableArray->Length();
     NS_ASSERTION(index <= NS_ATTRVALUE_ENUMTABLEINDEX_MAXVALUE,
         "too many enum tables");
-    if (!sEnumTableArray->AppendElement(aTable)) {
-      return PR_FALSE;
-    }
+    sEnumTableArray->AppendElement(aTable);
   }
 
-  aResult = index;
+  return index;
+}
 
-  return PR_TRUE;
+PRInt32
+nsAttrValue::EnumTableEntryToValue(const EnumTable* aEnumTable,
+                                   const EnumTable* aTableEntry)
+{
+  PRInt16 index = GetEnumTableIndex(aEnumTable);
+  PRInt32 value = (aTableEntry->value << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) +
+                  index;
+  return value;
 }
 
 PRBool
 nsAttrValue::ParseEnumValue(const nsAString& aValue,
                             const EnumTable* aTable,
-                            PRBool aCaseSensitive)
+                            PRBool aCaseSensitive,
+                            const EnumTable* aDefaultValue)
 {
   ResetIfSet();
   const EnumTable* tableEntry = aTable;
 
   while (tableEntry->tag) {
     if (aCaseSensitive ? aValue.EqualsASCII(tableEntry->tag) :
                          aValue.LowerCaseEqualsASCII(tableEntry->tag)) {
-      PRInt16 index;
-      if (!GetEnumTableIndex(aTable, index)) {
-        return PR_FALSE;
-      }
-
-      PRInt32 value = (tableEntry->value << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) +
-                      index;
+      PRInt32 value = EnumTableEntryToValue(aTable, tableEntry);
 
       PRBool equals = aCaseSensitive || aValue.EqualsASCII(tableEntry->tag);
       if (!equals) {
         nsAutoString tag;
         tag.AssignASCII(tableEntry->tag);
         ToUpperCase(tag);
         if ((equals = tag.Equals(aValue))) {
           value |= NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER;
@@ -1030,16 +1031,24 @@ nsAttrValue::ParseEnumValue(const nsAStr
       NS_ASSERTION(GetEnumValue() == tableEntry->value,
                    "failed to store enum properly");
 
       return PR_TRUE;
     }
     tableEntry++;
   }
 
+  if (aDefaultValue) {
+    NS_PRECONDITION(aTable <= aDefaultValue && aDefaultValue < tableEntry,
+                    "aDefaultValue not inside aTable?");
+    SetIntValueAndType(EnumTableEntryToValue(aTable, aDefaultValue),
+                       eEnum, &aValue);
+    return PR_TRUE;
+  }
+
   return PR_FALSE;
 }
 
 PRBool
 nsAttrValue::ParseSpecialIntValue(const nsAString& aString)
 {
   ResetIfSet();
 
--- a/content/base/src/nsAttrValue.h
+++ b/content/base/src/nsAttrValue.h
@@ -208,21 +208,25 @@ public:
   };
 
   /**
    * Parse into an enum value.
    *
    * @param aValue the string to find the value for
    * @param aTable the enumeration to map with
    * @param aCaseSensitive specify if the parsing has to be case sensitive
+   * @param aDefaultValue if non-null, this function will always return true.
+   *        Failure to parse aValue as one of the values in aTable will just
+   *        cause aDefaultValue->value to be stored as the enumeration value.
    * @return whether the enum value was found or not
    */
   PRBool ParseEnumValue(const nsAString& aValue,
                         const EnumTable* aTable,
-                        PRBool aCaseSensitive);
+                        PRBool aCaseSensitive,
+                        const EnumTable* aDefaultValue = nsnull);
 
   /**
    * Parse a string into an integer. Can optionally parse percent (n%).
    * This method explicitly sets a lower bound of zero on the element,
    * whether it be percent or raw integer.
    *
    * @param aString the string to parse
    * @return whether the value could be parsed
@@ -342,23 +346,21 @@ private:
     };
   };
 
   inline ValueBaseType BaseType() const;
 
   /**
    * Get the index of an EnumTable in the sEnumTableArray.
    * If the EnumTable is not in the sEnumTableArray, it is added.
-   * If there is no more space in sEnumTableArray, it returns PR_FALSE.
    *
    * @param aTable   the EnumTable to get the index of.
-   * @param aResult  the index of the EnumTable.
-   * @return         whether the index has been found or inserted.
+   * @return         the index of the EnumTable.
    */
-  PRBool GetEnumTableIndex(const EnumTable* aTable, PRInt16& aResult);
+  PRInt16  GetEnumTableIndex(const EnumTable* aTable);
 
   inline void SetPtrValueAndType(void* aValue, ValueBaseType aType);
   void SetIntValueAndType(PRInt32 aValue, ValueType aType,
                           const nsAString* aStringValue);
   void SetColorValue(nscolor aColor, const nsAString& aString);
   void SetMiscAtomOrString(const nsAString* aValue);
   void ResetMiscAtomOrString();
   inline void ResetIfSet();
@@ -372,16 +374,20 @@ private:
   nsStringBuffer* GetStringBuffer(const nsAString& aValue) const;
   // aStrict is set PR_TRUE if stringifying the return value equals with
   // aValue.
   PRInt32 StringToInteger(const nsAString& aValue,
                           PRBool* aStrict,
                           PRInt32* aErrorCode,
                           PRBool aCanBePercent = PR_FALSE,
                           PRBool* aIsPercent = nsnull) const;
+  // Given an enum table and a particular entry in that table, return
+  // the actual integer value we should store.
+  PRInt32 EnumTableEntryToValue(const EnumTable* aEnumTable,
+                                const EnumTable* aTableEntry);  
 
   static nsTArray<const EnumTable*, nsTArrayDefaultAllocator>* sEnumTableArray;
 
   PtrBits mBits;
 };
 
 /**
  * Implementation of inline methods
--- a/content/canvas/test/webgl/crossorigin/test_webgl_crossorigin_textures.html
+++ b/content/canvas/test/webgl/crossorigin/test_webgl_crossorigin_textures.html
@@ -30,18 +30,24 @@
     ok(actual_error == expected_error,
        message + ": expected " + nameForErrorCode(expected_error)
                + ", got " + nameForErrorCode(actual_error));
   }
 
   function testTexture(url, crossOriginAttribute, expected_result) {
     number_of_tests_live++;
     var image = new Image();
-    if (crossOriginAttribute != "leave-default-crossOrigin-attribute")
+    if (crossOriginAttribute == "just-crossOrigin-without-value") {
+      var div = document.createElement('div');
+      div.innerHTML="<img crossOrigin>";
+      image = div.children[0];
+    }
+    else if (crossOriginAttribute != "missing-value-default")
       image.crossOrigin = crossOriginAttribute;
+    
 
     function testDone() {
       number_of_tests_live--;
         
       if (number_of_tests_live == 0 && all_tests_started)
         SimpleTest.finish();
     }
 
@@ -72,66 +78,77 @@
     var canvas = document.getElementById("canvas");
     try {
       gl = canvas.getContext("experimental-webgl");
     } catch (e) {
       SimpleTest.finish();
       return;
     }
 
+
     testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
-                "leave-default-crossOrigin-attribute",
+                "missing-value-default",
                 OK);
-
     testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
                 "",
                 OK);
-
+    testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
+                "just-crossOrigin-without-value",
+                OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
-                "leave-default-crossOrigin-attribute",
+                "missing-value-default",
                 SECURITY_ERR);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
                 "",
                 SECURITY_ERR);
+    testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
+                "just-crossOrigin-without-value",
+                SECURITY_ERR);
 
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
-                "leave-default-crossOrigin-attribute",
+                "missing-value-default",
                 SECURITY_ERR);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
                 "",
-                SECURITY_ERR);
+                OK);
+    testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
+                "just-crossOrigin-without-value",
+                OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
                 "anonymous",
                 OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
                 "use-credentials",
                 SECURITY_ERR);
 
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
-                "leave-default-crossOrigin-attribute",
+                "missing-value-default",
                 SECURITY_ERR);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
                 "",
-                SECURITY_ERR);
+                OK);
+    testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
+                "just-crossOrigin-without-value",
+                OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
                 "anonymous",
                 OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
                 "use-credentials",
                 OK);
 
-    // Test that bad values for crossorigin="..." are interpreted as default.
+    // Test that bad values for crossorigin="..." are interpreted as invalid-value-default which is "anonymous".
     testTexture("http://mochi.test:8888/tests/content/canvas/test/webgl/crossorigin/image.png",
                 "foobar",
                 OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image.png",
                 "foobar",
                 SECURITY_ERR);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-star.png",
                 "foobar",
-                SECURITY_ERR);
+                OK);
     testTexture("http://example.com/tests/content/canvas/test/webgl/crossorigin/image-allow-credentials.png",
                 "foobar",
-                SECURITY_ERR);
+                OK);
 
     all_tests_started = true;
   });
 </script>
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -136,20 +136,16 @@
 #include "mozilla/Services.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHTMLLabelElement.h"
 
 #include "mozilla/Preferences.h"
 
 #ifdef XP_MACOSX
 #import <ApplicationServices/ApplicationServices.h>
-
-#ifdef MOZ_WIDGET_COCOA
-#include "nsCocoaFeatures.h"
-#endif 
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //#define DEBUG_DOCSHELL_FOCUS
 
 #define NS_USER_INTERACTION_INTERVAL 5000 // ms
@@ -372,30 +368,25 @@ public:
   // Be careful, UpdateTransaction may fire a DOM event, therefore, the target
   // frame might be destroyed in the event handler.
   static PRBool UpdateTransaction(PRInt32 aNumLines,
                                   PRBool aScrollHorizontal);
   static void EndTransaction();
   static void OnEvent(nsEvent* aEvent);
   static void Shutdown();
   static PRUint32 GetTimeoutTime();
-  static PRUint32 GetGestureTimeoutTime();
   static PRInt32 AccelerateWheelDelta(PRInt32 aScrollLines,
                    PRBool aIsHorizontal, PRBool aAllowScrollSpeedOverride,
                    nsIScrollableFrame::ScrollUnit *aScrollQuantity,
                    PRBool aLimitToMaxOnePageScroll = PR_TRUE);
   static PRBool IsAccelerationEnabled();
 
   enum {
     kScrollSeriesTimeout = 80
   };
-#ifdef MOZ_WIDGET_COCOA
-  static PRBool GetGestureTriggered();
-  static void SetGestureTriggered();
-#endif
 protected:
   static nsIntPoint GetScreenPoint(nsGUIEvent* aEvent);
   static void OnFailToScrollTarget();
   static void OnTimeout(nsITimer *aTimer, void *aClosure);
   static void SetTimeout();
   static PRUint32 GetIgnoreMoveDelayTime();
   static PRInt32 GetAccelerationStart();
   static PRInt32 GetAccelerationFactor();
@@ -406,29 +397,23 @@ protected:
                    PRBool aIsHorizontal,
                    nsIScrollableFrame::ScrollUnit *aScrollQuantity);
 
   static nsWeakFrame sTargetFrame;
   static PRUint32    sTime;        // in milliseconds
   static PRUint32    sMouseMoved;  // in milliseconds
   static nsITimer*   sTimer;
   static PRInt32     sScrollSeriesCounter;
-#ifdef MOZ_WIDGET_COCOA
-  static PRUint32    sGestureTriggered; // in milliseconds
-#endif
 };
 
 nsWeakFrame nsMouseWheelTransaction::sTargetFrame(nsnull);
 PRUint32    nsMouseWheelTransaction::sTime        = 0;
 PRUint32    nsMouseWheelTransaction::sMouseMoved  = 0;
 nsITimer*   nsMouseWheelTransaction::sTimer       = nsnull;
 PRInt32     nsMouseWheelTransaction::sScrollSeriesCounter = 0;
-#ifdef MOZ_WIDGET_COCOA
-PRUint32      nsMouseWheelTransaction::sGestureTriggered = 0;
-#endif
 
 static PRBool
 OutOfTime(PRUint32 aBaseTime, PRUint32 aThreshold)
 {
   PRUint32 now = PR_IntervalToMilliseconds(PR_IntervalNow());
   return (now - aBaseTime > aThreshold);
 }
 
@@ -497,39 +482,18 @@ nsMouseWheelTransaction::UpdateTransacti
 
 void
 nsMouseWheelTransaction::EndTransaction()
 {
   if (sTimer)
     sTimer->Cancel();
   sTargetFrame = nsnull;
   sScrollSeriesCounter = 0;
-#ifdef MOZ_WIDGET_COCOA
-  sGestureTriggered = 0;
-#endif
 }
 
-#ifdef MOZ_WIDGET_COCOA
-void
-nsMouseWheelTransaction::SetGestureTriggered() {
-  sGestureTriggered = PR_IntervalToMilliseconds(PR_IntervalNow());
-}
-
-PRBool
-nsMouseWheelTransaction::GetGestureTriggered() {
-  if (sGestureTriggered != 0 &&
-      OutOfTime(sGestureTriggered, GetGestureTimeoutTime())) {
-    // Start accepting new gestures
-    sGestureTriggered = 0;
-  }
-
-  return sGestureTriggered != 0;
-}
-#endif
-
 void
 nsMouseWheelTransaction::OnEvent(nsEvent* aEvent)
 {
   if (!sTargetFrame)
     return;
 
   if (OutOfTime(sTime, GetTimeoutTime())) {
     // Even if the scroll event which is handled after timeout, but onTimeout
@@ -666,22 +630,16 @@ nsIntPoint
 nsMouseWheelTransaction::GetScreenPoint(nsGUIEvent* aEvent)
 {
   NS_ASSERTION(aEvent, "aEvent is null");
   NS_ASSERTION(aEvent->widget, "aEvent-widget is null");
   return aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
 }
 
 PRUint32
-nsMouseWheelTransaction::GetGestureTimeoutTime()
-{
-  return Preferences::GetUint("mousewheel.transaction.gesturetimeout", 300);
-}
-
-PRUint32
 nsMouseWheelTransaction::GetTimeoutTime()
 {
   return Preferences::GetUint("mousewheel.transaction.timeout", 1500);
 }
 
 PRUint32
 nsMouseWheelTransaction::GetIgnoreMoveDelayTime()
 {
@@ -2834,32 +2792,16 @@ nsEventStateManager::DoScrollText(nsIFra
             passToParent = PR_TRUE;
             nsMouseWheelTransaction::EndTransaction();
           }
         }
       }
     }
   }
 
-#ifdef MOZ_WIDGET_COCOA
-  // On lion scroll will trigger back/forward at the edge of the page
-  if (isHorizontal && passToParent && nsCocoaFeatures::OnLionOrLater()) {
-    if (!nsMouseWheelTransaction::GetGestureTriggered()) {
-      if (numLines > 4 || numLines < -4) {
-        DoScrollHistory(-numLines);
-        nsMouseWheelTransaction::SetGestureTriggered();
-        return NS_OK;
-      }
-    } else {
-      // Extend the gesture in progress
-      nsMouseWheelTransaction::SetGestureTriggered();
-    }
-  }
-#endif
-
   if (!passToParent && frameToScroll) {
     if (aScrollQuantity == nsIScrollableFrame::LINES) {
       // When this is called for querying the scroll target information,
       // we shouldn't limit the scrolling amount to less one page.
       // Otherwise, we shouldn't scroll more one page at once.
       numLines =
         nsMouseWheelTransaction::AccelerateWheelDelta(numLines, isHorizontal,
                                                       aAllowScrollSpeedOverride,
--- a/content/html/content/src/nsHTMLImageElement.cpp
+++ b/content/html/content/src/nsHTMLImageElement.cpp
@@ -223,25 +223,25 @@ NS_IMPL_INT_ATTR(nsHTMLImageElement, Hsp
 NS_IMPL_BOOL_ATTR(nsHTMLImageElement, IsMap, ismap)
 NS_IMPL_URI_ATTR(nsHTMLImageElement, LongDesc, longdesc)
 NS_IMPL_STRING_ATTR(nsHTMLImageElement, Lowsrc, lowsrc)
 NS_IMPL_URI_ATTR(nsHTMLImageElement, Src, src)
 NS_IMPL_STRING_ATTR(nsHTMLImageElement, UseMap, usemap)
 NS_IMPL_INT_ATTR(nsHTMLImageElement, Vspace, vspace)
 
 static const nsAttrValue::EnumTable kCrossOriginTable[] = {
-  { "",                nsImageLoadingContent::CORS_NONE },
+  // Order matters here; see ParseAttribute
   { "anonymous",       nsImageLoadingContent::CORS_ANONYMOUS },
   { "use-credentials", nsImageLoadingContent::CORS_USE_CREDENTIALS },
   { 0 }
 };
-// Default crossOrigin mode is CORS_NONE.
-static const nsAttrValue::EnumTable* kCrossOriginDefault = &kCrossOriginTable[0];
 
-NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLImageElement, CrossOrigin, crossorigin, kCrossOriginDefault->tag)
+// crossorigin is not "limited to only known values" per spec, so it's
+// just a string attr purposes of the DOM crossOrigin property.
+NS_IMPL_STRING_ATTR(nsHTMLImageElement, CrossOrigin, crossorigin)
 
 NS_IMETHODIMP
 nsHTMLImageElement::GetDraggable(PRBool* aDraggable)
 {
   // images may be dragged unless the draggable attribute is false
   *aDraggable = !AttrValueIs(kNameSpaceID_None, nsGkAtoms::draggable,
                              nsGkAtoms::_false, eIgnoreCase);
   return NS_OK;
@@ -347,17 +347,20 @@ nsHTMLImageElement::ParseAttribute(PRInt
                                    const nsAString& aValue,
                                    nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::align) {
       return ParseAlignValue(aValue, aResult);
     }
     if (aAttribute == nsGkAtoms::crossorigin) {
-      return aResult.ParseEnumValue(aValue, kCrossOriginTable, PR_FALSE);
+      return aResult.ParseEnumValue(aValue, kCrossOriginTable, PR_FALSE,
+                                    // default value is anonymous if aValue is
+                                    // not a value we understand
+                                    &kCrossOriginTable[0]);
     }
     if (ParseImageAttribute(aAttribute, aValue, aResult)) {
       return PR_TRUE;
     }
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
@@ -651,14 +654,16 @@ nsHTMLImageElement::CopyInnerTo(nsGeneri
 }
 
 nsImageLoadingContent::CORSMode
 nsHTMLImageElement::GetCORSMode()
 {
   nsImageLoadingContent::CORSMode ret = nsImageLoadingContent::CORS_NONE;
 
   const nsAttrValue* value = GetParsedAttr(nsGkAtoms::crossorigin);
-  if (value && value->Type() == nsAttrValue::eEnum) {
+  if (value) {
+    NS_ASSERTION(value->Type() == nsAttrValue::eEnum,
+                 "Why is this not an enum value?");
     ret = (nsImageLoadingContent::CORSMode) value->GetEnumValue();
   }
 
   return ret;
 }
--- a/content/html/content/test/test_bug664299.html
+++ b/content/html/content/test/test_bug664299.html
@@ -13,18 +13,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=664299">Mozilla Bug 664299</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script type="application/javascript">
 /** Test to ensure we reflect <img crossorigin> correctly **/
-reflectLimitedEnumerated({
+reflectString({
   element: new Image(),
   attribute: "crossOrigin",
-  validValues: [ "", "anonymous", "use-credentials" ],
-  invalidValues: [ "foobar" ],
-  defaultValue: "" });
+  otherValues: [ "", "anonymous", "ANONYMOUS", "  aNOnYmous    ",
+                 "use-credentials", "USE-CREDENTIALS", "   UsE-CreDEntIALS      ",
+                 "foobar", "FOOBAR", "  fOoBaR  " ]});
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -242,25 +242,16 @@ function populateGraphicsSection() {
     pushInfoRow(trGraphics, "adapterVendorID", hexValueToString(gfxInfo.adapterVendorID));
     pushInfoRow(trGraphics, "adapterDeviceID", hexValueToString(gfxInfo.adapterDeviceID));
     pushInfoRow(trGraphics, "adapterRAM", gfxInfo.adapterRAM);
     pushInfoRow(trGraphics, "adapterDrivers", gfxInfo.adapterDriver);
     pushInfoRow(trGraphics, "driverVersion", gfxInfo.adapterDriverVersion);
     pushInfoRow(trGraphics, "driverDate", gfxInfo.adapterDriverDate);
 
 #ifdef XP_WIN
-    pushInfoRow(trGraphics, "adapterDescription2", gfxInfo.adapterDescription2);
-    pushInfoRow(trGraphics, "adapterVendorID2", hexValueToString(gfxInfo.adapterVendorID2));
-    pushInfoRow(trGraphics, "adapterDeviceID2", hexValueToString(gfxInfo.adapterDeviceID2));
-    pushInfoRow(trGraphics, "adapterRAM2", gfxInfo.adapterRAM2);
-    pushInfoRow(trGraphics, "adapterDrivers2", gfxInfo.adapterDriver2);
-    pushInfoRow(trGraphics, "driverVersion2", gfxInfo.adapterDriverVersion2);
-    pushInfoRow(trGraphics, "driverDate2", gfxInfo.adapterDriverDate2);
-    pushInfoRow(trGraphics, "isGPU2Active", gfxInfo.isGPU2Active);
-
     var version = Cc["@mozilla.org/system-info;1"]
                   .getService(Ci.nsIPropertyBag2)
                   .getProperty("version");
     var isWindowsVistaOrHigher = (parseFloat(version) >= 6.0);
     if (isWindowsVistaOrHigher) {
       var d2dEnabled = "false";
       try {
         d2dEnabled = gfxInfo.D2DEnabled;
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
@@ -26,17 +26,9 @@ clearTypeParameters = ClearType Paramete
 clearTypeParametersNotFound = ClearType parameters not found
 adapterDescription = Adapter Description
 adapterVendorID = Vendor ID
 adapterDeviceID = Device ID
 adapterDrivers = Adapter Drivers
 adapterRAM = Adapter RAM
 driverVersion = Driver Version
 driverDate = Driver Date
-adapterDescription2 = Adapter Description (GPU #2) 
-adapterVendorID2 = Vendor ID (GPU #2) 
-adapterDeviceID2 = Device ID (GPU #2)
-adapterDrivers2 = Adapter Drivers (GPU #2)
-adapterRAM2 = Adapter RAM (GPU #2)
-driverVersion2 = Driver Version (GPU #2)
-driverDate2 = Driver Date (GPU #2)
-isGPU2Active = GPU #2 Active
 webglRenderer = WebGL Renderer
--- a/widget/public/nsGUIEvent.h
+++ b/widget/public/nsGUIEvent.h
@@ -1555,16 +1555,23 @@ class nsSimpleGestureEvent : public nsMo
 public:
   nsSimpleGestureEvent(PRBool isTrusted, PRUint32 msg, nsIWidget* w,
                          PRUint32 directionArg, PRFloat64 deltaArg)
     : nsMouseEvent_base(isTrusted, msg, w, NS_SIMPLE_GESTURE_EVENT),
       direction(directionArg), delta(deltaArg)
   {
   }
 
+  nsSimpleGestureEvent(const nsSimpleGestureEvent& other)
+    : nsMouseEvent_base((other.flags & NS_EVENT_FLAG_TRUSTED) != 0,
+                        other.message, other.widget, NS_SIMPLE_GESTURE_EVENT),
+      direction(other.direction), delta(other.delta)
+  {
+  }
+
   PRUint32 direction;   // See nsIDOMSimpleGestureEvent for values
   PRFloat64 delta;      // Delta for magnify and rotate events
 };
 
 class nsTransitionEvent : public nsEvent
 {
 public:
   nsTransitionEvent(PRBool isTrusted, PRUint32 msg,
--- a/widget/public/nsIGfxInfo.idl
+++ b/widget/public/nsIGfxInfo.idl
@@ -46,48 +46,37 @@ interface nsIGfxInfo : nsISupports
   /*
    * These are win32-specific
    */
   readonly attribute boolean D2DEnabled;
   readonly attribute boolean DWriteEnabled;
   readonly attribute boolean AzureEnabled;
   readonly attribute DOMString DWriteVersion;
   readonly attribute DOMString cleartypeParameters;
-
-  // XXX: Switch to a list of devices, rather than explicitly numbering them. 
-
+  
   /**
    * The name of the display adapter.
    */
   readonly attribute DOMString adapterDescription;
-  readonly attribute DOMString adapterDescription2;
 
   readonly attribute DOMString adapterDriver;
-  readonly attribute DOMString adapterDriver2;
   
   /* These types are inspired by DXGI_ADAPTER_DESC */
   readonly attribute unsigned long adapterVendorID;
-  readonly attribute unsigned long adapterVendorID2;
   
   readonly attribute unsigned long adapterDeviceID;
-  readonly attribute unsigned long adapterDeviceID2;
-
+  
   /**
    * The amount of RAM in MB in the display adapter.
    */
   readonly attribute DOMString adapterRAM;
-  readonly attribute DOMString adapterRAM2;
   
   readonly attribute DOMString adapterDriverVersion;
-  readonly attribute DOMString adapterDriverVersion2;
   
   readonly attribute DOMString adapterDriverDate;
-  readonly attribute DOMString adapterDriverDate2;
-
-  readonly attribute boolean isGPU2Active;
 
   void getFailures(
                [optional] out unsigned long failureCount,
                [retval, array, size_is(failureCount)] out string failures);
 
   [noscript, notxpcom] void logFailure(in ACString failure);
   /*
    * A set of constants for features that we can ask this GfxInfo object
--- a/widget/src/android/GfxInfo.cpp
+++ b/widget/src/android/GfxInfo.cpp
@@ -106,120 +106,64 @@ GfxInfo::GetAdapterDescription(nsAString
       aAdapterDescription.Append(NS_LITERAL_STRING(" "));
       if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", str))
         aAdapterDescription.Append(str);
   }
 
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDescription2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterRAM; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
 {
   aAdapterRAM.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterRAM2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriver; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
 {
   aAdapterDriver.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriver2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverVersion; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
 {
   aAdapterDriverVersion.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverVersion2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverDate; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
 {
   aAdapterDriverDate.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverDate2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterVendorID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
 {
   *aAdapterVendorID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterVendorID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterDeviceID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
 {
   *aAdapterDeviceID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterDeviceID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
-{
-  return NS_ERROR_FAILURE;
-}
-
-/* readonly attribute boolean isGPU2Active; */
-NS_IMETHODIMP
-GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
-{
-  return NS_ERROR_FAILURE;
-}
-
 void
 GfxInfo::AddCrashReportAnnotations()
 {
 #if 0
 #if defined(MOZ_CRASHREPORTER)
   nsCAutoString deviceIDString, vendorIDString;
   PRUint32 deviceID, vendorID;
 
--- a/widget/src/android/GfxInfo.h
+++ b/widget/src/android/GfxInfo.h
@@ -59,24 +59,16 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
   using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init();
 
 protected:
 
--- a/widget/src/cocoa/GfxInfo.h
+++ b/widget/src/cocoa/GfxInfo.h
@@ -59,24 +59,16 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
   using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init();
 
 protected:
 
--- a/widget/src/cocoa/GfxInfo.mm
+++ b/widget/src/cocoa/GfxInfo.mm
@@ -129,120 +129,64 @@ GfxInfo::GetCleartypeParameters(nsAStrin
 /* readonly attribute DOMString adapterDescription; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
 {
   aAdapterDescription = mRendererIDsString;
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDescription2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterRAM; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
 {
   aAdapterRAM = mAdapterRAMString;
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterRAM2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriver; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
 {
   aAdapterDriver.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriver2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverVersion; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
 {
   aAdapterDriverVersion.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverVersion2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverDate; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
 {
   aAdapterDriverDate.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverDate2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterVendorID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
 {
   *aAdapterVendorID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterVendorID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterDeviceID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
 {
   *aAdapterDeviceID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterDeviceID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
-{
-  return NS_ERROR_FAILURE;
-}
-
-/* readonly attribute boolean isGPU2Active; */
-NS_IMETHODIMP
-GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
-{
-  return NS_ERROR_FAILURE;
-}
-
 void
 GfxInfo::AddCrashReportAnnotations()
 {
 #if defined(MOZ_CRASHREPORTER)
   CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterRendererIDs"),
                                      NS_LossyConvertUTF16toASCII(mRendererIDsString));
 
   /* Add an App Note for now so that we get the data immediately. These
@@ -316,11 +260,31 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aF
         default:
           if (mRendererIDs[i])
             foundGoodDevice = PR_TRUE;
       }
     }
     if (!foundGoodDevice)
       status = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
   }
+
+  if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL) {
+    // same comment as above for FEATURE_OPENGL_LAYERS.
+    bool foundGoodDevice = false;
+
+    for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(mRendererIDs); ++i) {
+      switch (mRendererIDs[i]) {
+        case kCGLRendererGeForceFXID: // bug 678053. We must blacklist Geforce 7300 GT. This family
+                                      // covers all Geforce FX, 6, 7 series. Need bug 678330 for finer
+                                      // blacklisting.
+          break;
+        default:
+          if (mRendererIDs[i])
+            foundGoodDevice = true;
+      }
+    }
+    if (!foundGoodDevice)
+      status = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
+  }
+
   *aStatus = status;
   return NS_OK;
 }
--- a/widget/src/cocoa/nsChildView.h
+++ b/widget/src/cocoa/nsChildView.h
@@ -163,16 +163,59 @@ extern "C" long TSMProcessRawKeyEvent(Ev
 @end
 
 // Undocumented scrollPhase flag that lets us discern between real scrolls and
 // automatically firing momentum scroll events.
 @interface NSEvent (ScrollPhase)
 - (long long)_scrollPhase;
 @end
 
+// The following section, required to support fluid swipe tracking on OS X 10.7
+// and up, contains defines/declarations that are only available on 10.7 and up.
+// [NSEvent trackSwipeEventWithOptions:...] also requires that the compiler
+// support "blocks"
+// (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html)
+// -- which it does on 10.6 and up (using the 10.6 SDK or higher).
+#ifdef __LP64__
+enum {
+  NSEventPhaseNone        = 0,
+  NSEventPhaseBegan       = 0x1 << 0,
+  NSEventPhaseStationary  = 0x1 << 1,
+  NSEventPhaseChanged     = 0x1 << 2,
+  NSEventPhaseEnded       = 0x1 << 3,
+  NSEventPhaseCancelled   = 0x1 << 4,
+};
+typedef NSUInteger NSEventPhase;
+
+enum {
+  NSEventSwipeTrackingLockDirection = 0x1 << 0,
+  NSEventSwipeTrackingClampGestureAmount = 0x1 << 1
+};
+typedef NSUInteger NSEventSwipeTrackingOptions;
+
+enum {
+  NSEventGestureAxisNone = 0,
+  NSEventGestureAxisHorizontal,
+  NSEventGestureAxisVertical
+};
+typedef NSInteger NSEventGestureAxis;
+
+@interface NSEvent (FluidSwipeTracking)
++ (BOOL)isSwipeTrackingFromScrollEventsEnabled;
+- (BOOL)hasPreciseScrollingDeltas;
+- (CGFloat)scrollingDeltaX;
+- (CGFloat)scrollingDeltaY;
+- (NSEventPhase)phase;
+- (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options
+          dampenAmountThresholdMin:(CGFloat)minDampenThreshold
+                               max:(CGFloat)maxDampenThreshold
+                      usingHandler:(void (^)(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL *stop))trackingHandler;
+@end
+#endif // #ifdef __LP64__
+
 @interface ChildView : NSView<
 #ifdef ACCESSIBILITY
                               mozAccessible,
 #endif
                               mozView, NSTextInput>
 {
 @private
   // the nsChildView that created the view. It retains this NSView, so
@@ -234,16 +277,21 @@ extern "C" long TSMProcessRawKeyEvent(Ev
     eGestureState_StartGesture,
     eGestureState_MagnifyGesture,
     eGestureState_RotateGesture
   } mGestureState;
   float mCumulativeMagnification;
   float mCumulativeRotation;
 
   BOOL mDidForceRefreshOpenGL;
+
+  // Support for fluid swipe tracking.
+#ifdef __LP64__
+  BOOL *mSwipeAnimationCancelled;
+#endif
 }
 
 // class initialization
 + (void)initialize;
 
 // these are sent to the first responder when the window key status changes
 - (void)viewsWindowDidBecomeKey;
 - (void)viewsWindowDidResignKey;
@@ -281,16 +329,22 @@ extern "C" long TSMProcessRawKeyEvent(Ev
 //
 // The prototypes were obtained from the following link:
 // http://cocoadex.com/2008/02/nsevent-modifications-swipe-ro.html
 - (void)swipeWithEvent:(NSEvent *)anEvent;
 - (void)beginGestureWithEvent:(NSEvent *)anEvent;
 - (void)magnifyWithEvent:(NSEvent *)anEvent;
 - (void)rotateWithEvent:(NSEvent *)anEvent;
 - (void)endGestureWithEvent:(NSEvent *)anEvent;
+
+// Support for fluid swipe tracking.
+#ifdef __LP64__
+- (void)maybeTrackScrollEventAsSwipe:(NSEvent *)anEvent
+                      scrollOverflow:(PRInt32)overflow;
+#endif
 @end
 
 class ChildViewMouseTracker {
 
 public:
 
   static void MouseMoved(NSEvent* aEvent);
   static void OnDestroyView(ChildView* aView);
--- a/widget/src/cocoa/nsChildView.mm
+++ b/widget/src/cocoa/nsChildView.mm
@@ -42,16 +42,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG
 #endif
 #include "prlog.h"
 
 #include <unistd.h>
+#include <math.h>
  
 #include "nsChildView.h"
 #include "nsCocoaWindow.h"
 
 #include "nsObjCExceptions.h"
 #include "nsCOMPtr.h"
 #include "nsToolkit.h"
 #include "nsCRT.h"
@@ -2007,16 +2008,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
     // We can't call forceRefreshOpenGL here because, in order to work around
     // the bug, it seems we need to have a draw already happening. Therefore,
     // we call it in drawRect:inContext:, when we know that a draw is in
     // progress.
     mDidForceRefreshOpenGL = NO;
 
     [self setFocusRingType:NSFocusRingTypeNone];
+
+#ifdef __LP64__
+    mSwipeAnimationCancelled = nil;
+#endif
   }
   
   // register for things we'll take from other applications
   PR_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView initWithFrame: registering drag types\n"));
   [self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
                                                           NSStringPboardType,
                                                           NSHTMLPboardType,
                                                           NSURLPboardType,
@@ -2982,16 +2987,136 @@ NSEvent* gLastDragMouseDownEvent = nil;
   // Clear the gestures state.
   mGestureState = eGestureState_None;
   mCumulativeMagnification = 0.0;
   mCumulativeRotation = 0.0;
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
+// Support fluid swipe tracking on OS X 10.7 and higher.  We must be careful
+// to only invoke this support on a horizontal two-finger gesture that really
+// is a swipe (and not a scroll) -- in other words, the app is responsible
+// for deciding which is which.  But once the decision is made, the OS tracks
+// the swipe until it has finished, and decides whether or not it succeeded.
+// A swipe has the same functionality as the Back and Forward buttons.  For
+// now swipe animation is unsupported (e.g. no bounces).  This method is
+// partly based on Apple sample code available at
+// http://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKit.html
+// (under Fluid Swipe Tracking API).
+#ifdef __LP64__
+- (void)maybeTrackScrollEventAsSwipe:(NSEvent *)anEvent
+                      scrollOverflow:(PRInt32)overflow
+{
+  if (!nsToolkit::OnLionOrLater()) {
+    return;
+  }
+  // This method checks whether the AppleEnableSwipeNavigateWithScrolls global
+  // preference is set.  If it isn't, fluid swipe tracking is disabled, and a
+  // horizontal two-finger gesture is always a scroll (even in Safari).  This
+  // preference can't (currently) be set from the Preferences UI -- only using
+  // 'defaults write'.
+  if (![NSEvent isSwipeTrackingFromScrollEventsEnabled]) {
+    return;
+  }
+  if ([anEvent type] != NSScrollWheel) {
+    return;
+  }
+
+  // If a swipe is currently being tracked kill it -- it's been interrupted by
+  // another gesture or legacy scroll wheel event.
+  if (mSwipeAnimationCancelled && (*mSwipeAnimationCancelled == NO)) {
+    *mSwipeAnimationCancelled = YES;
+    mSwipeAnimationCancelled = nil;
+  }
+
+  // Only initiate tracking if the user has tried to scroll past the edge of
+  // the current page (as indicated by 'overflow' being non-zero).  Gecko only
+  // sets nsMouseScrollEvent.scrollOverflow when it's processing
+  // NS_MOUSE_PIXEL_SCROLL events (not NS_MOUSE_SCROLL events).
+  // nsMouseScrollEvent.scrollOverflow only indicates left or right overflow
+  // for horizontal NS_MOUSE_PIXEL_SCROLL events.
+  if (!overflow) {
+    return;
+  }
+  // Only initiate tracking for gestures that have just begun -- otherwise a
+  // scroll to one side of the page can have a swipe tacked on to it.
+  if ([anEvent phase] != NSEventPhaseBegan) {
+    return;
+  }
+  CGFloat deltaX, deltaY;
+  if ([anEvent hasPreciseScrollingDeltas]) {
+    deltaX = [anEvent scrollingDeltaX];
+    deltaY = [anEvent scrollingDeltaY];
+  } else {
+    deltaX = [anEvent deltaX];
+    deltaY = [anEvent deltaY];
+  }
+  // Only initiate tracking for events whose horizontal element is at least
+  // eight times larger than its vertical element.  This minimizes performance
+  // problems with vertical scrolls (by minimizing the possibility that they'll
+  // be misinterpreted as horizontal swipes), while still tolerating a small
+  // vertical element to a true horizontal swipe.  The number '8' was arrived
+  // at by trial and error.
+  if ((deltaX == 0) || (fabs(deltaX) <= fabs(deltaY) * 8)) {
+    return;
+  }
+
+  // geckoEvent must be initialized now (while anEvent is still available),
+  // but we also need to access it (and modify it) in the following "block"
+  // (the trackingHandler passed to [NSEvent trackSwipeEventWithOptions:...]).
+  // Normally we'd give it the '__block' keyword, but this makes the compiler
+  // crash :-(  Without the '__block' keyword, it becomes immutable from
+  // trackingHandler.  So trackingHandler must make a copy of it and modify
+  // that.
+  nsSimpleGestureEvent geckoEvent(PR_TRUE, NS_SIMPLE_GESTURE_SWIPE, mGeckoChild, 0, 0.0);
+  [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
+
+  __block BOOL animationCancelled = NO;
+  // At this point, anEvent is the first scroll wheel event in a two-finger
+  // horizontal gesture that we've decided to treat as a swipe.  When we call
+  // [NSEvent trackSwipeEventWithOptions:...], the OS interprets all
+  // subsequent scroll wheel events that are part of this gesture as a swipe,
+  // and stops sending them to us.  The OS calls the trackingHandler "block"
+  // multiple times, asynchronously (sometimes after [NSEvent
+  // maybeTrackScrollEventAsSwipe:...] has returned).  The OS determines when
+  // the gesture has finished, and whether or not it was "successful" -- this
+  // information is passed to trackingHandler.  We must be careful to only
+  // call [NSEvent maybeTrackScrollEventAsSwipe:...] on a "real" swipe --
+  // otherwise two-finger scrolling performance will suffer significantly.
+  [anEvent trackSwipeEventWithOptions:0
+             dampenAmountThresholdMin:-1
+                                  max:1
+                         usingHandler:^(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL *stop) {
+      if (animationCancelled) {
+        *stop = YES;
+        return;
+      }
+      if (isComplete) {
+        if (gestureAmount) {
+          nsSimpleGestureEvent geckoEventCopy(geckoEvent);
+          if (gestureAmount > 0) {
+            geckoEventCopy.direction |= nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
+          } else {
+            geckoEventCopy.direction |= nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
+          }
+          mGeckoChild->DispatchWindowEvent(geckoEventCopy);
+        }
+        mSwipeAnimationCancelled = nil;
+      }
+    }];
+
+  // We keep a pointer to the __block variable (animationCanceled) so we
+  // can cancel our block handler at any time.  Note: We must assign
+  // &animationCanceled after our block creation and copy -- its address
+  // isn't resolved until then!
+  mSwipeAnimationCancelled = &animationCancelled;
+}
+#endif // #ifdef __LP64__
+
 // Returning NO from this method only disallows ordering on mousedown - in order
 // to prevent it for mouseup too, we need to call [NSApp preventWindowOrdering]
 // when handling the mousedown event.
 - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent*)aEvent
 {
   // Always using system-provided window ordering for normal windows.
   if (![[self window] isKindOfClass:[PopupWindow class]])
     return NO;
@@ -3665,16 +3790,27 @@ NSEvent* gLastDragMouseDownEvent = nil;
     nsMouseScrollEvent geckoEvent(PR_TRUE, NS_MOUSE_PIXEL_SCROLL, nsnull);
     [self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
     geckoEvent.scrollFlags |= inAxis;
     if (isMomentumScroll)
       geckoEvent.scrollFlags |= nsMouseScrollEvent::kIsMomentum;
     geckoEvent.delta = NSToIntRound(scrollDeltaPixels);
     nsAutoRetainCocoaObject kungFuDeathGrip(self);
     mGeckoChild->DispatchWindowEvent(geckoEvent);
+#ifdef __LP64__
+    // scrollOverflow tells us when the user has tried to scroll past the edge
+    // of a page (in those cases it's non-zero).  Gecko only sets it when
+    // processing NS_MOUSE_PIXEL_SCROLL events (not MS_MOUSE_SCROLL events).
+    // It only means left/right overflow when Gecko is processing a horizontal
+    // event.
+    if (inAxis & nsMouseScrollEvent::kIsHorizontal) {
+      [self maybeTrackScrollEventAsSwipe:theEvent
+                          scrollOverflow:geckoEvent.scrollOverflow];
+    }
+#endif // #ifdef __LP64__
   }
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 -(void)scrollWheel:(NSEvent*)theEvent
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
--- a/widget/src/windows/GfxInfo.cpp
+++ b/widget/src/windows/GfxInfo.cpp
@@ -33,17 +33,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <windows.h>
 #include <setupapi.h>
-#include "d3d9.h"
 #include "gfxWindowsPlatform.h"
 #include "GfxInfo.h"
 #include "GfxInfoWebGL.h"
 #include "nsUnicharUtils.h"
 #include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "GfxDriverInfo.h"
@@ -73,21 +72,17 @@ static const PRUint32 vendorAMD = 0x1022
 static const PRUint32 vendorATI = 0x1002;
 
 #define V(a,b,c,d) GFX_DRIVER_VERSION(a,b,c,d)
 
 
 GfxInfo::GfxInfo()
   : mAdapterVendorID(0),
     mAdapterDeviceID(0),
-    mAdapterVendorID2(0),
-    mAdapterDeviceID2(0),
-    mWindowsVersion(0),
-    mHasDualGPU(PR_FALSE),
-    mIsGPU2Active(PR_FALSE)
+    mWindowsVersion(0)
 {
 }
 
 /* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after gfxPlatform initialization
  * has occurred because they depend on it for information. (See bug 591561) */
 nsresult
 GfxInfo::GetD2DEnabled(PRBool *aEnabled)
 {
@@ -199,52 +194,17 @@ GfxInfo::GetCleartypeParameters(nsAStrin
 
   if (foundData) {
     aCleartypeParams.Assign(outStr);
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
-typedef IDirect3D9* (WINAPI*Direct3DCreate9Func) (
-  UINT SDKVersion
-);
-
-// XXX: Blacklisting logic doesn't use the result of this for now. Bug #628129.
-void
-GfxInfo::IdentifyActiveDevice()
-{
-  
-  HMODULE d3d9 = LoadLibraryW(L"d3d9.dll");
-  if (!d3d9) {
-    NS_WARNING("Couldn't load d3d9.dll");
-    return;
-  }
-  
-  Direct3DCreate9Func d3d9Create = (Direct3DCreate9Func) 
-    GetProcAddress(d3d9, "Direct3DCreate9");
-  if (!d3d9Create) {
-    NS_WARNING("Couldn't get Direct3DCreate9 function");
-    return;
-  }
-
-  nsRefPtr<IDirect3D9> d3d9Object = dont_AddRef(d3d9Create(D3D_SDK_VERSION));;
-  if (!d3d9Object) {
-    NS_WARNING("Couldn't create d3d9object");
-    return;
-  }
-
-  D3DADAPTER_IDENTIFIER9 ident;
-  HRESULT result = d3d9Object->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &ident);
-  
-  if ((result == D3D_OK) && 
-      (mAdapterVendorID2 == ident.VendorId) && (mAdapterDeviceID2 = ident.DeviceId)) {
-    mIsGPU2Active = PR_TRUE;
-  } 
-}
+/* XXX: GfxInfo doesn't handle multiple GPUs. We should try to do that. Bug #591057 */
 
 static nsresult GetKeyValue(const WCHAR* keyLocation, const WCHAR* keyName, nsAString& destString, int type)
 {
   HKEY key;
   DWORD dwcbData;
   DWORD dValue;
   DWORD resultType;
   LONG result;
@@ -444,111 +404,47 @@ GfxInfo::Init()
               dwcbData = sizeof(value);
               result = RegQueryValueExW(key, L"DriverVersion", NULL, NULL, (LPBYTE)value, &dwcbData);
               if (result == ERROR_SUCCESS)
                 mDriverVersion = value;
               dwcbData = sizeof(value);
               result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
               if (result == ERROR_SUCCESS)
                 mDriverDate = value;
-              RegCloseKey(key); 
-
-              // Check for second adapter:
-              //
-              // A second adapter will have the same driver key as the first adapter except for 
-              // the last character, where '1' will be swapped for '0' or vice-versa.
-              // We know driverKey.Length() > 0 since driverKeyPre is a prefix of driverKey.
-              if (driverKey[driverKey.Length()-1] == '0') {
-                driverKey.SetCharAt('1', driverKey.Length()-1);
-              } else {
-                driverKey.SetCharAt('0', driverKey.Length()-1);
-              }
-              result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.BeginReading(), 0, KEY_QUERY_VALUE, &key);
-              if (result == ERROR_SUCCESS) {
-                mHasDualGPU = PR_TRUE;
-                mDeviceKey2 = driverKey;
-                dwcbData = sizeof(value);
-                result = RegQueryValueExW(key, L"DriverVersion", NULL, NULL, (LPBYTE)value, &dwcbData);
-                if (result == ERROR_SUCCESS)
-                  mDriverVersion2 = value;
-                dwcbData = sizeof(value);
-                result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
-                if (result == ERROR_SUCCESS)
-                  mDriverDate2 = value;
-                dwcbData = sizeof(value);
-                result = RegQueryValueExW(key, L"Device Description", NULL, NULL, (LPBYTE)value, &dwcbData);
-                if (result == ERROR_SUCCESS)
-                  mDeviceString2 = value;
-                dwcbData = sizeof(value);
-                result = RegQueryValueExW(key, L"MatchingDeviceId", NULL, NULL, (LPBYTE)value, &dwcbData);
-                if (result == ERROR_SUCCESS)
-                  mDeviceID2 = value;
-                RegCloseKey(key);
-              }  
+              RegCloseKey(key);
               break;
             }
           }
         }
 
         setupDestroyDeviceInfoList(devinfo);
       }
     }
 
     FreeLibrary(setupapi);
   }
 
-  nsAutoString vendor(mDeviceID);
-  ToUpperCase(vendor);
-  PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
-  if (start != -1) {
-    vendor.Cut(0, start + strlen("VEN_"));
-    vendor.Truncate(4);
-  }
-  nsresult err;
-  mAdapterVendorID = vendor.ToInteger(&err, 16);
-  
-  vendor = mDeviceID2;
-  ToUpperCase(vendor);
-  start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
-  if (start != -1) {
-    vendor.Cut(0, start + strlen("VEN_"));
-    vendor.Truncate(4);
-  }
-  mAdapterVendorID2 = vendor.ToInteger(&err, 16);
-
-  nsAutoString device(mDeviceID);
-  ToUpperCase(device);
-  start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
-  if (start != -1) {
-    device.Cut(0, start + strlen("&DEV_"));
-    device.Truncate(4);
-  }
-  mAdapterDeviceID = device.ToInteger(&err, 16);
-  
-  device = mDeviceID2;
-  ToUpperCase(device);
-  start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
-  if (start != -1) {
-    device.Cut(0, start + strlen("&DEV_"));
-    device.Truncate(4);
-  }
-  mAdapterDeviceID2 = device.ToInteger(&err, 16);
-  
-  if (mHasDualGPU) {
-    IdentifyActiveDevice();
-  }
-
   const char *spoofedDriverVersionString = PR_GetEnv("MOZ_GFX_SPOOF_DRIVER_VERSION");
   if (spoofedDriverVersionString) {
     mDriverVersion.AssignASCII(spoofedDriverVersionString);
   }
 
   const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_VENDOR_ID");
   if (spoofedVendor) {
      PR_sscanf(spoofedVendor, "%x", &mAdapterVendorID);
+  } else {
+    nsAutoString vendor(mDeviceID);
+    ToUpperCase(vendor);
+    PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
+    if (start != -1) {
+      vendor.Cut(0, start + strlen("VEN_"));
+      vendor.Truncate(4);
+    }
+    nsresult err;
+    mAdapterVendorID = vendor.ToInteger(&err, 16);
   }
 
   mHasDriverVersionMismatch = PR_FALSE;
   if (mAdapterVendorID == vendorIntel) {
     // we've had big crashers (bugs 590373 and 595364) apparently correlated
     // with bad Intel driver installations where the DriverVersion reported
     // by the registry was not the version of the DLL.
     PRBool is64bitApp = sizeof(void*) == 8;
@@ -567,16 +463,26 @@ GfxInfo::Init()
     // so this test implicitly handles the case where GetDLLVersion failed
     if (dllNumericVersion != driverNumericVersion)
       mHasDriverVersionMismatch = PR_TRUE;
   }
 
   const char *spoofedDevice = PR_GetEnv("MOZ_GFX_SPOOF_DEVICE_ID");
   if (spoofedDevice) {
     PR_sscanf(spoofedDevice, "%x", &mAdapterDeviceID);
+  } else {
+    nsAutoString device(mDeviceID);
+    ToUpperCase(device);
+    PRInt32 start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
+    if (start != -1) {
+      device.Cut(0, start + strlen("&DEV_"));
+      device.Truncate(4);
+    }
+    nsresult err;
+    mAdapterDeviceID = device.ToInteger(&err, 16);
   }
 
   const char *spoofedWindowsVersion = PR_GetEnv("MOZ_GFX_SPOOF_WINDOWS_VERSION");
   if (spoofedWindowsVersion) {
     PR_sscanf(spoofedWindowsVersion, "%x", &mWindowsVersion);
   } else {
     mWindowsVersion = gfxWindowsPlatform::WindowsOSVersion();
   }
@@ -589,132 +495,66 @@ GfxInfo::Init()
 /* readonly attribute DOMString adapterDescription; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
 {
   aAdapterDescription = mDeviceString;
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDescription2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
-{
-  aAdapterDescription = mDeviceString2;
-  return NS_OK;
-}
-
 /* readonly attribute DOMString adapterRAM; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
 {
   if (NS_FAILED(GetKeyValue(mDeviceKey.BeginReading(), L"HardwareInformation.MemorySize", aAdapterRAM, REG_DWORD)))
     aAdapterRAM = L"Unknown";
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterRAM2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
-{
-  if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"HardwareInformation.MemorySize", aAdapterRAM, REG_DWORD)))
-    aAdapterRAM = L"Unknown";
-  return NS_OK;
-}
-
 /* readonly attribute DOMString adapterDriver; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
 {
   if (NS_FAILED(GetKeyValue(mDeviceKey.BeginReading(), L"InstalledDisplayDrivers", aAdapterDriver, REG_MULTI_SZ)))
     aAdapterDriver = L"Unknown";
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriver2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
-{
-  if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"InstalledDisplayDrivers", aAdapterDriver, REG_MULTI_SZ)))
-    aAdapterDriver = L"Unknown";
-  return NS_OK;
-}
-
 /* readonly attribute DOMString adapterDriverVersion; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
 {
   aAdapterDriverVersion = mDriverVersion;
   return NS_OK;
 }
 
 /* readonly attribute DOMString adapterDriverDate; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
 {
   aAdapterDriverDate = mDriverDate;
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverVersion2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
-{
-  aAdapterDriverVersion = mDriverVersion2;
-  return NS_OK;
-}
-
-/* readonly attribute DOMString adapterDriverDate2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
-{
-  aAdapterDriverDate = mDriverDate2;
-  return NS_OK;
-}
-
 /* readonly attribute unsigned long adapterVendorID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
 {
   *aAdapterVendorID = mAdapterVendorID;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterVendorID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
-{
-  *aAdapterVendorID = mAdapterVendorID2;
-  return NS_OK;
-}
-
 /* readonly attribute unsigned long adapterDeviceID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
 {
   *aAdapterDeviceID = mAdapterDeviceID;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterDeviceID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
-{
-  *aAdapterDeviceID = mAdapterDeviceID2;
-  return NS_OK;
-}
-
-/* readonly attribute boolean isGPU2Active; */
-NS_IMETHODIMP
-GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
-{
-  *aIsGPU2Active = mIsGPU2Active;
-  return NS_OK;
-}
-
 #if defined(MOZ_CRASHREPORTER)
 /* Cisco's VPN software can cause corruption of the floating point state.
  * Make a note of this in our crash reports so that some weird crashes
  * make more sense */
 static void
 CheckForCiscoVPN() {
   LONG result;
   HKEY key;
@@ -762,29 +602,16 @@ GfxInfo::AddCrashReportAnnotations()
       /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */
       note.Append(", ");
       note.AppendWithConversion(mDeviceID);
       note.Append(", ");
       note.AppendWithConversion(mDeviceKeyDebug);
   }
   note.Append("\n");
 
-  if (mHasDualGPU) {
-    PRUint32 deviceID2, vendorID2;
-    nsAutoString adapterDriverVersionString2;
-
-    note.Append("Has dual GPUs. GPU #2: ");
-    GetAdapterDeviceID2(&deviceID2);
-    GetAdapterVendorID2(&vendorID2);
-    GetAdapterDriverVersion2(adapterDriverVersionString2);
-    note.AppendPrintf("AdapterVendorID2: %04x, ", vendorID2);
-    note.AppendPrintf("AdapterDeviceID2: %04x, ", deviceID2);
-    note.AppendPrintf("AdapterDriverVersion2: ");
-    note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
-  }
   CrashReporter::AppendAppNotesToCrashReport(note);
 
 #endif
 }
 
 #define V(a,b,c,d) GFX_DRIVER_VERSION(a,b,c,d)
 
 static const PRUint32 deviceFamilyIntelGMA500[] = {
--- a/widget/src/windows/GfxInfo.h
+++ b/widget/src/windows/GfxInfo.h
@@ -63,24 +63,16 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
   using GfxInfoBase::GetWebGLParameter;
 
 #ifdef DEBUG
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIGFXINFODEBUG
 #endif
@@ -89,34 +81,24 @@ public:
 
 protected:
 
   virtual nsresult GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion, GfxDriverInfo* aDriverInfo = nsnull);
 
 private:
 
   void AddCrashReportAnnotations();
-  void IdentifyActiveDevice();
   nsString mDeviceString;
   nsString mDeviceID;
   nsString mDriverVersion;
   nsString mDriverDate;
   nsString mDeviceKey;
   nsString mDeviceKeyDebug;
   PRUint32 mAdapterVendorID;
   PRUint32 mAdapterDeviceID;
-  nsString mDeviceString2;
-  nsString mDriverVersion2;
-  nsString mDeviceID2;
-  nsString mDriverDate2;
-  nsString mDeviceKey2;
-  PRUint32 mAdapterVendorID2;
-  PRUint32 mAdapterDeviceID2;
   PRUint32 mWindowsVersion;
-  PRBool mHasDualGPU;
-  PRBool mIsGPU2Active;
   PRBool mHasDriverVersionMismatch;
 };
 
 } // namespace widget
 } // namespace mozilla
 
 #endif /* __mozilla_widget_GfxInfo_h__ */
--- a/widget/src/xpwidgets/GfxInfoX11.cpp
+++ b/widget/src/xpwidgets/GfxInfoX11.cpp
@@ -338,116 +338,60 @@ GfxInfo::GetCleartypeParameters(nsAStrin
 NS_IMETHODIMP
 GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
 {
   GetData();
   AppendASCIItoUTF16(mAdapterDescription, aAdapterDescription);
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDescription2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterRAM; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
 {
   aAdapterRAM.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterRAM2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriver; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
 {
   aAdapterDriver.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriver2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverVersion; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
 {
   GetData();
   CopyASCIItoUTF16(mVersion, aAdapterDriverVersion);
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverVersion2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute DOMString adapterDriverDate; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
 {
   aAdapterDriverDate.AssignLiteral("");
   return NS_OK;
 }
 
-/* readonly attribute DOMString adapterDriverDate2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterVendorID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
 {
   *aAdapterVendorID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterVendorID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
-{
-  return NS_ERROR_FAILURE;
-}
-
 /* readonly attribute unsigned long adapterDeviceID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
 {
   *aAdapterDeviceID = 0;
   return NS_OK;
 }
 
-/* readonly attribute unsigned long adapterDeviceID2; */
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
-{
-  return NS_ERROR_FAILURE;
-}
-
-/* readonly attribute boolean isGPU2Active; */
-NS_IMETHODIMP
-GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
-{
-  return NS_ERROR_FAILURE;
-}
-
 
 } // end namespace widget
 } // end namespace mozilla
--- a/widget/src/xpwidgets/GfxInfoX11.h
+++ b/widget/src/xpwidgets/GfxInfoX11.h
@@ -58,24 +58,16 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID(PRUint32 *aAdapterVendorID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID(PRUint32 *aAdapterDeviceID);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
   NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
-  NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
-  NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
   using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init();
 
 protected: