Merge Places and mozilla-central.
authorShawn Wilsher <me@shawnwilsher.com>
Mon, 11 Apr 2011 13:59:20 -0700
changeset 67863 832de5e41bd2f7a99038df4d9eb902f86c68d6bb
parent 67862 e72813d821b8c50f541418663c9ab8fa163bff35 (current diff)
parent 67860 ede9a23ec516c2eb0221be6ff29046412a547acd (diff)
child 67864 94874a2f3bb3e7e58159aebcfdb5bb5e2d091aaf
child 68473 2b7578c84821836e6ebafecf0a1555741352da40
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge Places and mozilla-central.
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -152,17 +152,17 @@ Sanitizer.prototype = {
         }
         else {
           // Remove everything
           cookieMgr.removeAll();
         }
 
         // Clear plugin data.
         let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-        const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+        const phInterface = Ci.nsIPluginHost;
         const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
         ph.QueryInterface(phInterface);
 
         // Determine age range in seconds. (-1 means clear all.) We don't know
         // that this.range[1] is actually now, so we compute age range based
         // on the lower bound. If this.range results in a negative age, do
         // nothing.
         let age = this.range ? (Date.now() / 1000 - this.range[0] / 1000000)
--- a/browser/base/content/test/browser_clearplugindata.js
+++ b/browser/base/content/test/browser_clearplugindata.js
@@ -5,17 +5,17 @@
 
 // Test clearing plugin data using sanitize.js.
 const testURL1 = "http://mochi.test:8888/browser/browser/base/content/test/browser_clearplugindata.html";
 const testURL2 = "http://mochi.test:8888/browser/browser/base/content/test/browser_clearplugindata_noage.html";
 
 Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
                                            .loadSubScript("chrome://browser/content/sanitize.js");
 
-const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+const pluginHostIface = Ci.nsIPluginHost;
 var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
 pluginHost.QueryInterface(pluginHostIface);
 
 var pluginTag;
 var s;
 
 function stored(needles) {
   var something = pluginHost.siteHasData(this.pluginTag, null);
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -613,17 +613,17 @@ PrivateBrowsingService.prototype = {
       while (enumerator.hasMoreElements()) {
         let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
         cm.remove(cookie.host, cookie.name, cookie.path, false);
       }
     }
 
     // Plugin data
     let (ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost)) {
-      const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+      const phInterface = Ci.nsIPluginHost;
       const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
       ph.QueryInterface(phInterface);
 
       let tags = ph.getPluginTags();
       for (let i = 0; i < tags.length; i++) {
         try {
           ph.clearSiteData(tags[i], aDomain, FLAG_CLEAR_ALL, -1);
         } catch (e) {
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.js
@@ -1,17 +1,17 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test clearing plugin data by domain using nsPrivateBrowsingService.
 const testURL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.html";
 
-const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+const pluginHostIface = Ci.nsIPluginHost;
 var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
 pluginHost.QueryInterface(pluginHostIface);
 
 var pluginTag;
 
 function stored(needles) {
   var something = pluginHost.siteHasData(this.pluginTag, null);
   if (!needles)
--- a/content/base/public/nsIContentUtils.h
+++ b/content/base/public/nsIContentUtils.h
@@ -86,35 +86,9 @@ public:
 
   virtual nsIInterfaceRequestor* GetSameOriginChecker();
   // Returns NS_OK for same origin, error (NS_ERROR_DOM_BAD_URI) if not.
   virtual nsresult CheckSameOrigin(nsIChannel *aOldChannel, nsIChannel *aNewChannel);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils2, NS_ICONTENTUTILS2_IID)
 
-#ifndef MOZ_ENABLE_LIBXUL
-// nsIContentUtils_MOZILLA_2_0_BRANCH is a non-libxul only interface to enable
-// us keep those builds working.
-
-#define NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_IID \
-{ 0x0fe8099c, 0x622a, 0x4c79, \
-{ 0xb0, 0x02, 0x55, 0xf0, 0x44, 0x34, 0x00, 0x30 } }
-
-class nsIContentUtils_MOZILLA_2_0_BRANCH : public nsISupports
-{
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTURILS_MOZILLA_2_0_BRANCH_IID)
-  NS_DECL_ISUPPORTS
-
-  virtual nsresult DispatchTrustedEvent(nsIDocument* aDoc,
-                                        nsISupports* aTarget,
-                                        const nsAString& aEventName,
-                                        PRBool aCanBubble,
-                                        PRBool aCancelable,
-                                        PRBool *aDefaultAction = nsnull);
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils_MOZILLA_2_0_BRANCH, NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_IID)
-
-#endif
-
 #endif /* nsIContentUtils_h__ */
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -6509,26 +6509,8 @@ nsIContentUtils2::GetSameOriginChecker()
   return nsContentUtils::GetSameOriginChecker();
 }
 
 nsresult
 nsIContentUtils2::CheckSameOrigin(nsIChannel *aOldChannel, nsIChannel *aNewChannel)
 {
   return nsContentUtils::CheckSameOrigin(aOldChannel, aNewChannel);
 }
-
-#ifndef MOZ_ENABLE_LIBXUL
-
-NS_IMPL_ISUPPORTS1(nsIContentUtils_MOZILLA_2_0_BRANCH, nsIContentUtils_MOZILLA_2_0_BRANCH)
-
-nsresult
-nsIContentUtils_MOZILLA_2_0_BRANCH::DispatchTrustedEvent(nsIDocument* aDoc,
-                                                         nsISupports* aTarget,
-                                                         const nsAString& aEventName,
-                                                         PRBool aCanBubble,
-                                                         PRBool aCancelable,
-                                                         PRBool *aDefaultAction)
-{
-  return nsContentUtils::DispatchTrustedEvent(aDoc, aTarget, aEventName,
-                                              aCanBubble, aCancelable, aDefaultAction);
-}
-
-#endif
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -892,20 +892,18 @@ nsTextInputListener::EditAction()
   // no undo items; JS could change the value and we'd still need to save it)
   frame->SetValueChanged(PR_TRUE);
 
   if (!mSettingValue) {
     mTxtCtrlElement->OnValueChanged(PR_TRUE);
   }
 
   // Fire input event
-  nsCOMPtr<nsIEditor_MOZILLA_2_0_BRANCH> editor20 = do_QueryInterface(editor);
-  NS_ASSERTION(editor20, "Something is very wrong!");
   PRBool trusted = PR_FALSE;
-  editor20->GetLastKeypressEventTrusted(&trusted);
+  editor->GetLastKeypressEventTrusted(&trusted);
   frame->FireOnInput(trusted);
 
   // mFrame may be dead after this, but we don't need to check for it, because
   // we are not uisng it in this function any more.
 
   return NS_OK;
 }
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -512,16 +512,22 @@ NS_IMETHODIMP
 nsDummyJavaPluginOwner::GetWindow(NPWindow *&aWindow)
 {
   aWindow = nsnull;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDummyJavaPluginOwner::SetWindow()
+{
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
 nsDummyJavaPluginOwner::GetMode(PRInt32 *aMode)
 {
   // This is wrong, but there's no better alternative.
   *aMode = NP_EMBED;
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
--- a/dom/plugins/PluginInstanceParent.cpp
+++ b/dom/plugins/PluginInstanceParent.cpp
@@ -592,26 +592,16 @@ PluginInstanceParent::AsyncSetWindow(NPW
     if (!SendAsyncSetWindow(gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType(),
                             window))
         return NS_ERROR_FAILURE;
 
     return NS_OK;
 }
 
 nsresult
-PluginInstanceParent::GetSurface(gfxASurface** aSurface)
-{
-    if (mFrontSurface) {
-      NS_ADDREF(*aSurface = mFrontSurface);
-      return NS_OK;
-    }
-    return NS_ERROR_NOT_AVAILABLE;
-}
-
-nsresult
 PluginInstanceParent::GetImage(ImageContainer* aContainer, Image** aImage)
 {
 #ifdef XP_MACOSX
     if (!mFrontSurface && !mIOSurface)
 #else
     if (!mFrontSurface)
 #endif
         return NS_ERROR_NOT_AVAILABLE;
--- a/dom/plugins/PluginInstanceParent.h
+++ b/dom/plugins/PluginInstanceParent.h
@@ -275,17 +275,16 @@ public:
     virtual bool
     AnswerPluginFocusChange(const bool& gotFocus);
 
 #if defined(OS_MACOSX)
     void Invalidate();
 #endif // definied(OS_MACOSX)
 
     nsresult AsyncSetWindow(NPWindow* window);
-    nsresult GetSurface(gfxASurface** aSurface);
     nsresult GetImage(mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
     nsresult GetImageSize(nsIntSize* aSize);
 #ifdef XP_MACOSX
     nsresult IsRemoteDrawingCoreAnimation(PRBool *aDrawing);
 #endif
     nsresult SetBackgroundUnknown();
     nsresult BeginUpdateBackground(const nsIntRect& aRect,
                                    gfxContext** aCtx);
--- a/dom/plugins/PluginLibrary.h
+++ b/dom/plugins/PluginLibrary.h
@@ -94,17 +94,16 @@ public:
                            char* argv[], NPSavedData* saved,
                            NPError* error) = 0;
 
   virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
                                      uint64_t maxAge) = 0;
   virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0;
 
   virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
-  virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface) = 0;
   virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage) = 0;
   virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
   virtual bool UseAsyncPainting() = 0;
 #if defined(XP_MACOSX)
   virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, PRBool *aDrawing) = 0;
 #endif
   /**
    * The next three methods are the third leg in the trip to
--- a/dom/plugins/PluginModuleParent.cpp
+++ b/dom/plugins/PluginModuleParent.cpp
@@ -668,26 +668,16 @@ PluginModuleParent::AsyncSetWindow(NPP i
     PluginInstanceParent* i = InstCast(instance);
     if (!i)
         return NS_ERROR_FAILURE;
 
     return i->AsyncSetWindow(window);
 }
 
 nsresult
-PluginModuleParent::GetSurface(NPP instance, gfxASurface** aSurface)
-{
-    PluginInstanceParent* i = InstCast(instance);
-    if (!i)
-        return NS_ERROR_FAILURE;
-
-    return i->GetSurface(aSurface);
-}
-
-nsresult
 PluginModuleParent::GetImage(NPP instance,
                              mozilla::layers::ImageContainer* aContainer,
                              mozilla::layers::Image** aImage)
 {
     PluginInstanceParent* i = InstCast(instance);
     return !i ? NS_ERROR_FAILURE : i->GetImage(aContainer, aImage);
 }
 
--- a/dom/plugins/PluginModuleParent.h
+++ b/dom/plugins/PluginModuleParent.h
@@ -226,17 +226,16 @@ private:
                                 NPPVariable variable, void *ret_value);
     static NPError NPP_SetValue(NPP instance, NPNVariable variable,
                                 void *value);
     static void NPP_URLRedirectNotify(NPP instance, const char* url,
                                       int32_t status, void* notifyData);
 
     virtual bool HasRequiredFunctions();
     virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
-    virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
     virtual nsresult GetImage(NPP instance, mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
     virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
     NS_OVERRIDE virtual bool UseAsyncPainting() { return true; }
     NS_OVERRIDE
     virtual nsresult SetBackgroundUnknown(NPP instance);
     NS_OVERRIDE
     virtual nsresult BeginUpdateBackground(NPP instance,
                                            const nsIntRect& aRect,
--- a/editor/idl/nsIEditor.idl
+++ b/editor/idl/nsIEditor.idl
@@ -50,17 +50,17 @@ interface nsIDocumentStateListener;
 interface nsIOutputStream;
 interface nsITransactionManager;
 interface nsITransaction;
 interface nsIEditorObserver;
 interface nsIEditActionListener;
 interface nsIInlineSpellChecker;
 interface nsITransferable;
 
-[scriptable, uuid(78b0bde0-ab69-428b-ab30-fcc09eead499)]
+[scriptable, uuid(bd5d93f0-6451-11e0-ae3e-0800200c9a66)]
 
 interface nsIEditor  : nsISupports
 {
 %{C++
   typedef short EDirection;
 %}
   const short eNone = 0;
   const short eNext = 1;
@@ -567,20 +567,16 @@ interface nsIEditor  : nsISupports
   /** Dumps a text representation of the content tree to standard out */
   void debugDumpContent() ;
 
   /* Run unit tests. Noop in optimized builds */
   void debugUnitTests(out long outNumTests, out long  outNumTestsFailed);
 
   /* checks if a node is read-only or not */
   [notxpcom] boolean isModifiableNode(in nsIDOMNode aNode);
-};
 
-[uuid(54c0bc08-6c0e-4967-bb0d-ec991d78a8b3)]
-interface nsIEditor_MOZILLA_2_0_BRANCH : nsISupports
-{
   /**
    * Will be set to true if the last keypress event that the editor has handled
    * has been trusted.  The value will only be valid when the edit action listeners
    * are being called, and will throw upon access at all other times.
    */
   readonly attribute boolean lastKeypressEventTrusted;
 };
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -200,17 +200,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mActionListeners)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mEditorObservers)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mDocStateListeners)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mEventTarget)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mEventListener)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsEditor)
- NS_INTERFACE_MAP_ENTRY(nsIEditor_MOZILLA_2_0_BRANCH)
  NS_INTERFACE_MAP_ENTRY(nsIPhonetic)
  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
  NS_INTERFACE_MAP_ENTRY(nsIEditorIMESupport)
  NS_INTERFACE_MAP_ENTRY(nsIEditor)
  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIEditor)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsEditor)
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -95,18 +95,17 @@ class nsIDOMNSEvent;
 /** implementation of an editor object.  it will be the controller/focal point 
  *  for the main editor services. i.e. the GUIManager, publishing, transaction 
  *  manager, event interfaces. the idea for the event interfaces is to have them 
  *  delegate the actual commands to the editor independent of the XPFE implementation.
  */
 class nsEditor : public nsIEditor,
                  public nsIEditorIMESupport,
                  public nsSupportsWeakReference,
-                 public nsIPhonetic,
-                 public nsIEditor_MOZILLA_2_0_BRANCH
+                 public nsIPhonetic
 {
 public:
 
   enum IterDirection
   {
     kIterForward,
     kIterBackward
   };
@@ -152,19 +151,16 @@ public:
   /* ------------ nsIEditor methods -------------- */
   NS_DECL_NSIEDITOR
   /* ------------ nsIEditorIMESupport methods -------------- */
   NS_DECL_NSIEDITORIMESUPPORT
   
   // nsIPhonetic
   NS_DECL_NSIPHONETIC
 
-  // nsIEditor_MOZILLA_2_0_BRANCH
-  NS_DECL_NSIEDITOR_MOZILLA_2_0_BRANCH
-
 public:
 
   
   NS_IMETHOD InsertTextImpl(const nsAString& aStringToInsert, 
                                nsCOMPtr<nsIDOMNode> *aInOutNode, 
                                PRInt32 *aInOutOffset,
                                nsIDOMDocument *aDoc);
   nsresult InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert, 
--- a/embedding/android/GeckoAppShell.java
+++ b/embedding/android/GeckoAppShell.java
@@ -517,25 +517,27 @@ public class GeckoAppShell
 
         case NOTIFY_IME_FOCUSCHANGE:
             IMEStateUpdater.resetIME();
             break;
         }
     }
 
     public static void notifyIMEEnabled(int state, String typeHint,
-                                        String actionHint) {
+                                        String actionHint, boolean landscapeFS)
+    {
         if (GeckoApp.surfaceView == null)
             return;
 
         /* When IME is 'disabled', IME processing is disabled.
            In addition, the IME UI is hidden */
         GeckoApp.surfaceView.mIMEState = state;
         GeckoApp.surfaceView.mIMETypeHint = typeHint;
         GeckoApp.surfaceView.mIMEActionHint = actionHint;
+        GeckoApp.surfaceView.mIMELandscapeFS = landscapeFS;
         IMEStateUpdater.enableIME();
     }
 
     public static void notifyIMEChange(String text, int start, int end, int newEnd) {
         if (GeckoApp.surfaceView == null ||
             GeckoApp.surfaceView.inputConnection == null)
             return;
 
--- a/embedding/android/GeckoSurfaceView.java
+++ b/embedding/android/GeckoSurfaceView.java
@@ -378,17 +378,20 @@ class GeckoSurfaceView
         else if (mIMEActionHint.equalsIgnoreCase("next"))
             outAttrs.imeOptions = EditorInfo.IME_ACTION_NEXT;
         else if (mIMEActionHint.equalsIgnoreCase("search"))
             outAttrs.imeOptions = EditorInfo.IME_ACTION_SEARCH;
         else if (mIMEActionHint.equalsIgnoreCase("send"))
             outAttrs.imeOptions = EditorInfo.IME_ACTION_SEND;
         else if (mIMEActionHint != null && mIMEActionHint.length() != 0)
             outAttrs.actionLabel = mIMEActionHint;
-            
+
+        if (mIMELandscapeFS == false)
+            outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
+
         inputConnection.reset();
         return inputConnection;
     }
 
     public void setEditable(String contents)
     {
         mEditable.removeSpan(inputConnection);
         mEditable.replace(0, mEditable.length(), contents);
@@ -619,16 +622,17 @@ class GeckoSurfaceView
 
     GeckoInputConnection inputConnection;
     KeyListener mKeyListener;
     Editable mEditable;
     Editable.Factory mEditableFactory;
     int mIMEState;
     String mIMETypeHint;
     String mIMEActionHint;
+    boolean mIMELandscapeFS;
 
     // Software rendering
     ByteBuffer mSoftwareBuffer;
     Bitmap mSoftwareBitmap;
 
     Geocoder mGeocoder;
     Address  mLastGeoAddress;
 
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -758,16 +758,22 @@ public:
 
   /**
    * Dynamic downcast to a Thebes layer. Returns null if this is not
    * a ThebesLayer.
    */
   virtual ThebesLayer* AsThebesLayer() { return nsnull; }
 
   /**
+   * Dynamic cast to a ContainerLayer. Returns null if this is not
+   * a ContainerLayer.
+   */
+  virtual ContainerLayer* AsContainerLayer() { return nsnull; }
+
+  /**
    * Dynamic cast to a ShadowLayer.  Return null if this is not a
    * ShadowLayer.  Can be used anytime.
    */
   virtual ShadowLayer* AsShadowLayer() { return nsnull; }
 
   // These getters can be used anytime.  They return the effective
   // values that should be used when drawing this layer to screen,
   // accounting for this layer possibly being a shadow.
@@ -1024,16 +1030,18 @@ public:
    */
   void SetFrameMetrics(const FrameMetrics& aFrameMetrics)
   {
     mFrameMetrics = aFrameMetrics;
   }
 
   // These getters can be used anytime.
 
+  virtual ContainerLayer* AsContainerLayer() { return this; }
+
   virtual Layer* GetFirstChild() { return mFirstChild; }
   virtual Layer* GetLastChild() { return mLastChild; }
   const FrameMetrics& GetFrameMetrics() { return mFrameMetrics; }
 
   MOZ_LAYER_DECL_NAME("ContainerLayer", TYPE_CONTAINER)
 
   /**
    * ContainerLayer backends need to override ComputeEffectiveTransforms
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -54,17 +54,19 @@ class nsRootPresContext;
 namespace mozilla {
 
 enum LayerState {
   LAYER_NONE,
   LAYER_INACTIVE,
   LAYER_ACTIVE,
   // Force an active layer even if it causes incorrect rendering, e.g.
   // when the layer has rounded rect clips.
-  LAYER_ACTIVE_FORCE
+  LAYER_ACTIVE_FORCE,
+  // Special layer that is metadata only.
+  LAYER_ACTIVE_EMPTY
 };
 
 /**
  * The FrameLayerBuilder belongs to an nsDisplayListBuilder and is
  * responsible for converting display lists into layer trees.
  * 
  * The most important API in this class is BuildContainerLayerFor. This
  * method takes a display list as input and constructs a ContainerLayer
--- a/layout/base/nsDisplayItemTypes.h
+++ b/layout/base/nsDisplayItemTypes.h
@@ -79,16 +79,17 @@ enum Type {
   TYPE_PAGE_SEQUENCE,
   TYPE_PLUGIN,
   TYPE_PLUGIN_READBACK,
   TYPE_PRINT_PREVIEW_BACKGROUND,
   TYPE_PRINT_PLUGIN,
   TYPE_REMOTE,
   TYPE_REMOTE_SHADOW,
   TYPE_SCROLL_LAYER,
+  TYPE_SCROLL_INFO_LAYER,
   TYPE_SELECTION_OVERLAY,
   TYPE_SOLID_COLOR,
   TYPE_TABLE_CELL_BACKGROUND,
   TYPE_TABLE_CELL_SELECTION,
   TYPE_TABLE_ROW_BACKGROUND,
   TYPE_TABLE_ROW_GROUP_BACKGROUND,
   TYPE_TABLE_BORDER_BACKGROUND,
   TYPE_TEXT,
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1831,16 +1831,35 @@ nsDisplayScrollLayer::ComputeVisibility(
 
 #ifdef NS_BUILD_REFCNT_LOGGING
 nsDisplayScrollLayer::~nsDisplayScrollLayer()
 {
   MOZ_COUNT_DTOR(nsDisplayScrollLayer);
 }
 #endif
 
+nsDisplayScrollInfoLayer::nsDisplayScrollInfoLayer(
+  nsDisplayListBuilder* aBuilder,
+  nsDisplayList* aList,
+  nsIFrame* aForFrame,
+  nsIFrame* aViewportFrame)
+  : nsDisplayScrollLayer(aBuilder, aList, aForFrame, aViewportFrame)
+{
+#ifdef NS_BUILD_REFCNT_LOGGING
+  MOZ_COUNT_CTOR(nsDisplayScrollInfoLayer);
+#endif
+}
+
+#ifdef NS_BUILD_REFCNT_LOGGING
+nsDisplayScrollInfoLayer::~nsDisplayScrollInfoLayer()
+{
+  MOZ_COUNT_DTOR(nsDisplayScrollInfoLayer);
+}
+#endif
+
 nsDisplayClip::nsDisplayClip(nsDisplayListBuilder* aBuilder,
                              nsIFrame* aFrame, nsDisplayItem* aItem,
                              const nsRect& aRect)
    : nsDisplayWrapList(aBuilder, aFrame, aItem) {
   MOZ_COUNT_CTOR(nsDisplayClip);
   mClip = SnapBounds(aBuilder->IsSnappingEnabled() && !aBuilder->IsInTransform(),
                      aBuilder->CurrentPresContext(), aRect);
 }
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -1832,16 +1832,40 @@ public:
     // This causes incorrect rendering for rounded clips!
     return mozilla::LAYER_ACTIVE_FORCE;
   }
 private:
   nsIFrame* mViewportFrame;
 };
 
 /**
+ * Like nsDisplayScrollLayer, but only has metadata on the scroll frame. This
+ * creates a layer that has no Thebes child layer, but still allows the
+ * compositor process to know of the scroll frame's existence.
+ */
+class nsDisplayScrollInfoLayer : public nsDisplayScrollLayer
+{
+public:
+  nsDisplayScrollInfoLayer(nsDisplayListBuilder* aBuilder, nsDisplayList* aList,
+                           nsIFrame* aForFrame, nsIFrame* aViewportFrame);
+  NS_DISPLAY_DECL_NAME("ScrollInfoLayer", TYPE_SCROLL_INFO_LAYER)
+
+#ifdef NS_BUILD_REFCNT_LOGGING
+  virtual ~nsDisplayScrollInfoLayer();
+#endif
+
+  virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
+                                   LayerManager* aManager)
+  {
+    return mozilla::LAYER_ACTIVE_EMPTY;
+  }
+
+};
+
+/**
  * nsDisplayClip can clip a list of items, but we take a single item
  * initially and then later merge other items into it when we merge
  * adjacent matching nsDisplayClips
  */
 class nsDisplayClip : public nsDisplayWrapList {
 public:
   /**
    * @param aFrame the frame that should be considered the underlying
--- a/layout/build/nsLayoutCID.h
+++ b/layout/build/nsLayoutCID.h
@@ -241,22 +241,16 @@
 // {762C4AE7-B923-422F-B97E-B9BFC1EF7BF0}
 #define NS_ICONTENTUTILS_CID \
 { 0x762C4AE7, 0xB923, 0x422F, { 0xB9, 0x7E, 0xB9, 0xBF, 0xC1, 0xEF, 0x7B, 0xF0 } }
 
 // {1802442d-a59b-43b8-b8fd-070da5549593}
 #define NS_ICONTENTUTILS2_CID \
 { 0x1802442d, 0xa59b, 0x43b8, { 0xb8, 0xfd, 0x07, 0x0d, 0xa5, 0x54, 0x95, 0x93 } }
 
-#ifndef MOZ_ENABLE_LIBXUL
-// {4c14b440-307f-11e0-91fa-0800200c9a66}
-#define NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID \
-{ 0x4c14b440, 0x307f, 0x11e9, { 0x91, 0xfa, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
-#endif
-
 // {1A26A7B7-D06E-4F45-8B45-D7AD60F7A9AB}
 #define INDEXEDDB_MANAGER_CID \
 { 0x1a26a7b7, 0xd06e, 0x4f45, { 0x8b, 0x45, 0xd7, 0xad, 0x60, 0xf7, 0xa9, 0xab } }
 
 #ifdef MOZ_MEDIA
 #define NS_HTMLAUDIOELEMENT_CID                   \
 { /* 1d40026b-4c44-4f6f-b158-26bb5e9c65e9 */      \
  0x1d40026b, 0x4c44, 0x4f6f,                      \
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -577,19 +577,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSyncLoa
 MAKE_CTOR(CreatePluginDocument,           nsIDocument,                 NS_NewPluginDocument)
 #ifdef MOZ_MEDIA
 MAKE_CTOR(CreateVideoDocument,            nsIDocument,                 NS_NewVideoDocument)
 #endif
 MAKE_CTOR(CreateFocusManager,             nsIFocusManager,      NS_NewFocusManager)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils2)
-#ifndef MOZ_ENABLE_LIBXUL
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils_MOZILLA_2_0_BRANCH)
-#endif
 
 MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D)
 MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext, NS_NewCanvasRenderingContextWebGL)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURI)
 
@@ -868,19 +865,16 @@ NS_DEFINE_NAMED_CID(NS_HTMLEDITOR_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_TEXTSERVICESDOCUMENT_CID);
 NS_DEFINE_NAMED_CID(NS_GEOLOCATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
 NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS_CID);
 NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS2_CID);
-#ifndef MOZ_ENABLE_LIBXUL
-NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID);
-#endif
 NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_PARENTPROCESSMESSAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(NSCHANNELPOLICY_CID);
 NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID);
@@ -1022,19 +1016,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_EDITORCONTROLLER_CID, false, NULL, nsEditorControllerConstructor },
   { &kNS_EDITORCOMMANDTABLE_CID, false, NULL, nsEditorCommandTableConstructor },
   { &kNS_TEXTSERVICESDOCUMENT_CID, false, NULL, nsTextServicesDocumentConstructor },
   { &kNS_GEOLOCATION_SERVICE_CID, false, NULL, nsGeolocationServiceConstructor },
   { &kNS_GEOLOCATION_CID, false, NULL, nsGeolocationConstructor },
   { &kNS_FOCUSMANAGER_CID, false, NULL, CreateFocusManager },
   { &kNS_ICONTENTUTILS_CID, false, NULL, nsIContentUtilsConstructor },
   { &kNS_ICONTENTUTILS2_CID, false, NULL, nsIContentUtils2Constructor },
-#ifndef MOZ_ENABLE_LIBXUL
-  { &kNS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID, false, NULL, nsIContentUtils_MOZILLA_2_0_BRANCHConstructor },
-#endif
   { &kCSPSERVICE_CID, false, NULL, CSPServiceConstructor },
   { &kNS_EVENTLISTENERSERVICE_CID, false, NULL, CreateEventListenerService },
   { &kNS_GLOBALMESSAGEMANAGER_CID, false, NULL, CreateGlobalMessageManager },
   { &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, NULL, CreateParentMessageManager },
   { &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, NULL, CreateChildMessageManager },
   { &kNSCHANNELPOLICY_CID, false, NULL, nsChannelPolicyConstructor },
   { &kNS_SCRIPTSECURITYMANAGER_CID, false, NULL, Construct_nsIScriptSecurityManager },
   { &kNS_PRINCIPAL_CID, false, NULL, nsPrincipalConstructor },
@@ -1170,19 +1161,16 @@ static const mozilla::Module::ContractID
   { "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID },
   { "", &kNS_EDITORCOMMANDTABLE_CID },
   { "@mozilla.org/textservices/textservicesdocument;1", &kNS_TEXTSERVICESDOCUMENT_CID },
   { "@mozilla.org/geolocation/service;1", &kNS_GEOLOCATION_SERVICE_CID },
   { "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
   { "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
   { "@mozilla.org/content/contentutils;1", &kNS_ICONTENTUTILS_CID },
   { "@mozilla.org/content/contentutils2;1", &kNS_ICONTENTUTILS2_CID },
-#ifndef MOZ_ENABLE_LIBXUL
-  { "@mozilla.org/content/contentutils-moz2.0;1", &kNS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID },
-#endif
   { CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID },
   { NS_EVENTLISTENERSERVICE_CONTRACTID, &kNS_EVENTLISTENERSERVICE_CID },
   { NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID },
   { NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_PARENTPROCESSMESSAGEMANAGER_CID },
   { NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID },
   { NSCHANNELPOLICY_CONTRACTID, &kNSCHANNELPOLICY_CID },
   { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
   { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1956,55 +1956,68 @@ nsGfxScrollFrameInner::BuildDisplayList(
   // Not all our descendants will be clipped by overflow clipping, but all
   // the ones that aren't clipped will be out of flow frames that have already
   // had dirty rects saved for them by their parent frames calling
   // MarkOutOfFlowChildrenForDisplayList, so it's safe to restrict our
   // dirty rect here.
   dirtyRect.IntersectRect(aDirtyRect, mScrollPort);
 
   // Override the dirty rectangle if the displayport has been set.
-  nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &dirtyRect);
+  PRBool usingDisplayport =
+    nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &dirtyRect);
 
   nsDisplayListCollection set;
 
   nsPresContext* presContext = mOuter->PresContext();
 
   // Since making new layers is expensive, only use nsDisplayScrollLayer
   // if the area is scrollable.
   //
   // Scroll frames can be generated with a scroll range that is 0, 0.
   // Furthermore, it is not worth the memory tradeoff to allow asynchronous
   // scrolling of small scroll frames. We use an arbitrary minimum scroll
   // range of 20 pixels to eliminate many gfx scroll frames from becoming a
   // layer.
   //
-  PRInt32 appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
   nsRect scrollRange = GetScrollRange();
   ScrollbarStyles styles = GetScrollbarStylesFromFrame();
   mShouldBuildLayer =
      (XRE_GetProcessType() == GeckoProcessType_Content &&
      (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN ||
       styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN) &&
-     (scrollRange.width >= NSIntPixelsToAppUnits(20, appUnitsPerDevPixel) ||
-      scrollRange.height >= NSIntPixelsToAppUnits(20, appUnitsPerDevPixel))) &&
-     (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument());
+     (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument()));
 
   if (ShouldBuildLayer()) {
-    // Note that using StackingContext breaks z order, so the resulting
-    // rendering can be incorrect for weird edge cases!
-
     nsDisplayList list;
-    rv = mScrolledFrame->BuildDisplayListForStackingContext(
-      aBuilder, dirtyRect + mOuter->GetOffsetTo(mScrolledFrame), &list);
-
-    nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollLayer(
-      aBuilder, &list, mScrolledFrame, mOuter);
-    set.Content()->AppendNewToTop(layerItem);
-  } else
-  {
+    if (usingDisplayport) {
+      // Once a displayport is set, assume that scrolling needs to be fast
+      // so create a layer with all the content inside. The compositor
+      // process will be able to scroll the content asynchronously.
+      //
+      // Note that using StackingContext breaks z order, so the resulting
+      // rendering can be incorrect for weird edge cases!
+
+      rv = mScrolledFrame->BuildDisplayListForStackingContext(
+        aBuilder, dirtyRect + mOuter->GetOffsetTo(mScrolledFrame), &list);
+
+      nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollLayer(
+        aBuilder, &list, mScrolledFrame, mOuter);
+      set.Content()->AppendNewToTop(layerItem);
+    } else {
+      // If there is no displayport set, there is no reason here to force a
+      // layer that needs a memory-expensive allocation, but the compositor
+      // process would still like to know that it exists.
+
+      nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollInfoLayer(
+        aBuilder, &list, mScrolledFrame, mOuter);
+      set.Content()->AppendNewToTop(layerItem);
+
+      rv = mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, dirtyRect, set);
+    }
+  } else {
     rv = mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, dirtyRect, set);
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
   nsRect clip;
   clip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
 
   nscoord radii[8];
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -265,33 +265,31 @@ public:
   nsEventStatus ProcessEvent(const nsGUIEvent& anEvent)
   {
     return nsEventStatus_eConsumeNoDefault;
   }
 };
 
 
 class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
-                              public nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH,
                               public nsIPluginTagInfo,
                               public nsIDOMMouseListener,
                               public nsIDOMMouseMotionListener,
                               public nsIDOMKeyListener,
                               public nsIDOMFocusListener,
                               public nsIScrollPositionListener
 {
 public:
   nsPluginInstanceOwner();
   virtual ~nsPluginInstanceOwner();
 
   NS_DECL_ISUPPORTS
 
   //nsIPluginInstanceOwner interface
   NS_DECL_NSIPLUGININSTANCEOWNER
-  NS_DECL_NSIPLUGININSTANCEOWNER_MOZILLA_2_0_BRANCH
 
   NS_IMETHOD GetURL(const char *aURL, const char *aTarget,
                     nsIInputStream *aPostStream, 
                     void *aHeadersData, PRUint32 aHeadersDataLen);
 
   NS_IMETHOD ShowStatus(const PRUnichar *aStatusMsg);
 
   NPError    ShowNativeContextMenu(NPMenu* menu, void* event);
@@ -495,32 +493,21 @@ public:
              mPluginWindow->type == NPWindowTypeDrawable));
   }
 
 private:
 
   // return FALSE if LayerSurface dirty (newly created and don't have valid plugin content yet)
   PRBool IsUpToDate()
   {
-    nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-    if (!inst)
-      return PR_FALSE;
-
     nsIntSize size;
-    return NS_SUCCEEDED(inst->GetImageSize(&size)) &&
+    return NS_SUCCEEDED(mInstance->GetImageSize(&size)) &&
            size == nsIntSize(mPluginWindow->width, mPluginWindow->height);
   }
 
-  already_AddRefed<nsIPluginInstance_MOZILLA_2_0_BRANCH>
-  GetInstance()
-  {
-    nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-    return inst.forget();
-  }
-
   void FixUpURLS(const nsString &name, nsAString &value);
 
   nsPluginNativeWindow       *mPluginWindow;
   nsCOMPtr<nsIPluginInstance> mInstance;
   nsObjectFrame              *mObjectFrame; // owns nsPluginInstanceOwner
   nsCOMPtr<nsIContent>        mContent;
   nsCString                   mDocumentBase;
   char                       *mTagText;
@@ -1999,22 +1986,21 @@ nsObjectFrame::UpdateImageLayer(ImageCon
 #endif
 
   mInstanceOwner->SetCurrentImage(aContainer);
 }
 
 PRBool
 nsPluginInstanceOwner::SetCurrentImage(ImageContainer* aContainer)
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-  if (inst) {
+  if (mInstance) {
     nsRefPtr<Image> image;
-    // Every call to nsIPluginInstance_MOZILLA_2_0_BRANCH::GetImage() creates
+    // Every call to nsIPluginInstance::GetImage() creates
     // a new image.  See nsIPluginInstance.idl.
-    inst->GetImage(aContainer, getter_AddRefs(image));
+    mInstance->GetImage(aContainer, getter_AddRefs(image));
     if (image) {
 #ifdef XP_MACOSX
       if (image->GetFormat() == Image::MAC_IO_SURFACE && mObjectFrame) {
         MacIOSurfaceImage *oglImage = static_cast<MacIOSurfaceImage*>(image.get());
         NS_ADDREF_THIS();
         oglImage->SetUpdateCallback(&DrawPlugin, this);
         oglImage->SetDestroyCallback(&OnDestroyImage);
       }
@@ -2025,53 +2011,49 @@ nsPluginInstanceOwner::SetCurrentImage(I
   }
   aContainer->SetCurrentImage(nsnull);
   return PR_FALSE;
 }
 
 void
 nsPluginInstanceOwner::SetBackgroundUnknown()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
-  if (inst) {
-    inst->SetBackgroundUnknown();
+  if (mInstance) {
+    mInstance->SetBackgroundUnknown();
   }
 }
 
 already_AddRefed<gfxContext>
 nsPluginInstanceOwner::BeginUpdateBackground(const nsIntRect& aRect)
 {
   nsIntRect rect = aRect;
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
   nsRefPtr<gfxContext> ctx;
-  if (inst &&
-      NS_SUCCEEDED(inst->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
+  if (mInstance &&
+      NS_SUCCEEDED(mInstance->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
     return ctx.forget();
   }
   return nsnull;
 }
 
 void
 nsPluginInstanceOwner::EndUpdateBackground(gfxContext* aContext,
                                            const nsIntRect& aRect)
 {
   nsIntRect rect = aRect;
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
-  if (inst) {
-    inst->EndUpdateBackground(aContext, &rect);
+  if (mInstance) {
+    mInstance->EndUpdateBackground(aContext, &rect);
   }
 }
 
 nsIntSize
 nsPluginInstanceOwner::GetCurrentImageSize()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
   nsIntSize size(0,0);
-  if (inst) {
-    inst->GetImageSize(&size);
+  if (mInstance) {
+    mInstance->GetImageSize(&size);
   }
   return size;
 }
 
 LayerState
 nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
                              LayerManager* aManager)
 {
@@ -3303,17 +3285,16 @@ nsPluginInstanceOwner::~nsPluginInstance
  * nsISupports Implementation
  */
 
 NS_IMPL_ADDREF(nsPluginInstanceOwner)
 NS_IMPL_RELEASE(nsPluginInstanceOwner)
 
 NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
   NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
-  NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH)
   NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseMotionListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMKeyListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMMouseListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPluginInstanceOwner)
 NS_INTERFACE_MAP_END
@@ -4294,22 +4275,21 @@ NPDrawingModel nsPluginInstanceOwner::Ge
     return drawingModel;
 
   mInstance->GetDrawingModel((PRInt32*)&drawingModel);
   return drawingModel;
 }
 
 PRBool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-  if (!inst)
+  if (mInstance)
     return PR_FALSE;
 
   PRBool coreAnimation;
-  if (!NS_SUCCEEDED(inst->IsRemoteDrawingCoreAnimation(&coreAnimation)))
+  if (!NS_SUCCEEDED(mInstance->IsRemoteDrawingCoreAnimation(&coreAnimation)))
     return PR_FALSE;
 
   return coreAnimation;
 }
 
 NPEventModel nsPluginInstanceOwner::GetEventModel()
 {
   return mEventModel;
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -134,23 +134,18 @@ FindViewForId(const ViewMap& aMap, ViewI
 {
   ViewMap::const_iterator iter = aMap.find(aId);
   return iter != aMap.end() ? iter->second : NULL;
 }
 
 static const FrameMetrics*
 GetFrameMetrics(Layer* aLayer)
 {
-  // Children are not container layers, so they don't have frame metrics. Give
-  // them a blank metric.
-  if (!aLayer->GetFirstChild())
-    return NULL;
-
-  ContainerLayer* container = static_cast<ContainerLayer*>(aLayer);
-  return &container->GetFrameMetrics();
+  ContainerLayer* container = aLayer->AsContainerLayer();
+  return container ? &container->GetFrameMetrics() : NULL;
 }
 
 static nsIntPoint
 GetRootFrameOffset(nsIFrame* aContainerFrame, nsDisplayListBuilder* aBuilder)
 {
   nscoord auPerDevPixel = aContainerFrame->PresContext()->AppUnitsPerDevPixel();
 
   // Offset to the content rect in case we have borders or padding
@@ -341,20 +336,19 @@ IsTempLayerManager(LayerManager* aManage
 // aXScale and aYScale are used to calculate any values that need to be in
 // chrome-document CSS pixels and aren't part of the rendering loop, such as
 // the initial scroll offset for a new view.
 static void
 BuildViewMap(ViewMap& oldContentViews, ViewMap& newContentViews,
              nsFrameLoader* aFrameLoader, Layer* aLayer,
              float aXScale = 1, float aYScale = 1)
 {
-  if (!aLayer->GetFirstChild())
+  ContainerLayer* container = aLayer->AsContainerLayer();
+  if (!container)
     return;
-
-  ContainerLayer* container = static_cast<ContainerLayer*>(aLayer);
   const FrameMetrics metrics = container->GetFrameMetrics();
   const ViewID scrollId = metrics.mScrollId;
 
   if (metrics.IsScrollable()) {
     nscoord auPerDevPixel = aFrameLoader->GetPrimaryFrameOfOwningContent()
                                         ->PresContext()->AppUnitsPerDevPixel();
     nsContentView* view = FindViewForId(oldContentViews, scrollId);
     if (view) {
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -390,19 +390,19 @@ pref("javascript.options.methodjit.chrom
 
 pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chrome
 pref("dom.max_script_run_time", 20);
 
 // JS error console
 pref("devtools.errorconsole.enabled", false);
 
 // kinetic tweakables
-pref("browser.ui.kinetic.updateInterval", 30);
-pref("browser.ui.kinetic.decelerationRate", 20);
-pref("browser.ui.kinetic.speedSensitivity", 80);
+pref("browser.ui.kinetic.updateInterval", 16);
+pref("browser.ui.kinetic.exponentialC", 1400);
+pref("browser.ui.kinetic.polynomialC", 100);
 pref("browser.ui.kinetic.swipeLength", 160);
 
 // zooming
 pref("browser.ui.zoom.pageFitGranularity", 9); // don't zoom to fit by less than 1/9 (11%)
 pref("browser.ui.zoom.animationDuration", 200); // ms duration of double-tap zoom animation
 pref("browser.ui.zoom.reflow", false); // Change text wrapping on double-tap
 pref("browser.ui.zoom.reflow.fontSize", 720);
 
@@ -580,13 +580,19 @@ pref("notification.feature.enabled", tru
 // prevent tooltips from showing up
 pref("browser.chrome.toolbar_tips", false);
 pref("indexedDB.feature.enabled", false);
 
 // prevent video elements from preloading too much data
 pref("media.preload.default", 1); // default to preload none
 pref("media.preload.auto", 2);    // preload metadata if preload=auto
 
+//  0: don't show fullscreen keyboard
+//  1: always show fullscreen keyboard
+// -1: show fullscreen keyboard based on threshold pref
+pref("widget.ime.android.landscape_fullscreen", 0);
+pref("widget.ime.android.fullscreen_threshold", 300); // in hundreths of inches
+
 // optimize images memory usage
 pref("image.mem.decodeondraw", true);
 pref("content.image.allow_locking", false);
 pref("image.mem.min_discard_timeout_ms", 20000);
 
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -456,16 +456,17 @@
                   <setting id="sync-disconnect" class="setting-subgroup" type="control" collapsed="true">
                     <button label="&sync.disconnect;" oncommand="WeaveGlue.disconnect();" />
                   </setting>
                 </settings>
 #endif
                 <settings id="prefs-privacy" label="&privacy.title;">
                   <setting pref="network.cookie.cookieBehavior" title="&allowCookies.title;" type="boolint" on="0" off="2"/>
                   <setting pref="signon.rememberSignons" title="&rememberPasswords.title;" type="bool"/>
+                  <setting pref="privacy.donottrackheader.enabled" title="&doNotTrack.title;" type="bool"/>
                   <setting title="&clearPrivateData2.title;" type="control">
                     <button id="prefs-clear-data" label="&clearPrivateData.button;" command="cmd_sanitize"/>
                   </setting>
                 </settings>
                 <settings id="prefs-content" label="&content.title;">
                   <setting pref="browser.ui.zoom.reflow" title="&reflowZoom.title;" type="bool"/>
                   <setting pref="permissions.default.image" title="&showImages.title;" type="boolint" on="1" off="2"/>
                   <setting pref="javascript.enabled" type="bool" title="&enableJavaScript.title;"/>
--- a/mobile/chrome/content/input.js
+++ b/mobile/chrome/content/input.js
@@ -55,16 +55,23 @@ const kOverTapWait = 150;
 const kLongTapWait = 500;
 
 // maximum drag distance in inches while axis locking can still be reverted
 const kAxisLockRevertThreshold = 0.8;
 
 // Same as NS_EVENT_STATE_ACTIVE from nsIEventStateManager.h
 const kStateActive = 0x00000001;
 
+// After a drag begins, kinetic panning is stopped if the drag doesn't become
+// a pan in 300 milliseconds.
+const kStopKineticPanOnDragTimeout = 300;
+
+// Max velocity of a pan. This is in pixels/millisecond.
+const kMaxVelocity = 6;
+
 /**
  * MouseModule
  *
  * Handles all touch-related input such as dragging and tapping.
  *
  * The Fennec chrome DOM tree has elements that are augmented dynamically with
  * custom JS properties that tell the MouseModule they have custom support for
  * either dragging or clicking.  These JS properties are JS objects that expose
@@ -200,29 +207,31 @@ MouseModule.prototype = {
     // stop kinetic panning if targetScrollbox has changed
     if (this._kinetic.isActive() && this._dragger != dragger)
       this._kinetic.end();
 
     this._targetScrollbox = targetScrollInterface ? targetScrollInterface.element : targetScrollbox;
     this._targetScrollInterface = targetScrollInterface;
 
     // Do tap
-    let event = document.createEvent("Events");
-    event.initEvent("TapDown", true, true);
-    event.clientX = aEvent.clientX;
-    event.clientY = aEvent.clientY;
-    let success = aEvent.target.dispatchEvent(event);
-    if (success) {
-      this._recordEvent(aEvent);
-      this._target = aEvent.target;
-      this._mouseOverTimeout.once(kOverTapWait);
-      this._longClickTimeout.once(kLongTapWait);
-    } else {
-      // cancel all pending content clicks
-      this._cleanClickBuffer();
+    if (!this._kinetic.isActive()) {
+      let event = document.createEvent("Events");
+      event.initEvent("TapDown", true, true);
+      event.clientX = aEvent.clientX;
+      event.clientY = aEvent.clientY;
+      let success = aEvent.target.dispatchEvent(event);
+      if (success) {
+        this._recordEvent(aEvent);
+        this._target = aEvent.target;
+        this._mouseOverTimeout.once(kOverTapWait);
+        this._longClickTimeout.once(kLongTapWait);
+      } else {
+        // cancel all pending content clicks
+        this._cleanClickBuffer();
+      }
     }
 
     // Do pan
     if (dragger) {
       let draggable = dragger.isDraggable(targetScrollbox, targetScrollInterface);
       dragData.locked = !draggable.x || !draggable.y;
       if (draggable.x || draggable.y) {
         this._dragger = dragger;
@@ -323,21 +332,18 @@ MouseModule.prototype = {
       //
       let [sX, sY] = dragData.panPosition();
       this.dX += dragData.prevPanX - sX;
       this.dY += dragData.prevPanY - sY;
 
       if (dragData.isPan()) {
         // Only pan when mouse event isn't part of a click. Prevent jittering on tap.
         this._kinetic.addData(sX - dragData.prevPanX, sY - dragData.prevPanY);
-        if (!this._waitingForPaint) {
-          this._dragBy(this.dX, this.dY);
-          this.dX = 0;
-          this.dY = 0;
-        }
+        this._dragBy(this.dX, this.dY);
+        // dragBy will reset dX and dY values to 0.
 
         // Let everyone know when mousemove begins a pan
         if (!oldIsPan && dragData.isPan()) {
           this._mouseOverTimeout.clear();
           this._longClickTimeout.clear();
 
           let event = document.createEvent("Events");
           event.initEvent("PanBegin", true, false);
@@ -356,55 +362,67 @@ MouseModule.prototype = {
 
   /**
    * Inform our dragger of a dragStart.
    */
   _doDragStart: function _doDragStart(aEvent, aDraggable) {
     let dragData = this._dragData;
     dragData.setDragStart(aEvent.screenX, aEvent.screenY, aDraggable);
     this._kinetic.addData(0, 0);
+    this._dragStartTime = Date.now();
     if (!this._kinetic.isActive())
       this._dragger.dragStart(aEvent.clientX, aEvent.clientY, aEvent.target, this._targetScrollInterface);
   },
 
   /** Finish a drag. */
   _doDragStop: function _doDragStop() {
     let dragData = this._dragData;
     if (!dragData.dragging)
       return;
 
     dragData.endDrag();
 
     // Note: it is possible for kinetic scrolling to be active from a
     // mousedown/mouseup event previous to this one. In this case, we
     // want the kinetic panner to tell our drag interface to stop.
 
-    if (!dragData.isPan() && !this._kinetic.isActive()) {
-      // There was no pan and no kinetic scrolling, so just stop dragger.
+    if (dragData.isPan()) {
+      if (Date.now() - this._dragStartTime > kStopKineticPanOnDragTimeout)
+        this._kinetic._velocity.set(0, 0);
+      // Start kinetic pan.
+      this._kinetic.start();
+    } else {
+      this._kinetic.end();
       this._dragger.dragStop(0, 0, this._targetScrollInterface);
       this._dragger = null;
-    } else if (dragData.isPan()) {
-      // Start kinetic pan.
-      this._kinetic.start();
     }
   },
 
   /**
    * Used by _onMouseMove() above and by KineticController's timer to do the
    * actual dragMove signalling to the dragger.  We'd put this in _onMouseMove()
    * but then KineticController would be adding to its own data as it signals
    * the dragger of dragMove()s.
    */
   _dragBy: function _dragBy(dX, dY, aIsKinetic) {
+    let dragged = true;
     let dragData = this._dragData;
-    let dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
-    if (dragged && !this._waitingForPaint) {
-      this._waitingForPaint = true;
-      mozRequestAnimationFrame(this);
+    if (!this._waitingForPaint || aIsKinetic) {
+      let dragData = this._dragData;
+      dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
+      if (dragged && !this._waitingForPaint) {
+        this._waitingForPaint = true;
+        mozRequestAnimationFrame(this);
+      }
+      this.dX = 0;
+      this.dY = 0;
     }
+    if (!dragData.isPan())
+      this._kinetic.pause();
+
     return dragged;
   },
 
   /** Callback for kinetic scroller. */
   _kineticStop: function _kineticStop() {
     // Kinetic panning could finish while user is panning, so don't finish
     // the pan just yet.
     let dragData = this._dragData;
@@ -811,122 +829,130 @@ function KineticController(aPanBy, aEndC
   this._velocity = new Point(0, 0);
   this._acceleration = new Point(0, 0);
   this._time = 0;
   this._timeStart = 0;
 
   // How often do we change the position of the scroll pane?  Too often and panning may jerk near
   // the end. Too little and panning will be choppy. In milliseconds.
   this._updateInterval = Services.prefs.getIntPref("browser.ui.kinetic.updateInterval");
-  // "Friction" of the scroll pane. The lower, the less friction and the further distance traveled.
-  this._decelerationRate = Services.prefs.getIntPref("browser.ui.kinetic.decelerationRate") / 10000;
-  // A multiplier for the initial velocity of the movement.
-  this._speedSensitivity = Services.prefs.getIntPref("browser.ui.kinetic.speedSensitivity") / 100;
+  // Constants that affect the "friction" of the scroll pane.
+  this._exponentialC = Services.prefs.getIntPref("browser.ui.kinetic.exponentialC");
+  this._polynomialC = Services.prefs.getIntPref("browser.ui.kinetic.polynomialC") / 1000000;
   // Number of milliseconds that can contain a swipe. Movements earlier than this are disregarded.
   this._swipeLength = Services.prefs.getIntPref("browser.ui.kinetic.swipeLength");
 
   this._reset();
 }
 
 KineticController.prototype = {
   _reset: function _reset() {
     this._active = false;
+    this._paused = false;
     this.momentumBuffer = [];
     this._velocity.set(0, 0);
   },
 
   isActive: function isActive() {
     return this._active;
   },
 
   _startTimer: function _startTimer() {
-    // Use closed form of a parabola to calculate each position for panning.
-    // x(t) = v0*t + .5*t^2*a
-    // where: v0 is initial velocity
-    //        a is acceleration
-    //        t is time elapsed
-    //
-    // x(t)
-    //  ^
-    //  |                |
-    //  |
-    //  |                |
-    //  |           ....^^^^....
-    //  |      ...^^     |      ^^...
-    //  |  ...^                      ^...
-    //  |..              |               ..
-    //   -----------------------------------> t
-    //  t0             tf=-v0/a
-    //
-    // Using this formula, distance moved is independent of the time between each frame, unlike time
-    // step approaches. Once the time is up, set the position to x(tf) and stop the timer.
+    let self = this;
 
-    let lastx = this._position;  // track last position vector because pan takes differences
+    let lastp = this._position;  // track last position vector because pan takes deltas
     let v0 = this._velocity;  // initial velocity
     let a = this._acceleration;  // acceleration
+    let c = this._exponentialC;
+    let p = new Point(0, 0);
+    let dx, dy, t, realt;
 
-    // Temporary "bins" so that we don't create new objects during pan.
-    let aBin = new Point(0, 0);
-    let v0Bin = new Point(0, 0);
-    let self = this;
+    function calcP(v0, a, t) {
+      // Important traits for this function:
+      //   p(t=0) is 0
+      //   p'(t=0) is v0
+      //
+      // We use exponential to get a smoother stop, but by itself exponential
+      // is too smooth at the end. Adding a polynomial with the appropriate
+      // weight helps to balance
+      return v0 * Math.exp(-t / c) * -c + a * t * t + v0 * c;
+    }
+
+    this._calcV = function(v0, a, t) {
+      return v0 * Math.exp(-t / c) + 2 * a * t;
+    }
 
     let callback = {
       onBeforePaint: function kineticHandleEvent(timeStamp) {
-        if (!self.isActive())  // someone called end() on us between timer intervals
+        // Someone called end() on us between timer intervals
+        // or we are paused.
+        if (!self.isActive() || self._paused)
           return;
 
         // To make animation end fast enough but to keep smoothness, average the ideal
         // time frame (smooth animation) with the actual time lapse (end fast enough).
         // Animation will never take longer than 2 times the ideal length of time.
-        let realt = timeStamp - self._initialTime;
+        realt = timeStamp - self._initialTime;
         self._time += self._updateInterval;
-        let t = (self._time + realt) / 2;
+        t = (self._time + realt) / 2;
 
-        // Calculate new position using x(t) formula.
-        let x = v0Bin.set(v0).scale(t).add(aBin.set(a).scale(0.5 * t * t));
-        let dx = x.x - lastx.x;
-        let dy = x.y - lastx.y;
-        lastx.set(x);
+        // Calculate new position.
+        p.x = calcP(v0.x, a.x, t);
+        p.y = calcP(v0.y, a.y, t);
+        dx = Math.round(p.x - lastp.x);
+        dy = Math.round(p.y - lastp.y);
 
-        // Test to see if movement is finished for each component. As seen in graph, we want the
-        // final position to be at tf.
-        if (t >= -v0.x / a.x) {
-          // Plug in t=-v0/a into x(t) to get final position.
-          dx = -v0.x * v0.x / 2 / a.x - lastx.x;
-          // Reset components. Next frame: a's component will be 0 and t >= NaN will be false.
-          lastx.x = 0;
+        // Test to see if movement is finished for each component.
+        if (dx * a.x > 0) {
+          dx = 0;
+          lastp.x = 0;
           v0.x = 0;
           a.x = 0;
         }
         // Symmetric to above case.
-        if (t >= -v0.y / a.y) {
-          dy = -v0.y * v0.y / 2 / a.y - lastx.y;
-          lastx.y = 0;
+        if (dy * a.y > 0) {
+          dy = 0;
+          lastp.y = 0;
           v0.y = 0;
           a.y = 0;
         }
 
-        let panned = false;
-        try { panned = self._panBy(Math.round(-dx), Math.round(-dy), true); } catch (e) {}
-        if (!panned)
+        if (v0.x == 0 && v0.y == 0) {
           self.end();
-        else
-          mozRequestAnimationFrame(this);
+        } else {
+          let panStop = false;
+          if (dx != 0 || dy != 0) {
+            try { panStop = !self._panBy(-dx, -dy, true); } catch (e) {}
+            lastp.add(dx, dy);
+          }
+
+          if (panStop)
+            self.end();
+          else
+            mozRequestAnimationFrame(this);
+        }
       }
     };
 
     this._active = true;
+    this._paused = false;
     mozRequestAnimationFrame(callback);
   },
 
   start: function start() {
     function sign(x) {
       return x ? ((x > 0) ? 1 : -1) : 0;
     }
 
+    function clampFromZero(x, closerToZero, furtherFromZero) {
+      if (x >= 0)
+        return Math.max(closerToZero, Math.min(furtherFromZero, x));
+      return Math.min(-closerToZero, Math.max(-furtherFromZero, x));
+    }
+
     let mb = this.momentumBuffer;
     let mblen = this.momentumBuffer.length;
 
     let lastTime = mb[mblen - 1].t;
     let distanceX = 0;
     let distanceY = 0;
     let swipeLength = this._swipeLength;
 
@@ -935,34 +961,53 @@ KineticController.prototype = {
     for (let i = 0; i < mblen; i++) {
       me = mb[i];
       if (lastTime - me.t < swipeLength) {
         distanceX += me.dx;
         distanceY += me.dy;
       }
     }
 
-    // Only allow kinetic scrolling to speed up if kinetic scrolling is active.
-    this._velocity.x = (distanceX < 0 ? Math.min : Math.max)((distanceX / swipeLength) * this._speedSensitivity, this._velocity.x);
-    this._velocity.y = (distanceY < 0 ? Math.min : Math.max)((distanceY / swipeLength) * this._speedSensitivity, this._velocity.y);
+    let currentVelocityX = 0;
+    let currentVelocityY = 0;
+
+    if (this.isActive()) {
+      // If active, then we expect this._calcV to be defined.
+      let currentTime = Date.now() - this._initialTime;
+      currentVelocityX = Util.clamp(this._calcV(this._velocity.x, this._acceleration.x, currentTime), -kMaxVelocity, kMaxVelocity);
+      currentVelocityY = Util.clamp(this._calcV(this._velocity.y, this._acceleration.y, currentTime), -kMaxVelocity, kMaxVelocity);
+    }
+
+    if (currentVelocityX * this._velocity.x <= 0)
+      currentVelocityX = 0;
+    if (currentVelocityY * this._velocity.y <= 0)
+      currentVelocityY = 0;
+
+    let swipeTime = Math.min(swipeLength, lastTime - mb[0].t);
+    this._velocity.x = clampFromZero((distanceX / swipeTime) + currentVelocityX, Math.abs(currentVelocityX), 6);
+    this._velocity.y = clampFromZero((distanceY / swipeTime) + currentVelocityY, Math.abs(currentVelocityY), 6);
 
     // Set acceleration vector to opposite signs of velocity
-    this._acceleration.set(this._velocity.clone().map(sign).scale(-this._decelerationRate));
+    this._acceleration.set(this._velocity.clone().map(sign).scale(-this._polynomialC));
 
     this._position.set(0, 0);
     this._initialTime = mozAnimationStartTime;
     this._time = 0;
     this.momentumBuffer = [];
 
-    if (!this.isActive())
+    if (!this.isActive() || this._paused)
       this._startTimer();
 
     return true;
   },
 
+  pause: function pause() {
+    this._paused = true;
+  },
+
   end: function end() {
     if (this.isActive()) {
       if (this._beforeEnd)
         this._beforeEnd();
       this._reset();
     }
   },
 
--- a/mobile/locales/en-US/chrome/preferences.dtd
+++ b/mobile/locales/en-US/chrome/preferences.dtd
@@ -3,16 +3,17 @@
 <!ENTITY about.button                              "Go to Page">
 <!ENTITY content.title                             "Content">
 <!ENTITY reflowZoom.title                          "Reformat text on zoom">
 <!ENTITY showImages.title                          "Show images">
 <!ENTITY enableJavaScript.title                    "Enable JavaScript">
 <!ENTITY enablePlugins.title                       "Enable Plugins">
 <!ENTITY privacy.title                             "Privacy &amp; Security">
 <!ENTITY allowCookies.title                        "Allow cookies">
+<!ENTITY doNotTrack.title                          "Tell sites not to track me">
 <!ENTITY clearPrivateData2.title                   "Clear private data">
 <!ENTITY clearPrivateData.button                   "Clear">
 <!ENTITY rememberPasswords.title                   "Remember passwords">
 <!ENTITY language.title                            "Language">
 <!ENTITY language.auto                             "Auto-detect">
 <!ENTITY defaultBrowser.title                      "Default Browser">
 <!ENTITY defaultBrowser.description                "Make &brandShortName; your default browser">
 <!ENTITY homepage.title                            "Start page">
--- a/modules/plugin/base/public/nsIPluginHost.idl
+++ b/modules/plugin/base/public/nsIPluginHost.idl
@@ -136,26 +136,23 @@ interface nsIPluginHost : nsISupports
    *  host specified in the URL. This is used to prevent DNS-spoofing 
    *  attacks. Can be defaulted to NULL meaning use the host in the URL.
    * @param referrer - the referring URL (may be NULL)
    * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
    *  URLs, even if the user currently has JavaScript disabled (usually 
    *  specify PR_FALSE) 
    * @result - NS_OK if this operation was successful
    */
-%{C++
-  NS_IMETHOD
-  GetURL(nsISupports* pluginInst,
-         const char* url,
-         const char* target = NULL,
-         nsIPluginStreamListener* streamListener = NULL,
-         const char* altHost = NULL,
-         const char* referrer = NULL,
-         PRBool forceJSEnabled = PR_FALSE) = 0;
-%}
+  [noscript] void getURL(in nsISupports pluginInt,
+                         in string url,
+                         in string target,
+                         in nsIPluginStreamListener streamListener,
+                         in string altHost,
+                         in string referrer,
+                         in boolean forceJSEnabled);
 
   /**
    * Posts to a URL with post data and/or post headers.
    *
    * (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
    *
    * @param pluginInst - the plugin making the request. If NULL, the URL
    *  is fetched in the background.
@@ -178,31 +175,28 @@ interface nsIPluginHost : nsISupports
    *  specify PR_FALSE) 
    * @param postHeadersLength - the length of postHeaders (if non-NULL)
    * @param postHeaders - the headers to POST. Must be in the form of
    * "HeaderName: HeaderValue\r\n".  Each header, including the last,
    * must be followed by "\r\n".  NULL specifies that there are no
    * post headers
    * @result - NS_OK if this operation was successful
    */
-%{C++
-  NS_IMETHOD
-  PostURL(nsISupports* pluginInst,
-          const char* url,
-          PRUint32 postDataLen,
-          const char* postData,
-          PRBool isFile = PR_FALSE,
-          const char* target = NULL,
-          nsIPluginStreamListener* streamListener = NULL,
-          const char* altHost = NULL,
-          const char* referrer = NULL,
-          PRBool forceJSEnabled = PR_FALSE,
-          PRUint32 postHeadersLength = 0,
-          const char* postHeaders = NULL) = 0;
-%}
+  [noscript] void postURL(in nsISupports pluginInst,
+                          in string url,
+                          in PRUint32 postDataLen,
+                          in string postData,
+                          in boolean isFile,
+                          in string target,
+                          in nsIPluginStreamListener streamListener,
+                          in string altHost,
+                          in string referrer,
+                          in boolean forceJSEnabled,
+                          in PRUint32 postHeadersLength,
+                          in string postHeaders);
 
   /**
    * Returns the proxy info for a given URL. The caller is required to
    * free the resulting memory with nsIMalloc::Free. The result will be in the
    * following format
    * 
    *   i)   "DIRECT"  -- no proxy
    *   ii)  "PROXY xxx.xxx.xxx.xxx"   -- use proxy
@@ -279,29 +273,19 @@ interface nsIPluginHost : nsISupports
 
   /**
    * Get the plugin tag associated with a given plugin instance.
    * @param aInstance the plugin instance object
    * @return plugin tag object
    */
   [noscript] nsIPluginTag getPluginTagForInstance(in nsIPluginInstance aInstance);
   
-%{C++
-  virtual void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible) = 0;
-  virtual void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame) = 0;
-%}
-};
+  [noscript, notxpcom] void addIdleTimeTarget(in nsIPluginInstanceOwner objectFrame, in boolean isVisible);
+  [noscript, notxpcom] void removeIdleTimeTarget(in nsIPluginInstanceOwner objectFrame);
 
-/*
- * Methods for clearing plugin private data. These should be moved onto
- * nsIPluginHost proper post-Gecko 2.0.
- */
-[scriptable, uuid(0b0a2fb8-dc2b-4df2-b721-4b7a4008df6c)]
-interface nsIPluginHost_MOZILLA_2_0_BRANCH : nsISupports
-{
   /*
    * Flags for use with clearSiteData.
    *
    * FLAG_CLEAR_ALL: clear all data associated with a site.
    * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without
    *                   loss of functionality. To be used out of concern for
    *                   space and not necessarily privacy.
    */
--- a/modules/plugin/base/public/nsIPluginInstance.idl
+++ b/modules/plugin/base/public/nsIPluginInstance.idl
@@ -249,47 +249,38 @@ interface nsIPluginInstance : nsISupport
     void asyncSetWindow(in NPWindowPtr aWindow);
 
     /**
      * Call this each time after the plugin has been painted to the screen
      */
     void notifyPainted();
 
     /**
-     * This should return a valid gfxASurface pointer, or null if there is nothing to render yet.
-     * NO LONGER USED. Do not call.
-     */
-    void getSurface(out gfxASurfacePtr aSurface);
-
-    /**
      * @return true if plugin module supports async rendering
      */
     PRBool useAsyncPainting();
-};
-
 
-// XXX kill me after branching
-[noscript, uuid(24235105-ac5f-483b-86ec-7c9446ddcb8a)]
-interface nsIPluginInstance_MOZILLA_2_0_BRANCH : nsIPluginInstance
-{
     PRBool isRemoteDrawingCoreAnimation();
+
     /**
      * Returns a new Image object which draws an asynchronously-rendered
      * plugin. The Image is created using aContainer.
      * Fails if the plugin is using async rendering but no image has yet
      * been received, or if the plugin is not using async rendering.
      */
     void getImage(in ImageContainerPtr aContainer, out ImagePtr aImage);
+
     /**
      * Returns the size of the Image object that would be created if we called
      * getImage.
      * Fails if the plugin is using async rendering but no image has yet
      * been received, or if the plugin is not using async rendering.
      */
     void getImageSize(in nsIntSizePtr aSize);
+
     /**
      * This is the second leg in the trip to PluginInstanceParent.  It
      * approximately follows the ReadbackSink API.
      */
     void setBackgroundUnknown();
     void beginUpdateBackground(in nsIntRectPtr rect, out gfxContextPtr ctx);
     void endUpdateBackground(in gfxContextPtr ctx, in nsIntRectPtr rect);
 };
--- a/modules/plugin/base/public/nsIPluginInstanceOwner.idl
+++ b/modules/plugin/base/public/nsIPluginInstanceOwner.idl
@@ -143,21 +143,14 @@ interface nsIPluginInstanceOwner : nsISu
                                double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
 %}
 
   void setEventModel(in PRInt32 eventModel);
 
 %{C++
   virtual void SendIdleEvent() = 0;
 %}
-};
 
-/**
- * This interface extends nsIPluginInstanceOwner for the 2.0 branch
- */
-[uuid(20504739-4519-45f3-a8f7-fc8afba7ea87)]
-interface nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH : nsISupports
-{
   /**
    * Call NPP_SetWindow on the plugin.
    */
   void setWindow();
 };
--- a/modules/plugin/base/src/PluginPRLibrary.cpp
+++ b/modules/plugin/base/src/PluginPRLibrary.cpp
@@ -242,22 +242,16 @@ nsresult
 PluginPRLibrary::AsyncSetWindow(NPP instance, NPWindow* window)
 {
   nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
   NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
-PluginPRLibrary::GetSurface(NPP instance, gfxASurface** aSurface)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
 PluginPRLibrary::GetImage(NPP instance, ImageContainer* aContainer, Image** aImage)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 PluginPRLibrary::GetImageSize(NPP instance, nsIntSize* aSize)
 {
--- a/modules/plugin/base/src/PluginPRLibrary.h
+++ b/modules/plugin/base/src/PluginPRLibrary.h
@@ -135,17 +135,16 @@ public:
                              char* argv[], NPSavedData* saved,
                              NPError* error);
 
     virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
                                        uint64_t maxAge);
     virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& result);
 
     virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
-    virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
     virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage);
     virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
     NS_OVERRIDE virtual bool UseAsyncPainting() { return false; }
 #if defined(XP_MACOSX)
     virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, PRBool *aDrawing);
 #endif
     NS_OVERRIDE
     virtual nsresult SetBackgroundUnknown(NPP instance);
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -614,23 +614,24 @@ MakeNewNPAPIStreamInternal(NPP npp, cons
     if (listener) {
       static_cast<nsNPAPIPluginStreamListener*>(listener.get())->SetCallNotify(PR_FALSE);
     }
   }
 
   switch (type) {
   case eNPPStreamTypeInternal_Get:
     {
-      if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener)))
+      if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener,
+                                       NULL, NULL, false)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   case eNPPStreamTypeInternal_Post:
     {
-      if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener)))
+      if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener, NULL, NULL, false, 0, NULL)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   default:
     NS_ERROR("how'd I get here");
   }
 
   if (listener) {
--- a/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
+++ b/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
@@ -45,32 +45,31 @@
 #include "nsNPAPIPluginInstance.h"
 #include "nsNPAPIPlugin.h"
 #include "nsNPAPIPluginStreamListener.h"
 #include "nsPluginHost.h"
 #include "nsPluginSafety.h"
 #include "nsPluginLogging.h"
 #include "nsIPrivateBrowsingService.h"
 #include "nsContentUtils.h"
-#include "nsIContentUtils.h"
 
 #include "nsIDocument.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptContext.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsJSNPRuntime.h"
 #include "nsPluginStreamListenerPeer.h"
 
 using namespace mozilla;
 using namespace mozilla::plugins::parent;
 
 static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
 static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
 
-NS_IMPL_ISUPPORTS2(nsNPAPIPluginInstance, nsIPluginInstance, nsIPluginInstance_MOZILLA_2_0_BRANCH)
+NS_IMPL_ISUPPORTS1(nsNPAPIPluginInstance, nsIPluginInstance)
 
 nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
   :
 #ifdef XP_MACOSX
 #ifdef NP_NO_QUICKDRAW
     mDrawingModel(NPDrawingModelCoreGraphics),
 #else
     mDrawingModel(NPDrawingModelQuickDraw),
@@ -874,29 +873,16 @@ nsNPAPIPluginInstance::AsyncSetWindow(NP
   AutoPluginLibraryCall library(this);
   if (!library)
     return NS_ERROR_FAILURE;
 
   return library->AsyncSetWindow(&mNPP, window);
 }
 
 NS_IMETHODIMP
-nsNPAPIPluginInstance::GetSurface(gfxASurface** aSurface)
-{
-  if (RUNNING != mRunning)
-    return NS_OK;
-
-  AutoPluginLibraryCall library(this);
-  if (!library)
-    return NS_ERROR_FAILURE;
-
-  return library->GetSurface(&mNPP, aSurface);
-}
-
-NS_IMETHODIMP
 nsNPAPIPluginInstance::GetImage(ImageContainer* aContainer, Image** aImage)
 {
   *aImage = nsnull;
 
   if (RUNNING != mRunning)
     return NS_OK;
 
   AutoPluginLibraryCall library(this);
@@ -1370,27 +1356,18 @@ public:
 
   NS_IMETHOD Run();
 };
 
 NS_IMETHODIMP
 CarbonEventModelFailureEvent::Run()
 {
   nsString type = NS_LITERAL_STRING("npapi-carbon-event-model-failure");
-#ifdef MOZ_ENABLE_LIBXUL
   nsContentUtils::DispatchTrustedEvent(mContent->GetDocument(), mContent,
                                        type, PR_TRUE, PR_TRUE);
-#else
-  nsCOMPtr<nsIContentUtils_MOZILLA_2_0_BRANCH> cu =
-    do_GetService("@mozilla.org/content/contentutils-moz2.0;1");
-  if (cu) {
-    cu->DispatchTrustedEvent(mContent->GetDocument(), mContent,
-                             type, PR_TRUE, PR_TRUE);
-  }
-#endif
   return NS_OK;
 }
 
 void
 nsNPAPIPluginInstance::CarbonNPAPIFailure()
 {
   nsCOMPtr<nsIDOMElement> element;
   GetDOMElement(getter_AddRefs(element));
--- a/modules/plugin/base/src/nsNPAPIPluginInstance.h
+++ b/modules/plugin/base/src/nsNPAPIPluginInstance.h
@@ -62,25 +62,24 @@ class nsNPAPITimer
 {
 public:
   NPP npp;
   uint32_t id;
   nsCOMPtr<nsITimer> timer;
   void (*callback)(NPP npp, uint32_t timerID);
 };
 
-class nsNPAPIPluginInstance : public nsIPluginInstance_MOZILLA_2_0_BRANCH
+class nsNPAPIPluginInstance : public nsIPluginInstance
 {
 private:
   typedef mozilla::PluginLibrary PluginLibrary;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGININSTANCE
-  NS_DECL_NSIPLUGININSTANCE_MOZILLA_2_0_BRANCH
 
   nsNPAPIPlugin* GetPlugin();
 
   nsresult GetNPP(NPP * aNPP);
 
   void SetURI(nsIURI* uri);
   nsIURI* GetURI();
 
--- a/modules/plugin/base/src/nsPluginHost.cpp
+++ b/modules/plugin/base/src/nsPluginHost.cpp
@@ -426,19 +426,18 @@ nsPluginHost::nsPluginHost()
 nsPluginHost::~nsPluginHost()
 {
   PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("nsPluginHost::dtor\n"));
 
   Destroy();
   sInst = nsnull;
 }
 
-NS_IMPL_ISUPPORTS5(nsPluginHost,
+NS_IMPL_ISUPPORTS4(nsPluginHost,
                    nsIPluginHost,
-                   nsIPluginHost_MOZILLA_2_0_BRANCH,
                    nsIObserver,
                    nsITimerCallback,
                    nsISupportsWeakReference)
 
 nsPluginHost*
 nsPluginHost::GetInst()
 {
   if (!sInst) {
@@ -1103,19 +1102,17 @@ nsPluginHost::DoInstantiateEmbeddedPlugi
   // if we are here then we have loaded a plugin for this mimetype
   nsNPAPIPluginInstance *instance = static_cast<nsNPAPIPluginInstance*>(instanceCOMPtr.get());
 
   if (instance) {
     instance->Start();
     aOwner->CreateWidget();
 
     // If we've got a native window, the let the plugin know about it.
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-    if (owner)
-      owner->SetWindow();
+    aOwner->SetWindow();
 
     // create an initial stream with data
     // don't make the stream if it's a java applet or we don't have SRC or DATA attribute
     PRBool havedata = PR_FALSE;
 
     nsCOMPtr<nsIPluginTagInfo> pti(do_QueryInterface(aOwner, &rv));
 
     if (pti) {
@@ -1180,25 +1177,22 @@ NS_IMETHODIMP nsPluginHost::InstantiateF
     NPWindow* win = nsnull;
     aOwner->GetWindow(win);
 
     if (win && instance) {
       instance->Start();
       aOwner->CreateWidget();
 
       // If we've got a native window, the let the plugin know about it.
-      nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-      if (owner)
-        owner->SetWindow();
+      aOwner->SetWindow();
 
       rv = NewFullPagePluginStream(aURI, instance, aStreamListener);
 
       // If we've got a native window, the let the plugin know about it.
-      if (owner)
-        owner->SetWindow();
+      aOwner->SetWindow();
     }
   }
 
   PLUGIN_LOG(PLUGIN_LOG_NORMAL,
   ("nsPluginHost::InstantiateFullPagePlugin End mime=%s, rv=%d, owner=%p, url=%s\n",
   aMimeType, rv, aOwner, urlSpec.get()));
 
   return rv;
@@ -1243,19 +1237,17 @@ nsresult nsPluginHost::FindStoppedPlugin
   if (instance && !instance->IsRunning()) {
     aOwner->SetInstance(instance);
     instance->SetOwner(aOwner);
 
     instance->Start();
     aOwner->CreateWidget();
 
     // If we've got a native window, the let the plugin know about it.
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-    if (owner)
-      owner->SetWindow();
+    aOwner->SetWindow();
 
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsPluginHost::SetUpPluginInstance(const char *aMimeType,
                                                 nsIURI *aURL,
--- a/modules/plugin/base/src/nsPluginHost.h
+++ b/modules/plugin/base/src/nsPluginHost.h
@@ -85,58 +85,33 @@ public:
   PRInt64     mLastModifiedTime;
   bool        mSeen;
   
   nsRefPtr<nsInvalidPluginTag> mPrev;
   nsRefPtr<nsInvalidPluginTag> mNext;
 };
 
 class nsPluginHost : public nsIPluginHost,
-                     public nsIPluginHost_MOZILLA_2_0_BRANCH,
                      public nsIObserver,
                      public nsITimerCallback,
                      public nsSupportsWeakReference
 {
 public:
   nsPluginHost();
   virtual ~nsPluginHost();
 
   static nsPluginHost* GetInst();
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGINHOST
-  NS_DECL_NSIPLUGINHOST_MOZILLA_2_0_BRANCH
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
 
-  NS_IMETHOD
-  GetURL(nsISupports* pluginInst, 
-         const char* url, 
-         const char* target = NULL,
-         nsIPluginStreamListener* streamListener = NULL,
-         const char* altHost = NULL,
-         const char* referrer = NULL,
-         PRBool forceJSEnabled = PR_FALSE);
-  
-  NS_IMETHOD
-  PostURL(nsISupports* pluginInst,
-          const char* url,
-          PRUint32 postDataLen, 
-          const char* postData,
-          PRBool isFile = PR_FALSE,
-          const char* target = NULL,
-          nsIPluginStreamListener* streamListener = NULL,
-          const char* altHost = NULL, 
-          const char* referrer = NULL,
-          PRBool forceJSEnabled = PR_FALSE,
-          PRUint32 postHeadersLength = 0, 
-          const char* postHeaders = NULL);
-
   nsresult
   NewPluginURLStream(const nsString& aURL, 
                      nsNPAPIPluginInstance *aInstance, 
                      nsIPluginStreamListener *aListener,
                      nsIInputStream *aPostStream = nsnull,
                      const char *aHeadersData = nsnull, 
                      PRUint32 aHeadersDataLen = 0);
 
@@ -168,19 +143,16 @@ public:
   // checks whether aTag is a "java" plugin tag (a tag for a plugin
   // that does Java)
   static PRBool IsJavaMIMEType(const char *aType);
 
   static nsresult GetPrompt(nsIPluginInstanceOwner *aOwner, nsIPrompt **aPrompt);
 
   static nsresult PostPluginUnloadEvent(PRLibrary* aLibrary);
 
-  void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible);
-  void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame);
-
   void PluginCrashed(nsNPAPIPlugin* plugin,
                      const nsAString& pluginDumpID,
                      const nsAString& browserDumpID);
 
   nsNPAPIPluginInstance *FindInstance(const char *mimetype);
   nsNPAPIPluginInstance *FindStoppedInstance(const char * url);
   nsNPAPIPluginInstance *FindOldestStoppedInstance();
   PRUint32 StoppedInstanceCount();
--- a/modules/plugin/base/src/nsPluginStreamListenerPeer.cpp
+++ b/modules/plugin/base/src/nsPluginStreamListenerPeer.cpp
@@ -667,19 +667,17 @@ nsPluginStreamListenerPeer::OnStartReque
       
       if (NS_OK == rv) {
         mOwner->GetInstance(getter_AddRefs(pluginInstCOMPtr));
         mPluginInstance = static_cast<nsNPAPIPluginInstance*>(pluginInstCOMPtr.get());
         if (mPluginInstance) {
           mPluginInstance->Start();
           mOwner->CreateWidget();
           // If we've got a native window, the let the plugin know about it.
-          nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
-          if (owner)
-            owner->SetWindow();
+          mOwner->SetWindow();
         }
       }
     }
   }
   
   // Set up the stream listener...
   rv = SetUpStreamListener(request, aURL);
   if (NS_FAILED(rv)) return rv;
@@ -871,19 +869,17 @@ nsresult nsPluginStreamListenerPeer::Ser
     // Should call GetPluginPort() here.
     // This part is copied from nsPluginInstanceOwner::GetPluginPort(). 
     nsCOMPtr<nsIWidget> widget;
     ((nsPluginNativeWindow*)window)->GetPluginWidget(getter_AddRefs(widget));
     if (widget) {
       window->window = widget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
     }
 #endif
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
-    if (owner)
-      owner->SetWindow();
+    mOwner->SetWindow();
   }
   
   mSeekable = PR_FALSE;
   mPStreamListener->OnStartBinding(this);
   mStreamOffset = 0;
   
   // force the plugin to use stream as file
   mStreamType = NP_ASFILE;
--- a/modules/plugin/test/mochitest/test_clear_site_data.html
+++ b/modules/plugin/test/mochitest/test_clear_site_data.html
@@ -7,17 +7,17 @@
 </head>
 <body>
   <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
 
   <script class="testbody" type="application/javascript">
     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     SimpleTest.waitForExplicitFinish();
 
-    const pluginHostIface = Components.interfaces.nsIPluginHost_MOZILLA_2_0_BRANCH;
+    const pluginHostIface = Components.interfaces.nsIPluginHost;
     var pluginHost = Components.classes["@mozilla.org/plugin/host;1"].
                      getService(pluginHostIface);
     const FLAG_CLEAR_ALL = pluginHostIface.FLAG_CLEAR_ALL;
     const FLAG_CLEAR_CACHE = pluginHostIface.FLAG_CLEAR_CACHE;
 
     // Make sure clearing by timerange is supported.
     var p = document.getElementById("plugin1");
     p.setSitesWithDataCapabilities(true);
--- a/widget/src/android/AndroidBridge.cpp
+++ b/widget/src/android/AndroidBridge.cpp
@@ -40,23 +40,28 @@
 #include "nsXULAppAPI.h"
 #include <pthread.h>
 #include <prthread.h>
 #include "nsXPCOMStrings.h"
 
 #include "AndroidBridge.h"
 #include "nsAppShell.h"
 #include "nsOSHelperAppService.h"
+#include "nsIPrefService.h"
+#include "nsWindow.h"
 
 #ifdef DEBUG
 #define ALOG_BRIDGE(args...) ALOG(args)
 #else
 #define ALOG_BRIDGE(args...)
 #endif
 
+#define IME_FULLSCREEN_PREF "widget.ime.android.landscape_fullscreen"
+#define IME_FULLSCREEN_THRESHOLD_PREF "widget.ime.android.fullscreen_threshold"
+
 using namespace mozilla;
 
 static PRUintn sJavaEnvThreadIndex = 0;
 
 AndroidBridge *AndroidBridge::sBridge = 0;
 
 static void
 JavaThreadDetachFunc(void *arg)
@@ -98,17 +103,17 @@ AndroidBridge::Init(JNIEnv *jEnv,
     jEnv->GetJavaVM(&mJavaVM);
 
     mJNIEnv = nsnull;
     mThread = nsnull;
 
     mGeckoAppShellClass = (jclass) jEnv->NewGlobalRef(jGeckoAppShellClass);
 
     jNotifyIME = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIME", "(II)V");
-    jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;)V");
+    jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Z)V");
     jNotifyIMEChange = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEChange", "(Ljava/lang/String;III)V");
     jAcknowledgeEventSync = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "acknowledgeEventSync", "()V");
 
     jEnableAccelerometer = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableAccelerometer", "(Z)V");
     jEnableLocation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableLocation", "(Z)V");
     jReturnIMEQueryResult = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "returnIMEQueryResult", "(Ljava/lang/String;II)V");
     jScheduleRestart = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "scheduleRestart", "()V");
     jNotifyAppShellReady = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "onAppShellReady", "()V");
@@ -232,21 +237,45 @@ AndroidBridge::NotifyIMEEnabled(int aSta
 {
     ALOG_BRIDGE("AndroidBridge::NotifyIMEEnabled");
     if (!sBridge)
         return;
 
     nsPromiseFlatString typeHint(aTypeHint);
     nsPromiseFlatString actionHint(aActionHint);
 
-    jvalue args[3];
+    jvalue args[4];
     AutoLocalJNIFrame jniFrame(1);
     args[0].i = aState;
     args[1].l = JNI()->NewString(typeHint.get(), typeHint.Length());
     args[2].l = JNI()->NewString(actionHint.get(), actionHint.Length());
+    args[3].z = false;
+    nsCOMPtr<nsIPrefBranch> prefs = 
+        do_GetService(NS_PREFSERVICE_CONTRACTID);
+    if (prefs) {
+        PRInt32 landscapeFS;
+        nsresult rv = prefs->GetIntPref(IME_FULLSCREEN_PREF, &landscapeFS);
+        if (NS_SUCCEEDED(rv)) {
+            if (landscapeFS == 1) {
+                args[3].z = true;
+            } else if (landscapeFS == -1){
+                rv = prefs->GetIntPref(IME_FULLSCREEN_THRESHOLD_PREF, 
+                                       &landscapeFS);
+                if (NS_SUCCEEDED(rv)) {
+                    // the threshold is hundreths of inches, so convert the 
+                    // threshold to pixels and multiply the height by 100
+                    if (nsWindow::GetAndroidScreenBounds().height  * 100 < 
+                        landscapeFS * Bridge()->GetDPI())
+                        args[3].z = true;
+                }
+
+            }
+        }
+    }
+    
     JNI()->CallStaticVoidMethodA(sBridge->mGeckoAppShellClass,
                                  sBridge->jNotifyIMEEnabled, args);
 }
 
 void
 AndroidBridge::NotifyIMEChange(const PRUnichar *aText, PRUint32 aTextLen,
                                int aStart, int aEnd, int aNewEnd)
 {