toolkit/content/widgets/general.xml
author Matthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 08 Feb 2019 17:46:51 -0800
changeset 458980 047455dcfc2037b755cd2c23434f0b8767b7b352
parent 447633 54812dc57a75760aa3b4dda47f0fa3bae5b40df2
child 461182 ef831b231f7dbc497a6e26a5f46d042afd677da1
permissions -rw-r--r--
Bug 1439023 - Don't reset autocomplete controller state when autofill fell back to form history. r=jaws Otherwise the cached value won't be used for filling by satchel and _fillFromAutocompleteRow won't fill a result that isn't a `autofill-profile` style: https://searchfox.org/mozilla-central/rev/03ebbdab952409640c6857d835d3040bf6f9e2db/browser/extensions/formautofill/FormAutofillContent.jsm#283,295 Differential Revision: https://phabricator.services.mozilla.com/D19249

<?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="generalBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:xbl="http://www.mozilla.org/xbl">

  <binding id="basecontrol">
    <implementation implements="nsIDOMXULControlElement">
      <!-- public implementation -->
      <property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
                                       else this.removeAttribute('disabled');
                                       return val;"
                                onget="return this.getAttribute('disabled') == 'true';"/>
      <property name="tabIndex" onget="return parseInt(this.getAttribute('tabindex')) || 0"
                                onset="if (val) this.setAttribute('tabindex', val);
                                       else this.removeAttribute('tabindex'); return val;"/>
    </implementation>
  </binding>

  <binding id="basetext" extends="chrome://global/content/bindings/general.xml#basecontrol">
    <implementation>
      <!-- public implementation -->
      <property name="label"      onset="this.setAttribute('label',val); return val;"
                                  onget="return this.getAttribute('label');"/>
      <property name="crop"       onset="this.setAttribute('crop',val); return val;"
                                  onget="return this.getAttribute('crop');"/>
      <property name="image"      onset="this.setAttribute('image',val); return val;"
                                  onget="return this.getAttribute('image');"/>
      <property name="command"    onset="this.setAttribute('command',val); return val;"
                                  onget="return this.getAttribute('command');"/>
      <property name="accessKey">
        <getter>
          <![CDATA[
            return this.labelElement ? this.labelElement.accessKey : this.getAttribute("accesskey");
          ]]>
        </getter>
        <setter>
          <![CDATA[
            // Always store on the control
            this.setAttribute("accesskey", val);
            // If there is a label, change the accesskey on the labelElement
            // if it's also set there
            if (this.labelElement) {
              this.labelElement.accessKey = val;
            }
            return val;
          ]]>
        </setter>
      </property>

      <field name="labelElement"/>
    </implementation>
  </binding>

</bindings>