Bug 1452624 - Part 2 - Remove the "filefield" binding. r=bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Thu, 12 Apr 2018 11:45:48 +0100
changeset 783609 9f6b49e1156a25f03780cdca10524ce4268a6e33
parent 783608 87c2c1b35244585d10a32658dd28b74d81bf2fff
push id106732
push userpaolo.mozmail@amadzone.org
push dateTue, 17 Apr 2018 13:41:59 +0000
reviewersbgrins
bugs1452624
milestone61.0a1
Bug 1452624 - Part 2 - Remove the "filefield" binding. r=bgrins MozReview-Commit-ID: GQRrmvIna4m
toolkit/content/jar.mn
toolkit/content/widgets/filefield.xml
toolkit/content/xul.css
toolkit/locales/en-US/chrome/global/filefield.properties
toolkit/locales/jar.mn
toolkit/themes/osx/global/filefield.css
toolkit/themes/osx/global/jar.mn
toolkit/themes/osx/reftests/baseline.xul
toolkit/themes/shared/in-content/common.inc.css
toolkit/themes/shared/non-mac.jar.inc.mn
toolkit/themes/windows/global/filefield.css
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -69,17 +69,16 @@ toolkit.jar:
    content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
    content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
    content/global/bindings/datepicker.js       (widgets/datepicker.js)
    content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
    content/global/bindings/datetimebox.xml     (widgets/datetimebox.xml)
    content/global/bindings/datetimebox.css     (widgets/datetimebox.css)
 *  content/global/bindings/dialog.xml          (widgets/dialog.xml)
    content/global/bindings/editor.xml          (widgets/editor.xml)
-   content/global/bindings/filefield.xml       (widgets/filefield.xml)
 *  content/global/bindings/findbar.xml         (widgets/findbar.xml)
    content/global/bindings/general.xml         (widgets/general.xml)
    content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
    content/global/bindings/listbox.xml         (widgets/listbox.xml)
    content/global/bindings/menu.xml            (widgets/menu.xml)
    content/global/bindings/menulist.xml        (widgets/menulist.xml)
    content/global/bindings/notification.xml    (widgets/notification.xml)
    content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
deleted file mode 100644
--- a/toolkit/content/widgets/filefield.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-<bindings id="filefieldBindings"
-          xmlns="http://www.mozilla.org/xbl"
-          xmlns:xbl="http://www.mozilla.org/xbl"
-          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <binding id="filefield" extends="chrome://global/content/bindings/general.xml#basetext">
-    <resources>
-      <stylesheet src="chrome://global/skin/filefield.css"/>
-    </resources>
-    <content>
-      <xul:stringbundle anonid="bundle" src="chrome://global/locale/filefield.properties"/>
-      <xul:hbox class="fileFieldContentBox" align="center" flex="1" xbl:inherits="disabled">
-        <xul:image class="fileFieldIcon" xbl:inherits="src=image,disabled"/>
-        <xul:textbox class="fileFieldLabel" xbl:inherits="value=label,disabled,accesskey,tabindex,aria-labelledby" flex="1" readonly="true"/>
-      </xul:hbox>
-    </content>
-    <implementation implements="nsIDOMXULLabeledControlElement">
-      <property name="label" onget="return this.getAttribute('label');">
-        <setter>
-          this.setAttribute("label", val);
-          var elt = document.getAnonymousElementByAttribute(this, "class", "fileFieldLabel");
-          return (elt.value = val);
-        </setter>
-      </property>
-
-      <field name="_file">null</field>
-      <property name="file"  onget="return this._file">
-        <setter>
-        <![CDATA[
-          this._file = val;
-          if (val) {
-            this.image = this._getIconURLForFile(val);
-            this.label = this._getDisplayNameForFile(val);
-          } else {
-            this.removeAttribute("image");
-            var bundle = document.getAnonymousElementByAttribute(this, "anonid", "bundle");
-            this.label = bundle.getString("downloadHelperNoneSelected");
-          }
-          return val;
-        ]]>
-        </setter>
-      </property>
-      <method name="_getDisplayNameForFile">
-        <parameter name="aFile"/>
-        <body>
-        <![CDATA[
-          if (/Win/.test(navigator.platform)) {
-            var lfw = aFile.QueryInterface(Ci.nsILocalFileWin);
-            try {
-              return lfw.getVersionInfoField("FileDescription");
-            } catch (e) {
-              // fall through to the filename
-            }
-          } else if (/Mac/.test(navigator.platform)) {
-            var lfm = aFile.QueryInterface(Ci.nsILocalFileMac);
-            try {
-              return lfm.bundleDisplayName;
-            } catch (e) {
-              // fall through to the file name
-            }
-          }
-          var ios = Cc["@mozilla.org/network/io-service;1"]
-                      .getService(Ci.nsIIOService);
-          var url = ios.newFileURI(aFile).QueryInterface(Ci.nsIURL);
-          return url.fileName;
-        ]]>
-        </body>
-      </method>
-
-      <method name="_getIconURLForFile">
-        <parameter name="aFile"/>
-        <body>
-        <![CDATA[
-          if (!aFile)
-            return "";
-          var ios = Cc["@mozilla.org/network/io-service;1"]
-                      .getService(Ci.nsIIOService);
-          var fph = ios.getProtocolHandler("file")
-                       .QueryInterface(Ci.nsIFileProtocolHandler);
-          var urlspec = fph.getURLSpecFromFile(aFile);
-          return "moz-icon://" + urlspec + "?size=16";
-        ]]>
-        </body>
-      </method>
-    </implementation>
-  </binding>
-</bindings>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -951,22 +951,16 @@ findbar {
   -moz-binding: url('chrome://global/content/bindings/findbar.xml#findbar');
   overflow-x: hidden;
 }
 
 .findbar-textbox {
   -moz-binding: url("chrome://global/content/bindings/findbar.xml#findbar-textbox");
 }
 
-
-/*********** filefield ************/
-filefield {
-  -moz-binding: url("chrome://global/content/bindings/filefield.xml#filefield");
-}
-
 /*********** tabmodalprompt ************/
 tabmodalprompt {
   -moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt");
   overflow: hidden;
   text-shadow: none;
 }
 
 .button-highlightable-text:not([highlightable="true"]),
deleted file mode 100644
--- a/toolkit/locales/en-US/chrome/global/filefield.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#### Change Action
-
-downloadHelperNoneSelected=None Selected
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -35,17 +35,16 @@
   locale/@AB_CD@/global/contentAreaCommands.properties  (%chrome/global/contentAreaCommands.properties)
   locale/@AB_CD@/global/datetimebox.dtd                 (%chrome/global/datetimebox.dtd)
   locale/@AB_CD@/global/dialogOverlay.dtd               (%chrome/global/dialogOverlay.dtd)
 #ifndef MOZ_FENNEC
   locale/@AB_CD@/global/editMenuOverlay.dtd             (%chrome/global/editMenuOverlay.dtd)
 #endif
   locale/@AB_CD@/global/extensions.properties           (%chrome/global/extensions.properties)
   locale/@AB_CD@/global/fallbackMenubar.properties      (%chrome/global/fallbackMenubar.properties)
-  locale/@AB_CD@/global/filefield.properties            (%chrome/global/filefield.properties)
   locale/@AB_CD@/global/filepicker.properties           (%chrome/global/filepicker.properties)
 #ifndef MOZ_FENNEC
   locale/@AB_CD@/global/findbar.dtd                     (%chrome/global/findbar.dtd)
   locale/@AB_CD@/global/findbar.properties              (%chrome/global/findbar.properties)
 #endif
   locale/@AB_CD@/global/globalKeys.dtd                  (%chrome/global/globalKeys.dtd)
   locale/@AB_CD@/global/intl.css                        (%chrome/global/intl.css)
   locale/@AB_CD@/global/intl.properties                 (%chrome/global/intl.properties)
deleted file mode 100644
--- a/toolkit/themes/osx/global/filefield.css
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*/
-
-.fileFieldIcon {
-  width: 16px;
-  height: 16px;
-}
-
-.fileFieldIcon[disabled="true"] {
-  opacity: 0.5;
-}
-
-filefield {
-  margin: 4px;
-  margin-inline-start: 27px;
-  -moz-appearance: textfield;
-}
-
-.fileFieldContentBox {
-  margin: -3px;
-  background-color: rgba(230, 230, 230, 0.6);
-  color: -moz-DialogText;
-  padding-top: 2px;
-  padding-bottom: 2px;
-  padding-inline-start: 5px;
-  padding-inline-end: 3px;
-}
-
-.fileFieldLabel {
-  -moz-appearance: none;
-  background-color: transparent;
-  border: none;
-  margin: 0 4px;
-}
--- a/toolkit/themes/osx/global/jar.mn
+++ b/toolkit/themes/osx/global/jar.mn
@@ -7,17 +7,16 @@
 toolkit.jar:
   skin/classic/global/autocomplete.css
   skin/classic/global/button.css
   skin/classic/global/checkbox.css
   skin/classic/global/colorpicker.css
   skin/classic/global/commonDialog.css
   skin/classic/global/dialog.css
   skin/classic/global/dropmarker.css
-  skin/classic/global/filefield.css
 * skin/classic/global/findBar.css
 * skin/classic/global/global.css
   skin/classic/global/groupbox.css
   skin/classic/global/listbox.css
   skin/classic/global/menu.css
   skin/classic/global/menulist.css
 * skin/classic/global/notification.css
   skin/classic/global/netError.css
--- a/toolkit/themes/osx/reftests/baseline.xul
+++ b/toolkit/themes/osx/reftests/baseline.xul
@@ -6,18 +6,18 @@
  * XUL authors like to place several different widgets on the same line by
  * putting them in a <hbox align="center">. In order for this to look good,
  * the baselines of the text contained in the widgets should line up.
  * This is what this test is testing.
  * The test passes if it's completely white.
  *
  * It works like this:
  * For every combination of two different widgets (where widget is one of
- * label, radio, checkbox, button, textbox, menulist, menulist[editable="true"] or
- * filefield), there's a stack with two layers. The back layer in the stack is
+ * label, radio, checkbox, button, textbox, menulist, menulist[editable="true"]),
+ * there's a stack with two layers. The back layer in the stack is
  * just a vertically centered label with a bunch of underscores. This is the
  * baseline that the text on the widgets should hit.
  * On the foreground layer in the stack we've placed the pair of widgets we're
  * testing. They also have underscores in their labels.
  *
  * Now we want to test whether the underscores in the foreground layer are directly
  * on top of those in the back layer. For that we use color-keying and a tricky
  * SVG color transformation.
@@ -125,28 +125,23 @@ function createMenulist(v) {
   list.appendChild(popup);
   return list;
 }
 function createEditableMenulist(v) {
   let list = createMenulist(v);
   list.setAttribute("editable", "true");
   return list;
 }
-function createFileField(v) {
-  let field = elWithValue("filefield", v);
-  field.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUEBAAAEBLCjf2dK8NsKrCaTT51nAoFAIBAIBAKB4MoCtVsCPjrGuiwAAAAASUVORK5CYII=");
-  return field;
-}
 function loaded() {
   let template = document.getElementById("template");
   ["regular", "small"].forEach(function(size) {
     let wrapper = document.querySelectorAll("#wrapper > ." + size)[0];
     allPairs([
       createLabel, createRadio, createCheckbox, createButton, createMenulist, createTextField,
-       /* createEditableMenulist, createFileField, */ /* These don't inherit "color" properly */
+       /* createEditableMenulist, */ /* These don't inherit "color" properly */
     ]).forEach(function(elemList) {
       let newBox = template.cloneNode(true);
       newBox.className = "spacer";
       let foregroundRow = newBox.firstChild.lastChild;
       elemList.forEach(function(creator) {
         foregroundRow.appendChild(creator("______"));
       });
       wrapper.appendChild(newBox);
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -741,55 +741,16 @@ xul|*.radio-label-box {
 *|*.header-name {
   font-size: 1.46em;
   font-weight: 300;
   line-height: 1.3em;
   margin: 0;
   -moz-user-select: none;
 }
 
-/* File fields */
-
-xul|filefield {
-  -moz-appearance: none;
-  background-color: transparent;
-  border: none;
-  padding: 0;
-}
-
-xul|*.fileFieldContentBox {
-  background-color: transparent;
-}
-
-xul|*.fileFieldIcon {
-  margin-inline-start: 10px;
-  margin-inline-end: 0;
-}
-
-xul|*.fileFieldLabel {
-  margin-inline-start: -26px;
-  padding-inline-start: 36px;
-}
-
-xul|*.fileFieldLabel:-moz-locale-dir(rtl),
-xul|filefield + xul|button:-moz-locale-dir(ltr) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-
-xul|*.fileFieldLabel:-moz-locale-dir(ltr),
-xul|filefield + xul|button:-moz-locale-dir(rtl) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-
-xul|filefield + xul|button {
-  border-inline-start: none;
-}
-
 /* List boxes */
 
 html|select[size][multiple],
 xul|richlistbox,
 xul|listbox {
   -moz-appearance: none;
   margin-inline-start: 0;
   background-color: var(--in-content-box-background);
--- a/toolkit/themes/shared/non-mac.jar.inc.mn
+++ b/toolkit/themes/shared/non-mac.jar.inc.mn
@@ -6,17 +6,16 @@
 # by the shared jar manifest, which in turn is included by the os-specific
 # manifests.
 # As a result, the source file paths are relative to the location of the
 # actual manifests.
 
 #include jar.inc.mn
 
   skin/classic/global/dialog.css                           (../../windows/global/dialog.css)
-  skin/classic/global/filefield.css                        (../../windows/global/filefield.css)
   skin/classic/global/progressmeter.css                    (../../windows/global/progressmeter.css)
   skin/classic/global/resizer.css                          (../../windows/global/resizer.css)
   skin/classic/global/richlistbox.css                      (../../windows/global/richlistbox.css)
   skin/classic/global/scrollbars.css                       (../../windows/global/xulscrollbars.css)
   skin/classic/global/tabprompts.css                       (../../windows/global/tabprompts.css)
   skin/classic/global/wizard.css                           (../../windows/global/wizard.css)
 
   skin/classic/global/arrow/arrow-dn.gif                   (../../windows/global/arrow/arrow-dn.gif)
deleted file mode 100644
--- a/toolkit/themes/windows/global/filefield.css
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-*/
-
-/* File Field Widget */
-filefield {
-  margin: 2px 4px;
-  -moz-appearance: textfield;
-}
-
-.fileFieldContentBox {
-  background-color: -moz-Dialog;
-}
-
-.fileFieldIcon[disabled="true"] {
-  opacity: 0.4;
-}
-
-.fileFieldIcon {
-  width: 16px;
-  height: 16px;
-  margin-top: 1px;
-  margin-bottom: 1px;
-  margin-inline-start: 1px;
-  margin-inline-end: 4px;
-}
-
-.fileFieldLabel {
-  -moz-appearance: none;
-  background-color: transparent;
-  border: none;
-  margin: 0px;
-}