Merge mozilla-central to mozilla-inbound
authorEd Morley <bmo@edmorley.co.uk>
Sun, 04 Mar 2012 23:56:40 +0000
changeset 88442 03338969ab9ebc3756653cb115aaf24b7ef242d1
parent 88441 9b65b4ac15cd1250418dac2113a3e81775b32bf1 (current diff)
parent 88425 433cfbd2a0da3f9cc7c1391f95a28404966c6466 (diff)
child 88443 71995d5b92a111a7e2d42abc8299f2e664050cee
push id157
push userMs2ger@gmail.com
push dateWed, 07 Mar 2012 19:27:10 +0000
milestone13.0a1
Merge mozilla-central to mozilla-inbound
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -60,17 +60,17 @@
         </children>
         <xul:hbox anonid="textbox-input-box"
                   class="textbox-input-box urlbar-input-box"
                   flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input"
                       class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
                       allowevents="true"
-                      xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
+                      xbl:inherits="tooltiptext=inputtooltiptext,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
       <xul:dropmarker anonid="historydropmarker"
                       class="autocomplete-history-dropmarker urlbar-history-dropmarker"
                       allowevents="true"
                       xbl:inherits="open,enablehistory,parentfocused=focused"/>
       <xul:popupset anonid="popupset"
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -454,17 +454,17 @@ def wrapCommand(cmd):
   return cmd
 
 class ShutdownLeakLogger(object):
   """
   Parses the mochitest run log when running a debug build, assigns all leaked
   DOM windows (that are still around after test suite shutdown, despite running
   the GC) to the tests that created them and prints leak statistics.
   """
-  MAX_LEAK_COUNT = 120
+  MAX_LEAK_COUNT = 130
 
   def __init__(self, logger):
     self.logger = logger
     self.tests = []
     self.leakedWindows = {}
     self.leakedDocShells = set()
     self.currentTest = None
     self.seenShutdown = False
@@ -474,17 +474,17 @@ class ShutdownLeakLogger(object):
       self._logWindow(line)
     elif line[2:10] == "DOCSHELL":
       self._logDocShell(line)
     elif line.startswith("TEST-START"):
       fileName = line.split(" ")[-1].strip().replace("chrome://mochitests/content/browser/", "")
       self.currentTest = {"fileName": fileName, "windows": set(), "docShells": set()}
     elif line.startswith("INFO TEST-END"):
       # don't track a test if no windows or docShells leaked
-      if self.currentTest["windows"] and self.currentTest["docShells"]:
+      if self.currentTest["windows"] or self.currentTest["docShells"]:
         self.tests.append(self.currentTest)
       self.currentTest = None
     elif line.startswith("INFO TEST-START | Shutdown"):
       self.seenShutdown = True
 
   def parse(self):
     leakingTests = self._parseLeakingTests()
 
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -65,17 +65,17 @@
         <children includes="image|deck|stack|box">
           <xul:image class="autocomplete-icon" allowevents="true"/>
         </children>
 
         <xul:hbox anonid="textbox-input-box" class="textbox-input-box" flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input" class="autocomplete-textbox textbox-input"
                       allowevents="true"
-                      xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
+                      xbl:inherits="tooltiptext=inputtooltiptext,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
 
       <xul:dropmarker anonid="historydropmarker" class="autocomplete-history-dropmarker"
                       allowevents="true"
                       xbl:inherits="open,enablehistory,parentfocused=focused"/>
 
--- a/toolkit/content/widgets/numberbox.xml
+++ b/toolkit/content/widgets/numberbox.xml
@@ -11,17 +11,17 @@
 
     <resources>
       <stylesheet src="chrome://global/skin/numberbox.css"/>
     </resources>
 
     <content>
       <xul:hbox class="textbox-input-box numberbox-input-box" flex="1" xbl:inherits="context,disabled,focused">
         <html:input class="numberbox-input textbox-input" anonid="input"
-                    xbl:inherits="onfocus,onblur,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
+                    xbl:inherits="value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
       </xul:hbox>
       <xul:spinbuttons anonid="buttons" xbl:inherits="disabled,hidden=hidespinbuttons"/>
     </content>
 
     <implementation>
       <field name="_valueEntered">false</field>
       <field name="_spinButtons">null</field>
       <field name="_value">0</field>
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -16,17 +16,17 @@
       <stylesheet src="chrome://global/content/textbox.css"/>
       <stylesheet src="chrome://global/skin/textbox.css"/>
     </resources>
 
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
         <html:input class="textbox-input" anonid="input"
-                    xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint,spellcheck"/>
+                    xbl:inherits="value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint,spellcheck"/>
       </xul:hbox>
     </content>
 
     <implementation implements="nsIAccessibleProvider, nsIDOMXULTextBoxElement, nsIDOMXULLabeledControlElement">
       <property name="accessibleType" readonly="true">
         <getter>
           <![CDATA[
             return Components.interfaces.nsIAccessibleProvider.XULTextBox;
@@ -303,17 +303,17 @@
     </handlers>
   </binding>
 
   <binding id="search-textbox" extends="chrome://global/content/bindings/textbox.xml#textbox">
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck" align="center">
         <html:input class="textbox-input" anonid="input" mozactionhint="search"
-                    xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,spellcheck"/>
+                    xbl:inherits="value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,spellcheck"/>
         <xul:deck class="textbox-search-icons" anonid="search-icons">
           <xul:image class="textbox-search-icon"
                      onclick="document.getBindingParent(this)._iconClick();"
                      xbl:inherits="src=image,searchbutton,disabled"/>
           <xul:image class="textbox-search-clear"
                      onclick="document.getBindingParent(this)._clearSearch();"
                      xbl:inherits="disabled"/>
         </xul:deck>
@@ -430,17 +430,17 @@
       </handler>
     </handlers>
   </binding>
 
   <binding id="textarea" extends="chrome://global/content/bindings/textbox.xml#textbox">
     <content>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
         <html:textarea class="textbox-textarea" anonid="input"
-                       xbl:inherits="onfocus,onblur,xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap,placeholder,mozactionhint,spellcheck"><children/></html:textarea>
+                       xbl:inherits="xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap,placeholder,mozactionhint,spellcheck"><children/></html:textarea>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="input-box">
     <content context="_child">
       <children/>
       <xul:menupopup anonid="input-box-contextmenu"
--- a/toolkit/mozapps/extensions/test/browser/Makefile.in
+++ b/toolkit/mozapps/extensions/test/browser/Makefile.in
@@ -94,24 +94,25 @@ include $(DEPTH)/config/autoconf.mk
   browser_tabsettings.js \
   $(NULL)
 
 _TEST_FILES = \
   head.js \
   browser_addonrepository_performance.js \
   browser_bug557956.js \
   browser_bug616841.js \
+  browser_checkAddonCompatibility.js \
   browser_hotfix.js \
-  browser_updatessl.js \
   browser_installssl.js \
   browser_newaddon.js \
-  browser_select_selection.js \
   browser_select_compatoverrides.js \
   browser_select_confirm.js \
+  browser_select_selection.js \
   browser_select_update.js \
+  browser_updatessl.js \
   $(NULL)
 
 _TEST_RESOURCES = \
   addon_about.xul \
   addon_prefs.xul \
   browser_bug557956.rdf \
   browser_bug557956_8_2.xpi \
   browser_bug557956_9_2.xpi \
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/browser/browser_checkAddonCompatibility.js
@@ -0,0 +1,34 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+// Test that all bundled add-ons are compatible.
+
+function test() {
+  waitForExplicitFinish();
+
+  Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true);
+  ok(AddonManager.strictCompatibility, "Strict compatibility should be enabled");
+
+  AddonManager.getAllAddons(function gAACallback(aAddons) {
+    // Sort add-ons (by type and name) to improve output.
+    aAddons.sort(function compareTypeName(a, b) {
+      return a.type.localeCompare(b.type) || a.name.localeCompare(b.name);
+    });
+
+    let allCompatible = true;
+    aAddons.forEach(function checkCompatibility(a) {
+      // Ignore plugins.
+      if (a.type == "plugin")
+        return;
+
+      ok(a.isCompatible, a.type + " " + a.name + " " + a.version + " should be compatible");
+      allCompatible = allCompatible && a.isCompatible;
+    });
+    // Add a reminder.
+    if (!allCompatible)
+      ok(false, "As this test failed, test browser_bug557956.js should have failed, too.");
+
+    finish();
+  });
+}
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -20,17 +20,17 @@
         <children includes="image|deck|stack|box">
           <xul:image class="autocomplete-icon" allowevents="true"/>
         </children>
 
         <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input" class="autocomplete-textbox textbox-input"
                       allowevents="true"
-                      xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,userAction"/>
+                      xbl:inherits="tooltiptext=inputtooltiptext,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,userAction"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
 
       <xul:dropmarker class="autocomplete-history-dropmarker" allowevents="true"
                       xbl:inherits="open,enablehistory" anonid="historydropmarker"/>
 
       <xul:popupset>
@@ -43,21 +43,25 @@
     <implementation implements="nsIDOMXULMenuListElement, nsIAccessibleProvider">
 
       <constructor><![CDATA[
         // XXX bug 90337 band-aid until we figure out what's going on here
         if (this.value != this.mInputElt.value)
           this.mInputElt.value = this.value;
         delete this.value;
 
+        // listen for pastes
+        this.mInputElt.controllers.insertControllerAt(0, this.mPasteController);
+
         // listen for menubar activation
         window.top.addEventListener("DOMMenuBarActive", this.mMenuBarListener, true);
 
         // set default property values
         this.ifSetAttribute("timeout", 50);
+        this.ifSetAttribute("pastetimeout", 1000);
         this.ifSetAttribute("maxrows", 5);
         this.ifSetAttribute("showpopup", true);
         this.ifSetAttribute("disableKeyNavigation", true);
         
         // initialize the search sessions
         if (this.hasAttribute("autocompletesearch"))
           this.initAutoCompleteSearch();
         if (this.hasAttribute("searchSessions"))
@@ -66,16 +70,17 @@
         // hack to work around lack of bottom-up constructor calling
         if ("initialize" in this.popup)
           this.popup.initialize();
       ]]></constructor>
 
       <destructor><![CDATA[
         this.clearResults(false);
         window.top.removeEventListener("DOMMenuBarActive", this.mMenuBarListener, true);
+        this.mInputElt.controllers.removeController(this.mPasteController);
       ]]></destructor>
       
       <!-- =================== PUBLIC PROPERTIES =================== -->
 
       <property name="value"
                 onget="return this.mInputElt.value;">
         <setter><![CDATA[
           this.ignoreInputEvent = true;
@@ -140,16 +145,21 @@
       <!-- the number of sessions currently in use -->
       <field name="sessionCount">0</field>
 
       <!-- number of milliseconds after a keystroke before a search begins -->
       <property name="timeout"
                 onset="this.setAttribute('timeout', val); return val;"
                 onget="var t = parseInt(this.getAttribute('timeout')); return t ? t : 0;"/>
 
+      <!-- number of milliseconds after a paste before a search begins -->
+      <property name="pasteTimeout"
+                onset="this.setAttribute('pastetimeout', val); return val;"
+                onget="var t = parseInt(this.getAttribute('pastetimeout')); return t ? t : 0;"/>
+
       <!-- maximum number of rows to display -->
       <property name="maxRows"
                 onset="this.setAttribute('maxrows', val); return val;"
                 onget="var t = parseInt(this.getAttribute('maxrows')); return t ? t : 0;"/>
 
       <!-- option for filling the textbox with the best match while typing 
            and selecting the difference -->
       <property name="autoFill"
@@ -291,16 +301,40 @@
       <field name="mNeedToComplete">false</field>
       <field name="mTransientValue">false</field>
       <field name="mView">null</field>
       <field name="currentSearchString">""</field>
       <field name="ignoreInputEvent">false</field>
       <field name="oninit">null</field>
       <field name="mDefaultMatchFilled">false</field>
       <field name="mFirstReturn">true</field>
+      <field name="mIsPasting">false</field>
+
+      <field name="mPasteController"><![CDATA[
+        ({
+          self: this,
+          kGlobalClipboard: Components.interfaces.nsIClipboard.kGlobalClipboard,
+          supportsCommand: function(aCommand) {
+            return aCommand == "cmd_paste";
+          },
+          isCommandEnabled: function(aCommand) {
+            return aCommand == "cmd_paste" &&
+                   this.self.editor.isSelectionEditable &&
+                   this.self.editor.canPaste(this.kGlobalClipboard);
+          },
+          doCommand: function(aCommand) {
+            if (aCommand == "cmd_paste") {
+              this.self.mIsPasting = true;
+              this.self.editor.paste(this.kGlobalClipboard);
+              this.self.mIsPasting = false;
+            }
+          },
+          onEvent: function() {}
+        })
+      ]]></field>
 
       <field name="mMenuBarListener"><![CDATA[
         ({
           self: this,
           handleEvent: function(aEvent) {
             try {
               this.self.finishAutoComplete(false, false, aEvent);
               this.self.clearTimer();
@@ -935,17 +969,18 @@
           this.mFinishAfterSearch = false;
           this.mNeedToFinish = true;
           this.mTransientValue = false;
           this.mNeedToComplete = true;
           var str = this.value;
           this.currentSearchString = str;
           this.popup.clearSelection();
           
-          this.mAutoCompleteTimer = setTimeout(this.callListener, this.timeout, this, "startLookup");
+          var timeout = this.mIsPasting ? this.pasteTimeout : this.timeout;
+          this.mAutoCompleteTimer = setTimeout(this.callListener, timeout, this, "startLookup");
         ]]></body>
       </method>
 
       <!--  -->
       <method name="processKeyPress">
         <parameter name="aEvent"/>
         <body><![CDATA[
           this.mLastKeyCode = aEvent.keyCode;