Bug 1391665 - Port Bug 945627. Remove FIXUP_FLAG_USE_UTF8 in SeaMonkey. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Fri, 25 Aug 2017 04:01:04 +0200
changeset 28001 e1ff44e7aadcafc876d36032aecbc0b24dc1e4a5
parent 28000 1f52fda16504e8eeb5ed5ee33f4289a57099e5e4
child 28002 5ca190d741214e028652706db51083bf01fdb59b
push id1943
push userfrgrahl@gmx.net
push dateFri, 25 Aug 2017 02:01:36 +0000
treeherdercomm-esr52@e1ff44e7aadc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1391665, 945627
Bug 1391665 - Port Bug 945627. Remove FIXUP_FLAG_USE_UTF8 in SeaMonkey. r=IanN a=IanN
suite/browser/navigator.js
suite/browser/tabbrowser.xml
suite/common/utilityOverlay.js
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -1652,27 +1652,24 @@ function BrowserCloseWindow()
   win.setAttribute( "x", x );
   win.setAttribute( "y", y );
   win.setAttribute( "height", h );
   win.setAttribute( "width", w );
 
   window.close();
 }
 
-function loadURI(uri, referrer, postData, allowThirdPartyFixup, isUTF8)
+function loadURI(uri, referrer, postData, allowThirdPartyFixup)
 {
   try {
     var flags = nsIWebNavigation.LOAD_FLAGS_NONE;
     if (allowThirdPartyFixup) {
       flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
               nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
     }
-    if (isUTF8) {
-      flags |= nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8;
-    }
     if (!flags && typeof postData == "number") {
       // Deal with legacy code that passes load flags in the third argument.
       flags = postData;
       postData = null;
     }
     gBrowser.loadURIWithFlags(uri, flags, referrer, null, postData);
   } catch (e) {
   }
@@ -1710,40 +1707,38 @@ function handleURLBarCommand(aUserAction
     if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent &&
         'altKey' in aTriggeringEvent) {
       saveModifier = modifierIsShift ? aTriggeringEvent.shiftKey
                      : aTriggeringEvent.altKey;
       shiftPressed = aTriggeringEvent.shiftKey;
     }
 
     var browser = getBrowser();
-    var isUTF8 = browser.userTypedValue === null;
     // Accept both Control and Meta (=Command) as New-Window-Modifiers
     if (aTriggeringEvent &&
         (('ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey) ||
          ('metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey) ||
          ('button'  in aTriggeringEvent && aTriggeringEvent.button == 1))) {
       // Check if user requests Tabs instead of windows
       if (GetBoolPref("browser.tabs.opentabfor.urlbar", false)) {
         // Reset url in the urlbar
         URLBarSetURI();
         // Open link in new tab
         var t = browser.addTab(data.url, {
                   postData: data.postData,
                   allowThirdPartyFixup: true,
-                  isUTF8: isUTF8
                 });
 
         // Focus new tab unless shift is pressed
         if (!shiftPressed)
           browser.selectedTab = t;
       } else {
         // Open a new window with the URL
         var newWin = openDialog(getBrowserURL(), "_blank", "all,dialog=no", data.url,
-                                null, null, data.postData, true, isUTF8);
+                                null, null, data.postData, true);
         // Reset url in the urlbar
         URLBarSetURI();
 
         // Focus old window if shift was pressed, as there's no
         // way to open a new window in the background
         // XXX this doesn't seem to work
         if (shiftPressed) {
           //newWin.blur();
@@ -1763,17 +1758,17 @@ function handleURLBarCommand(aUserAction
       }
       catch(ex) {
         // XXX Do nothing for now.
         // Do we want to put up an alert in the future?  Mmm, l10n...
       }
     } else {
       // No modifier was pressed, load the URL normally and
       // focus the content area
-      loadURI(data.url, null, data.postData, true, isUTF8);
+      loadURI(data.url, null, data.postData, true);
       content.focus();
     }
   });
 }
 
 /**
  * Given a string, will generate a more appropriate urlbar value if a Places
  * keyword or a search alias is found at the beginning of it.
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -1558,32 +1558,30 @@
         <parameter name="aCharset"/>
         <parameter name="aPostData"/>
         <parameter name="aFocusNewTab"/>
         <parameter name="aAllowThirdPartyFixup"/>
         <body>
           <![CDATA[
             var aFromExternal;
             var aRelatedToCurrent;
-            var aIsUTF8;
             var aUserContextId;
             var aOpener;
             if (arguments.length == 2 &&
                 arguments[1] != null &&
                 typeof arguments[1] == "object" &&
                 !(arguments[1] instanceof Components.interfaces.nsIURI)) {
               let params = arguments[1];
               aReferrerURI          = params.referrerURI;
               aCharset              = params.charset;
               aPostData             = params.postData;
               aFocusNewTab          = params.focusNewTab;
               aAllowThirdPartyFixup = params.allowThirdPartyFixup;
               aFromExternal         = params.fromExternal;
               aRelatedToCurrent     = params.relatedToCurrent;
-              aIsUTF8               = params.isUTF8;
               aUserContextId        = params.userContextId;
               aOpener               = params.opener;
             }
 
             this._browsers = null; // invalidate cache
 
             var t = this.referenceTab.cloneNode(true);
 
@@ -1659,18 +1657,16 @@
 
               let nsIWebNavigation = Components.interfaces.nsIWebNavigation;
               let flags = nsIWebNavigation.LOAD_FLAGS_NONE;
               if (aAllowThirdPartyFixup)
                 flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
                         nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
               if (aFromExternal)
                 flags |= nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
-              if (aIsUTF8)
-                flags |= nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8;
               try {
                 b.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset, aPostData);
               }
               catch (ex) { }
             }
 
             t.dispatchEvent(new Event("TabOpen",
               { bubbles: true, cancelable: false }));
--- a/suite/common/utilityOverlay.js
+++ b/suite/common/utilityOverlay.js
@@ -1495,73 +1495,70 @@ function whereToOpenLink(e, ignoreButton
  */
 function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI)
 {
   if (!where || !url)
     return null;
 
   var aRelatedToCurrent;
   var aInitiatingDoc;
-  var aIsUTF8;
   if (arguments.length == 3 &&
       arguments[2] != null &&
       typeof arguments[2] == "object") {
     let params = arguments[2];
     aAllowThirdPartyFixup = params.allowThirdPartyFixup;
     aPostData             = params.postData;
     aReferrerURI          = params.referrerURI;
     aRelatedToCurrent     = params.relatedToCurrent;
     aInitiatingDoc        = params.initiatingDoc ? params.initiatingDoc : document;
-    aIsUTF8               = params.isUTF8;
   }
 
   if (where == "save") {
     saveURL(url, null, null, true, true, aReferrerURI, aInitiatingDoc);
     return null;
   }
 
   if (where == "private") {
     window.openDialog(getBrowserURL(), "_blank", "private,chrome,all,dialog=no",
-                      url, null, null, aPostData, aAllowThirdPartyFixup, aIsUTF8);
+                      url, null, null, aPostData, aAllowThirdPartyFixup);
     return null;
   }
 
   var w = getTopWin();
 
   if (!w || where == "window") {
     return window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", url,
-                             null, null, aPostData, aAllowThirdPartyFixup, aIsUTF8);
+                             null, null, aPostData, aAllowThirdPartyFixup);
   }
 
   var loadInBackground = GetBoolPref("browser.tabs.loadInBackground", false);
 
   // reuse the browser if its current tab is empty
   if (isBrowserEmpty(w.getBrowser()))
     where = "current";
 
   switch (where) {
   case "current":
-    w.loadURI(url, aReferrerURI, aPostData, aAllowThirdPartyFixup, aIsUTF8);
+    w.loadURI(url, aReferrerURI, aPostData, aAllowThirdPartyFixup);
     w.content.focus();
     break;
   case "tabfocused":
     // forces tab to be focused
     loadInBackground = true;
     // fall through
   case "tabshifted":
     loadInBackground = !loadInBackground;
     // fall through
   case "tab":
     var browser = w.getBrowser();
     var tab = browser.addTab(url, {
                 referrerURI: aReferrerURI,
                 postData: aPostData,
                 allowThirdPartyFixup: aAllowThirdPartyFixup,
                 relatedToCurrent: aRelatedToCurrent,
-                isUTF8: aIsUTF8
               });
     if (!loadInBackground) {
       browser.selectedTab = tab;
       w.content.focus();
     }
     break;
   }