<?xml version="1.0" encoding="UTF-8"?>

<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is mozilla.org browser.
   -
   - The Initial Developer of the Original Code is
   -   Dão Gottwald <dao@design-noir.de>.
   - Portions created by the Initial Developer are Copyright (C) 2007
   - the Initial Developer. All Rights Reserved.
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the GPL or the LGPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->

<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:html="http://www.w3.org/1999/xhtml"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:xbl="http://www.mozilla.org/xbl">

  <binding id="urlbar" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
    <content sizetopopup="pref">
      <xul:hbox class="autocomplete-textbox-container" flex="1">
        <xul:hbox class="textbox-icon-box"
                  onclick="focus(); inputField.select();"
                  onmouseover="document.getBindingParent(this)._iconWasHovered = true;">
          <children includes="image|deck|stack">
            <xul:image class="autocomplete-icon" allowevents="true"/>
          </children>
        </xul:hbox>

        <xul:stack flex="1" class="textbox-stack">
          <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"
                        flex="1" allowevents="true"
                        xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,userAction"/>
          </xul:hbox>
          <xul:hbox anonid="presentation-box" class="textbox-presentation-box" flex="1"
                         onmousedown="focus();"
                         ondragover="nsDragAndDrop.dragOver(event, dndObserver);"
                         ondragdrop="nsDragAndDrop.drop(event, dndObserver);"
                         ondragexit="nsDragAndDrop.dragExit(event, dndObserver);">
            <xul:scrollbox anonid="presentation" class="textbox-presentation" flex="1"
                           onoverflow="contentIsCropped = true;"
                           onunderflow="contentIsCropped = false;">
              <xul:hbox anonid="prePath" class="textbox-presentation-segment textbox-presentation-prePath">
                <xul:label anonid="protocol" class="textbox-presentation-protocol"/>
                <xul:label anonid="subdomain" class="textbox-presentation-subdomain"/>
                <xul:label anonid="domain" class="textbox-presentation-domain"/>
                <xul:label anonid="port" class="textbox-presentation-port"/>
              </xul:hbox>
              <xul:hbox anonid="pathFile" class="textbox-presentation-segment textbox-presentation-pathFile">
                <xul:label anonid="file" class="textbox-presentation-file"/>
                <xul:label anonid="query" class="textbox-presentation-query"/>
                <xul:label anonid="fragment" class="textbox-presentation-fragment"/>
              </xul:hbox>
            </xul:scrollbox>
            <xul:label anonid="overflow-ellipsis" class="textbox-overflow-ellipsis"
                       value="&#8230;" hidden="true"/>
          </xul:hbox>
        </xul:stack>

        <children includes="hbox"/>
      </xul:hbox>

      <xul:dropmarker anonid="historydropmarker" class="autocomplete-history-dropmarker"
                      allowevents="true"
                      xbl:inherits="open,enablehistory"/>

      <xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
    </content>

    <implementation implements="nsIDOMEventListener, nsIObserver">
      <constructor><![CDATA[
        this._prefs.addObserver("", this, false);
        this.hideProtocols = this._prefs.getCharPref("hideProtocols").split(" ");
        this.animateBlend = this._prefs.getBoolPref("animateBlend");
        this.mouseOnTopLinkifies = this._prefs.getBoolPref("mouseOnTopLinkifies");
        this.mouseOnBottomLinkifies = this._prefs.getBoolPref("mouseOnBottomLinkifies");

        var self = this;
        this.inputBox.doCommand = function doCommand(command) {
          switch (command) {
            case "cmd_copy":
              self.doCopy();
              break;
            case "cmd_cut":
              self.doCut();
              break;
            default:
              var controller = document.commandDispatcher.getControllerForCommand(command);
              controller.doCommand(command);
          }
        };

        this.plain = true;

        if (!this._GECKO18)
          this.presentationBox.style.setProperty("-moz-padding-start", "1px", "");
      ]]></constructor>

      <destructor><![CDATA[
        this._prefs.removeObserver("", this);
      ]]></destructor>

      <field name="_GECKO18">
        /^1\.8(?:\.|$)/.test(Components.classes["@mozilla.org/xre/app-info;1"]
                                       .getService(Components.interfaces.nsIXULAppInfo)
                                       .platformVersion);
      </field>
      <field name="animateBlend"/>
      <field name="mouseOnTopLinkifies"/>
      <field name="mouseOnBottomLinkifies"/>
      <field name="uri"/>
      <field name="hideProtocols">[]</field>
      <field name="protocolHidden"/>
      <field name="_focused"/>
      <field name="_mouseover"/>
      <field name="_iconWasHovered"/>
      <field name="_blendingTimers">[]</field>
      <field name="_tooltipTimer"/>
      <field name="pathSegmentProto">
        var node = document.createElement ("label");
        node.className = "textbox-presentation-segment textbox-presentation-path";
        node;
      </field>
      <field name="inputBox">
        document.getAnonymousElementByAttribute(this, "anonid", "textbox-input-box");
      </field>
      <field name="presentationBox">
        document.getAnonymousElementByAttribute(this, "anonid", "presentation-box");
      </field>
      <field name="presentation">
        document.getAnonymousElementByAttribute(this, "anonid", "presentation");
      </field>
      <field name="overflowEllipsis">
        document.getAnonymousElementByAttribute(this, "anonid", "overflow-ellipsis");
      </field>
      <field name="prePathNode">
        document.getAnonymousElementByAttribute(this, "anonid", "prePath");
      </field>
      <field name="protocolNode">
        document.getAnonymousElementByAttribute(this, "anonid", "protocol");
      </field>
      <field name="subDomainNode">
        document.getAnonymousElementByAttribute(this, "anonid", "subdomain");
      </field>
      <field name="domainNode">
        document.getAnonymousElementByAttribute(this, "anonid", "domain");
      </field>
      <field name="portNode">
        document.getAnonymousElementByAttribute(this, "anonid", "port");
      </field>
      <field name="pathFileNode">
        document.getAnonymousElementByAttribute(this, "anonid", "pathFile");
      </field>
      <field name="fileNode">
        document.getAnonymousElementByAttribute(this, "anonid", "file");
      </field>
      <field name="queryNode">
        document.getAnonymousElementByAttribute(this, "anonid", "query");
      </field>
      <field name="fragmentNode">
        document.getAnonymousElementByAttribute(this, "anonid", "fragment");
      </field>
      <field name="urlTooltip">
        document.getElementById("urlTooltip");
      </field>
      <field name="urlTooltipLabel">
        this.urlTooltip.getElementsByTagName("label")[0];
      </field>
      <field name="_tldService" readonly="true"><![CDATA[
        "nsIEffectiveTLDService" in Components.interfaces ?
        Components.classes["@mozilla.org/network/effective-tld-service;1"]
                  .getService(Components.interfaces.nsIEffectiveTLDService) : {
          initialize: function() {
            this.tlds = {};
            this.wildtlds = {};
            this.exceptions = {};
            var entries = ['ac','com.ac','edu.ac','gov.ac','net.ac','mil.ac','org.ac','ad','nom.ad','ae','net.ae','gov.ae','ac.ae','sch.ae','org.ae','mil.ae','pro.ae','name.ae','aero','accident-investigation.aero','accident-prevention.aero','aerobatic.aero','aeroclub.aero','aerodrome.aero','agents.aero','aircraft.aero','airline.aero','airport.aero','air-surveillance.aero','airtraffic.aero','air-traffic-control.aero','ambulance.aero','amusement.aero','association.aero','author.aero','ballooning.aero','broker.aero','caa.aero','cargo.aero','catering.aero','certification.aero','championship.aero','charter.aero','civilaviation.aero','club.aero','conference.aero','consultant.aero','consulting.aero','control.aero','council.aero','crew.aero','design.aero','dgca.aero','educator.aero','emergency.aero','engine.aero','engineer.aero','entertainment.aero','equipment.aero','exchange.aero','express.aero','federation.aero','flight.aero','freight.aero','fuel.aero','gliding.aero','government.aero','groundhandling.aero','group.aero','hanggliding.aero','homebuilt.aero','insurance.aero','journal.aero','journalist.aero','leasing.aero','logistics.aero','magazine.aero','maintenance.aero','marketplace.aero','media.aero','microlight.aero','modelling.aero','navigation.aero','parachuting.aero','paragliding.aero','passenger-association.aero','pilot.aero','press.aero','production.aero','recreation.aero','repbody.aero','res.aero','research.aero','rotorcraft.aero','safety.aero','scientist.aero','services.aero','show.aero','skydiving.aero','software.aero','student.aero','taxi.aero','trader.aero','trading.aero','trainer.aero','union.aero','workinggroup.aero','works.aero','af','gov.af','com.af','org.af','net.af','edu.af','ag','com.ag','org.ag','net.ag','co.ag','nom.ag','ai','off.ai','com.ai','net.ai','org.ai','gov.al','edu.al','org.al','com.al','net.al','am','an','com.an','net.an','org.an','edu.an','ao','aq','*.ar','!congresodelalengua3.ar','!educ.ar','!gobiernoelectronico.ar','!mecon.ar','!nacion.ar','!nic.ar','!promocion.ar','!retina.ar','!uba.ar','e164.arpa','in-addr.arpa','ip6.arpa','uri.arpa','urn.arpa','as','at','gv.at','ac.at','co.at','or.at','*.au','act.edu.au','nsw.edu.au','nt.edu.au','qld.edu.au','sa.edu.au','tas.edu.au','vic.edu.au','wa.edu.au','act.gov.au','nsw.gov.au','nt.gov.au','qld.gov.au','sa.gov.au','tas.gov.au','vic.gov.au','wa.gov.au','aw','com.aw','ax','az','com.az','net.az','int.az','gov.az','org.az','edu.az','info.az','pp.az','mil.az','name.az','biz.az','ba','org.ba','net.ba','edu.ba','gov.ba','mil.ba','unsa.ba','unbi.ba','co.ba','com.ba','rs.ba','bb','com.bb','edu.bb','gov.bb','net.bb','org.bb','*.bd','be','ac.be','bf','bg','bh','bi','biz','bj','bm','com.bm','edu.bm','gov.bm','net.bm','org.bm','*.bn','bo','com.bo','edu.bo','gov.bo','gob.bo','int.bo','org.bo','net.bo','mil.bo','tv.bo','*.br','bs','com.bs','net.bs','org.bs','edu.bs','gov.bs','*.bt','bw','by','bz','ca','ab.ca','bc.ca','mb.ca','nb.ca','nf.ca','nl.ca','ns.ca','nt.ca','nu.ca','on.ca','pe.ca','qc.ca','sk.ca','yk.ca','cat','cc','cd','cf','cg','ch','ci','*.ck','cl','cm','cn','ac.cn','com.cn','edu.cn','gov.cn','net.cn','org.cn','ah.cn','bj.cn','cq.cn','fj.cn','gd.cn','gs.cn','gz.cn','gx.cn','ha.cn','hb.cn','he.cn','hi.cn','hl.cn','hn.cn','jl.cn','js.cn','jx.cn','ln.cn','nm.cn','nx.cn','qh.cn','sc.cn','sd.cn','sh.cn','sn.cn','sx.cn','tj.cn','xj.cn','xz.cn','yn.cn','zj.cn','*.co','com','coop','*.cr','cu','com.cu','edu.cu','org.cu','net.cu','gov.cu','inf.cu','cv','cx','*.cy','cz','de','dj','dk','dm','com.dm','net.dm','org.dm','*.do','dz','com.dz','org.dz','net.dz','gov.dz','edu.dz','asso.dz','pol.dz','art.dz','ec','com.ec','info.ec','net.ec','fin.ec','med.ec','pro.ec','org.ec','edu.ec','gov.ec','mil.ec','edu','ee','com.ee','org.ee','fie.ee','pri.ee','*.eg','*.er','es','com.es','nom.es','org.es','gob.es','edu.es','*.et','eu','fi','*.fj','*.fk','fm','fo','fr','fr','com.fr','asso.fr','nom.fr','prd.fr','presse.fr','tm.fr','aeroport.fr','assedic.fr','avocat.fr','avoues.fr','cci.fr','chambagri.fr','chirurgiens-dentistes.fr','experts-comptables.fr','geometre-expert.fr','gouv.fr','greta.fr','huissier-justice.fr','medecin.fr','notaires.fr','pharmacien.fr','port.fr','veterinaire.fr','ga','gd','ge','com.ge','edu.ge','gov.ge','org.ge','mil.ge','net.ge','pvt.ge','gf','gg','co.gg','org.gg','net.gg','sch.gg','gov.gg','*.gh','gi','com.gi','ltd.gi','gov.gi','mod.gi','edu.gi','org.gi','gl','gm','*.gn','gov','gp','com.gp','net.gp','edu.gp','org.gp','gq','gr','com.gr','edu.gr','net.gr','org.gr','gov.gr','gs','*.gt','*.gu','gw','gy','hk','com.hk','edu.hk','gov.hk','idv.hk','net.hk','org.hk','hm','hn','com.hn','edu.hn','org.hn','net.hn','mil.hn','gob.hn','hr','iz.hr','from.hr','name.hr','com.hr','ht','com.ht','shop.ht','firm.ht','info.ht','adult.ht','net.ht','pro.ht','org.ht','med.ht','art.ht','coop.ht','pol.ht','asso.ht','edu.ht','rel.ht','gouv.ht','perso.ht','hu','co.hu','info.hu','org.hu','priv.hu','sport.hu','tm.hu','2000.hu','agrar.hu','bolt.hu','casino.hu','city.hu','erotica.hu','erotika.hu','film.hu','forum.hu','games.hu','hotel.hu','ingatlan.hu','jogasz.hu','konyvelo.hu','lakas.hu','media.hu','news.hu','reklam.hu','sex.hu','shop.hu','suli.hu','szex.hu','tozsde.hu','utazas.hu','video.hu','*.id','ie','*.il','im','co.im','ltd.co.im','plc.co.im','net.im','gov.im','org.im','nic.im','ac.im','in','co.in','firm.in','net.in','org.in','gen.in','ind.in','nic.in','ac.in','edu.in','res.in','gov.in','mil.in','info','int','io','iq','gov.iq','edu.iq','ir','ac.ir','co.ir','gov.ir','id.ir','net.ir','org.ir','sch.ir','is','net.is','com.is','edu.is','gov.is','org.is','int.is','it','gov.edu','Agrigento.it','AG.it','Alessandria.it','AL.it','Ancona.it','AN.it','Aosta.it','Aoste.it','AO.it','Arezzo.it','AR.it','Ascoli-Piceno.it','AscoliPiceno.it','AP.it','Asti.it','AT.it','Avellino.it','AV.it','Bari.it','BA.it','BarlettaAndriaTrani.it','Barletta-Andria-Trani.it','Belluno.it','BL.it','Benevento.it','BN.it','Bergamo.it','BG.it','Biella.it','BI.it','Bologna.it','BO.it','Bolzano.it','Bozen.it','Balsan.it','Alto-Adige.it','AltoAdige.it','Suedtirol.it','BZ.it','Brescia.it','BS.it','Brindisi.it','BR.it','Cagliari.it','CA.it','Caltanissetta.it','CL.it','Campobasso.it','CB.it','Caserta.it','CE.it','Catania.it','CT.it','Catanzaro.it','CZ.it','Chieti.it','CH.it','Como.it','CO.it','Cosenza.it','CS.it','Cremona.it','CR.it','Crotone.it','KR.it','Cuneo.it','CN.it','Enna.it','EN.it','Fermo.it','Ferrara.it','FE.it','Firenze.it','Florence.it','FI.it','Foggia.it','FG.it','Forli-Cesena.it','ForliCesena.it','FC.it','Frosinone.it','FR.it','Genova.it','Genoa.it','GE.it','Gorizia.it','GO.it','Grosseto.it','GR.it','Imperia.it','IM.it','Isernia.it','IS.it','LAquila.it','Aquila.it','AQ.it','La-Spezia.it','LaSpezia.it','SP.it','Latina.it','LT.it','Lecce.it','LE.it','Lecco.it','LC.it','Livorno.it','LI.it','Lodi.it','LO.it','Lucca.it','LU.it','Macerata.it','MC.it','Mantova.it','MN.it','Massa-Carrara.it','MassaCarrara.it','MS.it','Matera.it','MT.it','Messina.it','ME.it','Milano.it','Milan.it','MI.it','Modena.it','MO.it','Monza.it','Napoli.it','Naples.it','NA.it','Novara.it','NO.it','Nuoro.it','NU.it','Oristano.it','OR.it','Padova.it','Padua.it','PD.it','Palermo.it','PA.it','Parma.it','PR.it','Pavia.it','PV.it','Perugia.it','PG.it','Pescara.it','PE.it','Pesaro-Urbino.it','PesaroUrbino.it','PU.it','Piacenza.it','PC.it','Pisa.it','PI.it','Pistoia.it','PT.it','Pordenone.it','PN.it','Potenza.it','PZ.it','Prato.it','PO.it','Ragusa.it','RG.it','Ravenna.it','RA.it','Reggio-Calabria.it','ReggioCalabria.it','RC.it','Reggio-Emilia.it','ReggioEmilia.it','RE.it','Rieti.it','RI.it','Rimini.it','RN.it','Roma.it','Rome.it','RM.it','Rovigo.it','RO.it','Salerno.it','SA.it','Sassari.it','SS.it','Savona.it','SV.it','Siena.it','SI.it','Siracusa.it','SR.it','Sondrio.it','SO.it','Taranto.it','TA.it','Teramo.it','TE.it','Terni.it','TR.it','Torino.it','Turin.it','TO.it','Trapani.it','TP.it','Trento.it','Trentino.it','TN.it','Treviso.it','TV.it','Trieste.it','TS.it','Udine.it','UD.it','Varese.it','VA.it','Venezia.it','Venice.it','VE.it','Verbania.it','VB.it','Vercelli.it','VC.it','Verona.it','VR.it','Vibo-Valentia.it','ViboValentia.it','VV.it','Vicenza.it','VI.it','Viterbo.it','VT.it','je','co.je','org.je','net.je','sch.je','gov.je','*.jm','jo','com.jo','org.jo','net.jo','edu.jo','gov.jo','mil.jo','myname.jo','jobs','jp','ac.jp','ad.jp','co.jp','ed.jp','go.jp','gr.jp','lg.jp','ne.jp','or.jp','*.aichi.jp','*.akita.jp','*.aomori.jp','*.chiba.jp','*.ehime.jp','*.fukui.jp','*.fukuoka.jp','*.fukushima.jp','*.gifu.jp','*.gunma.jp','*.hiroshima.jp','*.hokkaido.jp','*.hyogo.jp','*.ibaraki.jp','*.ishikawa.jp','*.iwate.jp','*.kagawa.jp','*.kagoshima.jp','*.kanagawa.jp','*.kawasaki.jp','*.kitakyushu.jp','*.kobe.jp','*.kochi.jp','*.kumamoto.jp','*.kyoto.jp','*.mie.jp','*.miyagi.jp','*.miyazaki.jp','*.nagano.jp','*.nagasaki.jp','*.nagoya.jp','*.nara.jp','*.niigata.jp','*.oita.jp','*.okayama.jp','*.okinawa.jp','*.osaka.jp','*.saga.jp','*.saitama.jp','*.sapporo.jp','*.sendai.jp','*.shiga.jp','*.shimane.jp','*.shizuoka.jp','*.tochigi.jp','*.tokushima.jp','*.tokyo.jp','*.tottori.jp','*.toyama.jp','*.wakayama.jp','*.yamagata.jp','*.yamaguchi.jp','*.yamanashi.jp','*.yokohama.jp','!metro.tokyo.jp','!pref.aichi.jp','!pref.akita.jp','!pref.aomori.jp','!pref.chiba.jp','!pref.ehime.jp','!pref.fukui.jp','!pref.fukuoka.jp','!pref.fukushima.jp','!pref.gifu.jp','!pref.gunma.jp','!pref.hiroshima.jp','!pref.hokkaido.jp','!pref.hyogo.jp','!pref.ibaraki.jp','!pref.ishikawa.jp','!pref.iwate.jp','!pref.kagawa.jp','!pref.kagoshima.jp','!pref.kanagawa.jp','!pref.kochi.jp','!pref.kumamoto.jp','!pref.kyoto.jp','!pref.mie.jp','!pref.miyagi.jp','!pref.miyazaki.jp','!pref.nagano.jp','!pref.nagasaki.jp','!pref.nara.jp','!pref.niigata.jp','!pref.oita.jp','!pref.okayama.jp','!pref.okinawa.jp','!pref.osaka.jp','!pref.saga.jp','!pref.saitama.jp','!pref.shiga.jp','!pref.shimane.jp','!pref.shizuoka.jp','!pref.tochigi.jp','!pref.tokushima.jp','!pref.tottori.jp','!pref.toyama.jp','!pref.wakayama.jp','!pref.yamagata.jp','!pref.yamaguchi.jp','!pref.yamanashi.jp','!city.chiba.jp','!city.fukuoka.jp','!city.hiroshima.jp','!city.kawasaki.jp','!city.kitakyushu.jp','!city.kobe.jp','!city.kyoto.jp','!city.nagoya.jp','!city.osaka.jp','!city.saitama.jp','!city.sapporo.jp','!city.sendai.jp','!city.shizuoka.jp','!city.yokohama.jp','*.ke','kg','org.kg','net.kg','com.kg','edu.kg','gov.kg','mil.kg','*.kh','ki','edu.ki','biz.ki','net.ki','org.ki','gov.ki','info.ki','com.ki','km','kn','kr','ac.kr','co.kr','go.kr','ne.kr','or.kr','re.kr','pe.kr','한글.kr','*.kw','ky','edu.ky','gov.ky','com.ky','org.ky','net.ky','kz','org.kz','edu.kz','net.kz','gov.kz','mil.kz','com.kz','la','*.lb','lc','com.lc','org.lc','edu.lc','gov.lc','li','lk','gov.lk','sch.lk','net.lk','int.lk','com.lk','org.lk','edu.lk','ngo.lk','soc.lk','web.lk','ltd.lk','assn.lk','grp.lk','hotel.lk','*.lr','ls','co.ls','org.ls','lt','lu','lv','com.lv','edu.lv','gov.lv','org.lv','mil.lv','id.lv','net.lv','asn.lv','conf.lv','ly','com.ly','net.ly','gov.ly','plc.ly','edu.ly','sch.ly','med.ly','org.ly','id.ly','ma','co.ma','net.ma','gov.ma','org.ma','mc','tm.mc','asso.mc','md','mg','org.mg','nom.mg','gov.mg','prd.mg','tm.mg','edu.mg','mil.mg','com.mg','mh','mil','mk','com.mk','gov.mk','org.mk','net.mk','edu.mk','*.ml','*.mm','mn','gov.mn','edu.mn','org.mn','mo','com.mo','net.mo','org.mo','edu.mo','gov.mo','mobi','mp','mq','mr','ms','*.mt','mu','museum','*.mv','mw','ac.mw','biz.mw','co.mw','com.mw','coop.mw','edu.mw','gov.mw','int.mw','net.mw','org.mw','*.mx','*.my','*.mz','na','name','nc','ne','net','nf','com.nf','net.nf','per.nf','rec.nf','web.nf','arts.nf','firm.nf','info.nf','other.nf','store.nf','ng','*.ni','nl','no','fhs.no','vgs.no','fylkesbibl.no','folkebibl.no','museum.no','idrett.no','mil.no','stat.no','dep.no','kommune.no','herad.no','priv.no','aa.no','ah.no','bu.no','fm.no','hl.no','hm.no','jan-mayen.no','mr.no','nl.no','nt.no','of.no','ol.no','oslo.no','rl.no','sf.no','st.no','svalbard.no','tm.no','tr.no','va.no','vf.no','gs.aa.no','gs.ah.no','gs.bu.no','gs.fm.no','gs.hl.no','gs.hm.no','gs.jan-mayen.no','gs.mr.no','gs.nl.no','gs.nt.no','gs.of.no','gs.ol.no','gs.oslo.no','gs.rl.no','gs.sf.no','gs.st.no','gs.svalbard.no','gs.tm.no','gs.tr.no','gs.va.no','gs.vf.no','akrehamn.no','åkrehamn.no','algard.no','ålgård.no','arna.no','brumunddal.no','bryne.no','bronnoysund.no','brønnøysund.no','drobak.no','drøbak.no','egersund.no','fetsund.no','floro.no','florø.no','fredrikstad.no','hokksund.no','honefoss.no','hønefoss.no','jessheim.no','jorpeland.no','jørpeland.no','kirkenes.no','kopervik.no','krokstadelva.no','langevag.no','langevåg.no','leirvik.no','mjondalen.no','mjøndalen.no','mo-i-rana.no','mosjoen.no','mosjøen.no','nesoddtangen.no','orkanger.no','osoyro.no','osøyro.no','raholt.no','råholt.no','sandnessjoen.no','sandnessjøen.no','skedsmokorset.no','slattum.no','spjelkavik.no','stathelle.no','stavern.no','stjordalshalsen.no','stjørdalshalsen.no','tananger.no','tranby.no','vossevangen.no','afjord.no','åfjord.no','agdenes.no','al.no','ål.no','alesund.no','ålesund.no','alstahaug.no','alta.no','áltá.no','alaheadju.no','álaheadju.no','alvdal.no','amli.no','åmli.no','amot.no','åmot.no','andebu.no','andoy.no','andøy.no','andasuolo.no','ardal.no','årdal.no','aremark.no','arendal.no','ås.no','aseral.no','åseral.no','asker.no','askim.no','askvoll.no','askoy.no','askøy.no','asnes.no','åsnes.no','audnedaln.no','aukra.no','aure.no','aurland.no','aurskog-holand.no','aurskog-høland.no','austevoll.no','austrheim.no','averoy.no','averøy.no','balestrand.no','ballangen.no','balat.no','bálát.no','balsfjord.no','bahccavuotna.no','báhccavuotna.no','bamble.no','bardu.no','beardu.no','beiarn.no','bajddar.no','bájddar.no','baidar.no','báidár.no','berg.no','bergen.no','berlevag.no','berlevåg.no','bearalvahki.no','bearalváhki.no','bindal.no','birkenes.no','bjarkoy.no','bjarkøy.no','bjerkreim.no','bjugn.no','bodo.no','bodø.no','badaddja.no','bådåddjå.no','budejju.no','bokn.no','bremanger.no','bronnoy.no','brønnøy.no','bygland.no','bykle.no','barum.no','bærum.no','bo.telemark.no','bø.telemark.no','bo.nordland.no','bø.nordland.no','bievat.no','bievát.no','bomlo.no','bømlo.no','batsfjord.no','båtsfjord.no','bahcavuotna.no','báhcavuotna.no','dovre.no','drammen.no','drangedal.no','dyroy.no','dyrøy.no','donna.no','dønna.no','eid.no','eidfjord.no','eidsberg.no','eidskog.no','eidsvoll.no','eigersund.no','elverum.no','enebakk.no','engerdal.no','etne.no','etnedal.no','evenes.no','evenassi.no','evenášši.no','evje-og-hornnes.no','farsund.no','fauske.no','fuossko.no','fuoisku.no','fedje.no','fet.no','finnoy.no','finnøy.no','fitjar.no','fjaler.no','fjell.no','flakstad.no','flatanger.no','flekkefjord.no','flesberg.no','flora.no','fla.no','flå.no','folldal.no','forsand.no','fosnes.no','fredrikstad.no','frei.no','frogn.no','froland.no','frosta.no','frana.no','fræna.no','froya.no','frøya.no','fusa.no','fyresdal.no','forde.no','førde.no','gamvik.no','gangaviika.no','gáŋgaviika','gaular.no','gausdal.no','gildeskal.no','gildeskål.no','giske.no','gjemnes.no','gjerdrum.no','gjerstad.no','gjesdal.no','gjovik.no','gjøvik.no','gloppen.no','gol.no','gran.no','grane.no','granvin.no','gratangen.no','grimstad.no','grong.no','kraanghke.no','kråanghke.no','grue.no','gulen.no','hadsel.no','halden.no','halsa.no','hamar.no','hamaroy.no','habmer.no','hábmer.no','hapmir.no','hápmir.no','hammerfest.no','hammarfeasta.no','hámmárfeasta.no','haram.no','hareid.no','harstad.no','hasvik.no','aknoluokta.no','ákŋoluokta.no','hattfjelldal.no','aarborte.no','haugesund.no','hemne.no','hemnes.no','hemsedal.no','heroy.more-og-romsdal.no','herøy.møre-og-romsdal.no','heroy.nordland.no','herøy.nordland.no','hitra.no','hjartdal.no','hjelmeland.no','hobol.no','hobøl.no','hof.no','hol.no','hole.no','holmestrand.no','holtalen.no','holtålen.no','hornindal.no','horten.no','hurdal.no','hurum.no','hvaler.no','hyllestad.no','hagebostad.no','hægebostad.no','hoyanger.no','høyanger.no','hoylandet.no','høylandet.no','ha.no','hå.no','ibestad.no','inderoy.no','inderøy.no','iveland.no','jevnaker.no','jondal.no','jolster.no','jølster.no','karasjok.no','karasjohka.no','kárášjohka.no','karlsoy.no','galsa.no','gálsá.no','karmoy.no','karmøy.no','kautokeino.no','guovdageaidnu.no','klepp.no','klabu.no','klæbu.no','kongsberg.no','kongsvinger.no','kragero.no','kragerø.no','kristiansand.no','kristiansund.no','krodsherad.no','krødsherad.no','kvalsund.no','rahkkeravju.no','ráhkkerávju.no','kvam.no','kvinesdal.no','kvinnherad.no','kviteseid.no','kvitsoy.no','kvitsøy.no','kvafjord.no','kvæfjord.no','giehtavuoatna.no','kvanangen.no','kvænangen.no','navuotna.no','návuotna.no','kafjord.no','kåfjord.no','gaivuotna.no','gáivuotna.no','larvik.no','lavangen.no','lavagis.no','loabat.no','loabát.no','lebesby.no','davvesiida.no','leikanger.no','leirfjord.no','leka.no','leksvik.no','lenvik.no','leangaviika.no','lea?gaviika.no','lesja.no','levanger.no','lier.no','lierne.no','lillehammer.no','lillesand.no','lindesnes.no','lindas.no','lindås.no','lom.no','loppa.no','lahppi.no','láhppi.no','lund.no','lunner.no','luroy.no','lurøy.no','luster.no','lyngdal.no','lyngen.no','ivgu.no','lardal.no','Lærdal','lerdal.no','lærdal.no','lodingen.no','lødingen.no','lorenskog.no','lørenskog.no','loten.no','løten.no','malvik.no','masoy.no','måsøy.no','muosat.no','muosát.no','mandal.no','marker.no','marnardal.no','masfjorden.no','meland.no','meldal.no','melhus.no','meloy.no','meløy.no','meraker.no','meråker.no','moareke.no','moåreke.no','midsund.no','midtre-gauldal.no','modalen.no','modum.no','molde.no','moskenes.no','moss.no','mosvik.no','malselv.no','målselv.no','malatvuopmi.no','málatvuopmi.no','namdalseid.no','aejrie.no','namsos.no','namsskogan.no','naamesjevuemie.no','nååmesjevuemie.no','laakesvuemie.no','nannestad.no','narvik.no','narviika.no','naustdal.no','nedre-eiker.no','nes.akershus.no','nes.buskerud.no','nesna.no','nesodden.no','nesseby.no','unjarga.no','unjárga.no','nesset.no','nissedal.no','nittedal.no','nord-aurdal.no','nord-fron.no','nord-odal.no','norddal.no','nordkapp.no','davvenjarga.no','davvenjárga.no','nordre-land.no','nordreisa.no','raisa.no','ráisa.no','nore-og-uvdal.no','notodden.no','naroy.no','nærøy.no','notteroy.no','nøtterøy.no','odda.no','oksnes.no','`øksnes.no','oppdal.no','oppegard.no','oppegård.no','orkdal.no','orland.no','ørland.no','orskog.no','ørskog.no','orsta.no','ørsta.no','os.hedmark.no','os.hordaland.no','osen.no','osteroy.no','osterøy.no','ostre-toten.no','østre-toten.no','overhalla.no','ovre-eiker.no','øvre-eiker.no','oyer.no','øyer.no','oygarden.no','øygarden.no','oystre-slidre.no','øystre-slidre.no','porsanger.no','porsangu.no','porsáŋgu.no','porsgrunn.no','radoy.no','radøy.no','rakkestad.no','rana.no','ruovat.no','randaberg.no','rauma.no','rendalen.no','rennebu.no','rennesoy.no','rennesøy.no','rindal.no','ringebu.no','ringerike.no','ringsaker.no','rissa.no','risor.no','risør.no','roan.no','rollag.no','rygge.no','ralingen.no','rælingen.no','rodoy.no','rødøy.no','romskog.no','rømskog.no','roros.no','røros.no','rost.no','røst.no','royken.no','røyken.no','royrvik.no','røyrvik.no','rade.no','råde.no','salangen.no','siellak.no','saltdal.no','sálát.no','sálat.no','samnanger.no','sande.more-og-romsdal.no','sande.møre-og-romsdal.no','sande.vestfold.no','sandefjord.no','sandnes.no','sandoy.no','sandøy.no','sarpsborg.no','sauda.no','sauherad.no','sel.no','selbu.no','selje.no','seljord.no','sigdal.no','siljan.no','sirdal.no','skaun.no','skedsmo.no','ski.no','skien.no','skiptvet.no','skjervoy.no','skjervøy.no','skierva.no','skiervá.no','skjak.no','skjåk.no','skodje.no','skanland.no','skånland.no','skanit.no','skánit.no','smola.no','smøla.no','snillfjord.no','snasa.no','snåsa.no','snoasa.no','snaase.no','snåase.no','sogndal.no','sokndal.no','sola.no','solund.no','songdalen.no','sortland.no','spydeberg.no','stange.no','stavanger.no','steigen.no','steinkjer.no','stjordal.no','stjørdal.no','stokke.no','stor-elvdal.no','stord.no','stordal.no','storfjord.no','omasvuotna.no','strand.no','stranda.no','stryn.no','sula.no','suldal.no','sund.no','sunndal.no','surnadal.no','sveio.no','svelvik.no','sykkylven.no','sogne.no','søgne.no','somna.no','sømna.no','sondre-land.no','søndre-land.no','sor-aurdal.no','sør-aurdal.no','sor-fron.no','sør-fron.no','sor-odal.no','sør-odal.no','sor-varanger.no','sør-varanger.no','matta-varjjat.no','mátta-várjjat.no','sorfold.no','sørfold.no','sorreisa.no','sørreisa.no','sorum.no','sørum.no','tana.no','deatnu.no','time.no','tingvoll.no','tinn.no','tjeldsund.no','dielddanuorri.no','tjome.no','tjøme.no','tokke.no','tolga.no','torsken.no','tranoy.no','tranøy.no','tromso.no','tromsø.no','tromsa.no','romsa.no','trondheim.no','troandin.no','trysil.no','trana.no','træna.no','trogstad.no','trøgstad.no','tvedestrand.no','tydal.no','tynset.no','tysfjord.no','divtasvuodna.no','divttasvuotna.no','tysnes.no','tysvar.no','tysvær.no','tonsberg.no','tønsberg.no','ullensaker.no','ullensvang.no','ulvik.no','utsira.no','vadso.no','vadsø.no','cahcesuolo.no','cáhcesuolo.no','vaksdal.no','valle.no','vang.no','vanylven.no','vardo.no','vardø.no','varggat.no','várggát.no','vefsn.no','vaapste.no','vega.no','vegarshei.no','vegårshei.no','vennesla.no','verdal.no','verran.no','vestby.no','vestnes.no','vestre-slidre.no','vestre-toten.no','vestvagoy.no','vestvågøy.no','vevelstad.no','vik.no','vikna.no','vindafjord.no','volda.no','voss.no','varoy.no','værøy.no','vagan.no','vågan.no','voagat.no','vagsoy.no','vågsøy.no','vaga.no','vågå.no','valer.ostfold.no','våler.østfold.no','valer.hedmark.no','våler.hedmark.no','*.np','nr','biz.nr','info.nr','gov.nr','edu.nr','org.nr','net.nr','com.nr','nu','*.nz','*.om','org','*.pa','*.pe','pf','com.pf','org.pf','edu.pf','*.pg','ph','com.ph','net.ph','org.ph','gov.ph','edu.ph','ngo.ph','mil.ph','pk','com.pk','net.pk','edu.pk','org.pk','fam.pk','biz.pk','web.pk','gov.pk','gob.pk','gok.pk','gon.pk','gop.pk','gos.pk','goa.pk','info.pk','pl','aid.pl','agro.pl','atm.pl','auto.pl','biz.pl','com.pl','edu.pl','gmina.pl','gsm.pl','info.pl','mail.pl','miasta.pl','media.pl','mil.pl','net.pl','nieruchomosci.pl','nom.pl','org.pl','pc.pl','powiat.pl','priv.pl','realestate.pl','rel.pl','sex.pl','shop.pl','sklep.pl','sos.pl','szkola.pl','targi.pl','tm.pl','tourism.pl','travel.pl','turystyka.pl','6bone.pl','art.pl','mbone.pl','gov.pl','uw.gov.pl','um.gov.pl','ug.gov.pl','upow.gov.pl','starostwo.gov.pl','so.gov.pl','sr.gov.pl','po.gov.pl','pa.gov.pl','med.pl','ngo.pl','irc.pl','usenet.pl','augustow.pl','babia-gora.pl','bedzin.pl','beskidy.pl','bialowieza.pl','bialystok.pl','bielawa.pl','bieszczady.pl','boleslawiec.pl','bydgoszcz.pl','bytom.pl','cieszyn.pl','czeladz.pl','czest.pl','dlugoleka.pl','elblag.pl','elk.pl','glogow.pl','gniezno.pl','gorlice.pl','grajewo.pl','ilawa.pl','jaworzno.pl','jelenia-gora.pl','jgora.pl','kalisz.pl','kazimierz-dolny.pl','karpacz.pl','kartuzy.pl','kaszuby.pl','katowice.pl','kepno.pl','ketrzyn.pl','klodzko.pl','kobierzyce.pl','kolobrzeg.pl','konin.pl','konskowola.pl','kutno.pl','lapy.pl','lebork.pl','legnica.pl','lezajsk.pl','limanowa.pl','lomza.pl','lowicz.pl','lubin.pl','lukow.pl','malbork.pl','malopolska.pl','mazowsze.pl','mazury.pl','mielec.pl','mielno.pl','mragowo.pl','naklo.pl','nowaruda.pl','nysa.pl','olawa.pl','olecko.pl','olkusz.pl','olsztyn.pl','opoczno.pl','opole.pl','ostroda.pl','ostroleka.pl','ostrowiec.pl','ostrowwlkp.pl','pila.pl','pisz.pl','podhale.pl','podlasie.pl','polkowice.pl','pomorze.pl','pomorskie.pl','prochowice.pl','pruszkow.pl','przeworsk.pl','pulawy.pl','radom.pl','rawa-maz.pl','rybnik.pl','rzeszow.pl','sanok.pl','sejny.pl','slask.pl','slupsk.pl','sosnowiec.pl','stalowa-wola.pl','skoczow.pl','starachowice.pl','stargard.pl','suwalki.pl','swidnica.pl','swiebodzin.pl','swinoujscie.pl','szczecin.pl','szczytno.pl','tarnobrzeg.pl','tgory.pl','turek.pl','tychy.pl','ustka.pl','walbrzych.pl','warmia.pl','warszawa.pl','waw.pl','wegrow.pl','wielun.pl','wlocl.pl','wloclawek.pl','wodzislaw.pl','wolomin.pl','wroclaw.pl','zachpomor.pl','zagan.pl','zarow.pl','zgora.pl','zgorzelec.pl','gda.pl','gdansk.pl','gdynia.pl','sopot.pl','gliwice.pl','krakow.pl','poznan.pl','wroc.pl','zakopane.pl','pn','gov.pn','co.pn','org.pn','edu.pn','net.pn','pr','com.pr','net.pr','org.pr','gov.pr','edu.pr','isla.pr','pro.pr','biz.pr','info.pr','name.pr','est.pr','prof.pr','ac.pr','pro','aca.pro','bar.pro','cpa.pro','jur.pro','law.pro','med.pro','eng.pro','ps','edu.ps','gov.ps','sec.ps','plo.ps','com.ps','org.ps','net.ps','pt','net.pt','gov.pt','org.pt','edu.pt','int.pt','publ.pt','com.pt','nome.pt','*.pw','*.py','*.qa','re','com.re','asso.re','nom.re','ro','com.ro','org.ro','tm.ro','nt.ro','nom.ro','info.ro','rec.ro','arts.ro','firm.ro','store.ro','www.ro','ru','com.ru','net.ru','org.ru','pp.ru','int.ru','rw','gov.rw','net.rw','edu.rw','ac.rw','com.rw','co.rw','int.rw','mil.rw','gouv.rw','*.sa','*.sb','sc','com.sc','gov.sc','net.sc','org.sc','edu.sc','sd','com.sd','net.sd','org.sd','edu.sd','med.sd','tv.sd','gov.sd','info.sd','se','org.se','pp.se','tm.se','parti.se','press.se','mil.se','ab.se','c.se','d.se','e.se','f.se','g.se','h.se','i.se','k.se','m.se','n.se','o.se','s.se','t.se','u.se','w.se','x.se','y.se','z.se','ac.se','bd.se','sg','com.sg','net.sg','org.sg','gov.sg','edu.sg','per.sg','sh','si','sk','sl','sm','sn','sr','st','su','*.sv','*.sy','sz','tc','td','tf','tg','*.th','tj','ac.tj','biz.tj','com.tj','co.tj','edu.tj','int.tj','name.tj','net.tj','org.tj','web.tj','gov.tj','go.tj','mil.tj','tk','tl','tm','tn','to','*.tr','travel','tt','co.tt','com.tt','org.tt','net.tt','biz.tt','info.tt','pro.tt','int.tt','coop.tt','jobs.tt','mobi.tt','travel.tt','museum.tt','aero.tt','name.tt','gov.tt','edu.tt','tv','tw','edu.tw','gov.tw','mil.tw','com.tw','net.tw','org.tw','idv.tw','game.tw','ebiz.tw','club.tw','網路.tw','組織.tw','商業.tw','*.tz','ua','com.ua','edu.ua','gov.ua','net.ua','org.ua','cherkassy.ua','chernigov.ua','chernovtsy.ua','ck.ua','cn.ua','crimea.ua','cv.ua','dn.ua','dnepropetrovsk.ua','donetsk.ua','dp.ua','if.ua','ivano-frankivsk.ua','kh.ua','kharkov.ua','kherson.ua','kiev.ua','kirovograd.ua','km.ua','kr.ua','ks.ua','lg.ua','lugansk.ua','lutsk.ua','lviv.ua','mk.ua','nikolaev.ua','od.ua','odessa.ua','pl.ua','poltava.ua','rovno.ua','rv.ua','sebastopol.ua','sumy.ua','te.ua','ternopil.ua','vinnica.ua','vn.ua','zaporizhzhe.ua','zp.ua','uz.ua','uzhgorod.ua','zhitomir.ua','zt.ua','ug','co.ug','ac.ug','sc.ug','go.ug','ne.ug','or.ug','*.uk','*.sch.uk','!bl.uk','!british-library.uk','!icnet.uk','!jet.uk','!nel.uk','!nls.uk','!national-library-scotland.uk','!parliament.uk','us','dni.us','fed.us','isa.us','kids.us','nsn.us','ak.us','al.us','ar.us','az.us','ca.us','co.us','ct.us','dc.us','de.us','fl.us','ga.us','hi.us','ia.us','id.us','il.us','in.us','ks.us','ky.us','la.us','ma.us','md.us','me.us','mi.us','mn.us','mo.us','ms.us','mt.us','nc.us','nd.us','ne.us','nh.us','nj.us','nm.us','nv.us','ny.us','oh.us','ok.us','or.us','pa.us','ri.us','sc.us','sd.us','tn.us','tx.us','ut.us','vt.us','va.us','wa.us','wi.us','wv.us','wy.us','*.uy','uz','com.uz','co.uz','va','vc','*.ve','vg','vi','com.vi','org.vi','edu.vi','gov.vi','vn','com.vn','net.vn','org.vn','edu.vn','gov.vn','int.vn','ac.vn','biz.vn','info.vn','name.vn','pro.vn','health.vn','vu','ws','*.ye','*.yu','*.za','*.zm','*.zw'];
            for (var i = 0; i < entries.length; i++) {
              if (entries[i][0] == '!') {
                this.exceptions[entries[i].substring(1)] = 1;
              } else if (entries[i].substring(0, 2) == '*.') {
                this.wildtlds[entries[i].substring(2)] = 1;
              } else {
                this.tlds[entries[i]] = 1;
              }
            }
          },
          getEffectiveTLDLength: function(hostname) {
            if (!this.tlds)
              this.initialize();
            while (hostname.indexOf('.') >= 0) {
              if (hostname in this.tlds)
                return hostname.length;
              var parent = hostname.substring(hostname.indexOf('.') + 1);
              if (parent in this.wildtlds && !(hostname in this.exceptions)) 
                return hostname.length;
              hostname = parent;
            }
            return hostname.length;
          }
        };
      ]]></field>
      <field name="_ioService" readonly="true">
        Components.classes["@mozilla.org/network/io-service;1"]
                  .getService(Components.interfaces.nsIIOService);
      </field>
      <field name="_prefs" readonly="true">
        Components.classes["@mozilla.org/preferences-service;1"]
                  .getService(Components.interfaces.nsIPrefService)
                  .getBranch("browser.urlbar.")
                  .QueryInterface(Components.interfaces.nsIPrefBranch2);
      </field>
      <field name="dndObserver" readonly="true"><![CDATA[({
        self: this,
        onDragOver: function(aEvent, aFlavour, aDragSession) {
          return true;
        },
        onDragExit: function (aEvent, aDragSession) {},
        onDrop: function (aEvent, aXferData, aDragSession) {
          var xferData = aXferData.data.split("\n");
          var draggedText = xferData[0] || xferData[1];
          var postData = {};
          var url = getShortcutOrURI(draggedText, postData);
          try {
            getBrowser().dragDropSecurityCheck(aEvent, aDragSession, url);

            const nsIScriptSecMan = Components.interfaces.nsIScriptSecurityManager;
            urlSecurityCheck(url, gBrowser.currentURI.spec,
                             nsIScriptSecMan.DISALLOW_INHERIT_PRINCIPAL);
            loadURI(url, null, postData.value, true);
          } catch (ex) {
            this.self.value = draggedText;
            this.self.focus();
          }
        },
        getSupportedFlavours: function () {
          var flavourSet = new FlavourSet();
          flavourSet.appendFlavour("text/unicode");
          flavourSet.appendFlavour("text/x-moz-url");
          flavourSet.appendFlavour("application/x-moz-file", "nsIFile");
          return flavourSet;
        }
      })]]></field>

      <field name="_plain">true</field>
      <property name="plain" onget="return this._plain">
        <setter><![CDATA[
          this._plain = val;
          while (this._blendingTimers.length)
            clearTimeout(this._blendingTimers.pop());
          if (val) {
            this.inputBox.style.removeProperty("opacity");
            this.presentationBox.hidden = true;
          } else
            this.inputBox.style.setProperty("opacity", "0", "important");
          this.presentationBox.style.removeProperty("opacity");
          this.hideURLTooltip();
          return val;
        ]]></setter>
      </property>

      <property name="contentIsCropped"
                onget="return !this.overflowEllipsis.hidden;"
                onset="this.overflowEllipsis.hidden = !val; return val;"/>

      <property name="value"
                onget="return this.inputField.value;">
        <setter><![CDATA[
          this.mIgnoreInput = true;
          this.inputField.value = val;
          this.mIgnoreInput = false;
          this._syncValue();
          if (this._focused)
            this.plain = true;
          else if (!this._mouseover || !this.plain)
            this.prettyView(false);
          var event = document.createEvent("Events");
          event.initEvent("ValueChange", true, true);
          this.inputField.dispatchEvent(event);
          return val;
        ]]></setter>
      </property>

      <method name="_decodeURI">
        <parameter name="uriString"/>
        <body><![CDATA[
          try {
            // try to decode as UTF-8
            return decodeURI(uriString);
          } catch(e) {
            return uriString;
          }
        ]]></body>
      </method>

      <method name="_syncValue">
        <body><![CDATA[
          if (this.value == "")
            this.uri = null;
          else try {
            var uri = this._ioService.newURI(this.value, null, null);
            this.uri = (typeof uri.host != "undefined") ? uri : null;
          } catch(e) {
            this.uri = null;
          }
          if (!this.uri) {
            this.removeAttribute("valid-uri");
            this.contentIsCropped = false;
            return;
          }

          this.setAttribute("valid-uri", "true");
          if (!this._focused)
            this.inputField.value = this._decodeURI (this.uri.spec);

          var presentation = this.presentation;
          var prePathNode = this.prePathNode;

          prePathNode.href =
            this.protocolNode.value = this.uri.scheme + "://";
          this.protocolHidden = this.hideProtocols.indexOf(this.uri.scheme) > -1;
          this.subDomainNode.value = "";
          this.portNode.value = "";

          var host = this.uri.host;
          if (host) {
            var asciiHost = this.uri.asciiHost;
            prePathNode.href += asciiHost;
            if (!/^[.0-9]+$/.test(host) /*XXX workaround for bug 364129 */) {
              var domainSegments = host.split(".");
              var cSubdomain = domainSegments.length -
                               asciiHost.slice(asciiHost.length -
                                               this._tldService.getEffectiveTLDLength(asciiHost))
                                        .split(".").length - 1;
              if (cSubdomain > 0) {
                host = domainSegments;
                var subdomain = [];
                while (cSubdomain--)
                  subdomain.push(host.shift());
                this.subDomainNode.value = subdomain.join(".") + ".";
                host = host.join(".");
              }
            }
            this.domainNode.value = host;
            if (this.uri.port > -1)
              prePathNode.href +=
                (this.portNode.value = ":" + this.uri.port);
          } else
            this.domainNode.value = "";
          prePathNode.href += "/";

          while (prePathNode.nextSibling != this.pathFileNode)
            presentation.removeChild (prePathNode.nextSibling);

          var pathSegments = this._decodeURI (this.uri.path.substring(1));

          var iFragment = pathSegments.indexOf("#");
          if (iFragment > -1) {
            this.fragmentNode.value = pathSegments.substring(iFragment);
            pathSegments = pathSegments.substring(0,iFragment);
          } else
            this.fragmentNode.value = "";

          var iQuery = pathSegments.indexOf("?");
          if (iQuery > -1) {
            this.queryNode.value = pathSegments.substring(iQuery);
            pathSegments = pathSegments.substring(0,iQuery);
          } else
            this.queryNode.value = "";

          pathSegments = pathSegments.split("/");
          this.fileNode.value = pathSegments.pop();

          var href = prePathNode.href;
          for (var i = 0; i < pathSegments.length; i++) {
            var node = this.pathSegmentProto.cloneNode(true);
            node.value = pathSegments[i];
            node.href = (href += pathSegments[i] + "/");
            presentation.insertBefore (node, this.pathFileNode);
          }
          this.pathFileNode.href = href + this.fileNode.value + this.queryNode.value + this.fragmentNode.value;
        ]]></body>
      </method>

      <method name="_prettyView">
        <body><![CDATA[
          this._plain = false;
          this.protocolNode.hidden = false;
          this.presentationBox.hidden = false;
          this.subDomainNode.style.removeProperty("-moz-margin-start");
          this.portNode.style.removeProperty("-moz-margin-end");
          if (this.protocolHidden) {
            var domainMargin = this.protocolNode.boxObject.width / 2;
            this.protocolNode.hidden = true;
            this.subDomainNode.style.setProperty("-moz-margin-start", Math.ceil(domainMargin) + "px", "");
            this.portNode.style.setProperty("-moz-margin-end", Math.floor(domainMargin) + "px", "");
          }
        ]]></body>
      </method>

      <method name="prettyView">
        <parameter name="animateBlend"/>
        <body><![CDATA[
          if (!this.uri) {
            this.plain = true;
            return;
          }

          if (!animateBlend || !this.animateBlend) {
            this._prettyView();
            this.plain = false;
            return;
          }

          var inputBox = this.inputBox;
          var presentationBox = this.presentationBox;
          var self = this;
          var initialDelay = 150;

          function blend (opacity, init) {
            inputBox.style.setProperty("opacity", opacity, "important");
            presentationBox.style.setProperty("opacity", 1-opacity, "important");
            if (init)
              self._prettyView();
            if (!opacity)
              self.plain = false;
          }

          var opacity = parseFloat(document.defaultView.getComputedStyle(inputBox, null).opacity);
          var delay = initialDelay;
          while (opacity > 0) {
            opacity = opacity * .8 - .15;
            if (opacity < 0)
              opacity = 0;
            this._blendingTimers.push(setTimeout(blend, delay, opacity, delay == initialDelay));
            delay += 60;
          }
        ]]></body>
      </method>

      <method name="doCopy">
        <parameter name="event"/>
        <body><![CDATA[
          var start = this.selectionStart;
          var end = this.selectionEnd;
          if (start == end)
            return;
          if (start == 0 && end == this.textLength) {
            // if the entire value is selected, and if it's a valid URI,
            // we want to encode whitespaces at least

            var val = this.value;
            try {
              this._ioService.newURI(val, null, null);
              val = val.replace(/ /g, "%20").replace(/\t/g, "%09");

              //XXX copy a fully encoded URI instead?
              //val = this._ioService.newURI(val, null, null).spec;
            } catch(e) {}
          } else
            var val = this.value.substring(start,end);
          Components.classes["@mozilla.org/widget/clipboardhelper;1"]
                    .getService(Components.interfaces.nsIClipboardHelper)
                    .copyString(val);
          if (event)
            event.preventDefault();
        ]]></body>
      </method>

      <method name="doCut">
        <parameter name="event"/>
        <body><![CDATA[
          var start = this.selectionStart;
          var end = this.selectionEnd;
          if (start == end)
            return;
          if (start == 0 && end == this.textLength) {
            // if the entire value is selected, and if it's a valid URI,
            // we want to encode whitespaces at least

            var val = this.value;
            try {
              this._ioService.newURI(val, null, null);
              val = val.replace(/ /g, "%20").replace(/\t/g, "%09");

              //XXX copy a fully encoded URI instead?
              //val = this._ioService.newURI(val, null, null).spec;
            } catch(e) {}
            this.value = "";
          } else {
            var val = this.value.substring(start,end);
            this.value = this.value.substring(0,start) + this.value.substring(end);
            this.selectionStart = this.selectionEnd = start;
          }
          Components.classes["@mozilla.org/widget/clipboardhelper;1"]
                    .getService(Components.interfaces.nsIClipboardHelper)
                    .copyString(val);
          if (event)
            event.preventDefault();
        ]]></body>
      </method>

      <method name="initURLTooltip">
        <parameter name="callback"/>
        <parameter name="object"/>
        <parameter name="crop"/>
        <body><![CDATA[
          if (this._tooltipTimer)
            clearTimeout (this._tooltipTimer);
          this._tooltipTimer = setTimeout (function(self) {
            self._tooltipTimer = 0;
            var tooltipText = callback.apply(object);
            if (tooltipText) {
              self.urlTooltipLabel.value = tooltipText;
              self.urlTooltipLabel.crop = crop || "center";
              var bO = self.boxObject;
              self.urlTooltip.maxWidth = bO.width;
              self.urlTooltip.showPopup(self, bO.screenX, bO.screenY + bO.height, "tooltip");
            }
          }, 400, this);
        ]]></body>
      </method>

      <method name="hideURLTooltip">
        <body><![CDATA[
          if (this._tooltipTimer) {
            clearTimeout (this._tooltipTimer);
            this._tooltipTimer = 0;
          }
          this.urlTooltip.hidePopup();
        ]]></body>
      </method>

      <method name="handleEvent">
        <parameter name="event"/>
        <body><![CDATA[
          switch (event.type) {
            case "keydown":
              if (this.plain && this._mouseover && !this._focused) {
                switch (event.keyCode) {
                  case 16:  // Shift
                  case 17:  // Ctrl
                  case 91:  // Meta
                    this.prettyView(true);
                    this.setAttribute("linkify","true");
                }
              }
          }
        ]]></body>
      </method>

      <method name="observe">
        <parameter name="subject"/>
        <parameter name="topic"/>
        <parameter name="data"/>
        <body><![CDATA[
          if (topic == "nsPref:changed") {
            switch(data) {
              case "hideProtocols":
                this.hideProtocols = this._prefs.getCharPref(data).split(" ");
                this._syncValue();
                if (!this.plain)
                  this.prettyView(false);
                break;
              case "clickSelectsAll":
              case "animateBlend":
              case "mouseOnBottomLinkifies":
              case "mouseOnTopLinkifies":
                this[data] = this._prefs.getBoolPref(data);
                break;
            }
          }
        ]]></body>
      </method>
    </implementation>

    <handlers>
      <handler event="input"
               action="this._syncValue();"/>

      <handler event="keypress" phase="capturing" key="c" modifiers="accel"
               action="this.doCopy(event)"/>
      <handler event="keypress" phase="capturing" key="x" modifiers="accel"
               action="this.doCut(event)"/>
      <!--win/unix-->
      <handler event="keypress" phase="capturing" keycode="VK_INSERT" modifiers="control"
               action="this.doCopy(event)"/>
      <handler event="keypress" keycode="VK_DELETE" modifiers="shift"
               action="this.doCut(event)"/>
      <!--unix-->
      <handler event="keypress" keycode="VK_DELETE" modifiers="control"
               action="this.doCopy(event)"/>

      <handler event="mousemove"><![CDATA[
        if (this.plain && !this._focused && this.contentIsCropped)
          this.initURLTooltip(function() {
            return this.plain ? this.value : null;
          }, this, "start");
      ]]></handler>

      <handler event="mouseover"><![CDATA[
        if (this._mouseover)
          return;
        if (!this.plain) {
          var pBO = this.presentationBox.boxObject;
          if (event.screenX < pBO.screenX || event.screenX > pBO.screenX + pBO.width)
            return;
        }
        this._mouseover = true;
        var bO = this.boxObject;
        if (this._iconWasHovered || event.shiftKey || event.ctrlKey || event.metaKey ||
            this.mouseOnTopLinkifies && event.screenY < bO.screenY + bO.height / 4 ||
            this.mouseOnBottomLinkifies && event.screenY >= bO.screenY + bO.height / 4)
          this.setAttribute("linkify","true");
        else
          setTimeout (function(self) {
            if (self._mouseover && self.getAttribute("linkify") != "true") {
              self.plain = true;
              document.addEventListener ("keydown", self, false);
            }
          }, 60, this);
      ]]></handler>

      <handler event="mouseout"><![CDATA[
        for (var node = event.relatedTarget; node; node = node.parentNode)
          if (node == this)
            return;
        this.removeAttribute("linkify");
        this._mouseover = false;
        this._iconWasHovered = false;
        if (!this._focused && this.plain) {
          this.prettyView(true);
          document.removeEventListener ("keydown", this, false);
        } else
          this.hideURLTooltip();
      ]]></handler>

      <handler event="focus" phase="capturing"><![CDATA[
        if (!this._focused) {
          this._focused = true;
          this.plain = true;
        }
      ]]></handler>

      <handler event="blur" phase="capturing"><![CDATA[
        if (this._focused && !this._dontBlur) {
          this._focused = false;
          this._syncValue();
          if (!this._mouseover)
            this.prettyView(true);
        }
      ]]></handler>
    </handlers>

  </binding>

  <binding id="single-segment" display="xul:hbox" extends="chrome://locationbar2/content/urlbar.xml#segment">
    <content>
      <xul:label class="textbox-presentation-segment-label" anonid="label"/>
      <xul:label class="textbox-presentation-slash" value="/"/>
    </content>

    <implementation>
      <property name="value" onget="return this.getAttribute('value');">
        <setter><![CDATA[
          this.setAttribute("value", val);
          document.getAnonymousElementByAttribute(this, "anonid", "label").value = val;
          return val;
        ]]></setter>
      </property>
    </implementation>
  </binding>

  <binding id="file-segment" extends="chrome://locationbar2/content/urlbar.xml#segment">
    <content>
      <children/>
    </content>
  </binding>

  <binding id="segment">
    <content>
      <children/>
      <xul:label class="textbox-presentation-slash" value="/"/>
    </content>

    <implementation>
      <field name="href"/>
    </implementation>

    <handlers>
      <handler event="click"><![CDATA[
        if (event.button != 2 &&
            event.originalTarget != this &&
            event.originalTarget.className != "textbox-presentation-slash" &&
            document.getBindingParent(this).getAttribute("linkify") == "true") {
          openUILink(this.href, event, false, true);
          event.stopPropagation();
          event.preventDefault();
        }
      ]]></handler>

      <handler event="mousedown"><![CDATA[
        if (event.button != 2 &&
            event.originalTarget != this &&
            event.originalTarget.className != "textbox-presentation-slash")
          event.stopPropagation();
      ]]></handler>

      <handler event="mouseout"><![CDATA[
        for (var node = event.relatedTarget; node; node = node.parentNode)
          if (node == this)
            return;
        document.getBindingParent(this).hideURLTooltip();
      ]]></handler>

      <handler event="mousemove"><![CDATA[
        if (event.originalTarget != this &&
            event.originalTarget.className != "textbox-presentation-slash")
          document.getBindingParent(this).initURLTooltip(function() {
            return this.href;
          }, this);
        else
          document.getBindingParent(this).hideURLTooltip();
      ]]></handler>
    </handlers>

  </binding>

  <binding id="input" extends="chrome://global/content/platformHTMLBindings.xml#inputFields">
    <implementation>
      <field name="_curPos">0</field>
    </implementation>
    <handlers>
      <handler event="click" button="0" clickcount="1" phase="capturing"><![CDATA[
        this._curPos = this.selectionStart;
      ]]></handler>
      <handler event="mousedown" button="0" clickcount="2" phase="capturing"><![CDATA[
        for (var i = this._curPos; i >= 0 && this.value[i-1] != "/"; i--);
        this.selectionStart = i;
        //this.selectionEnd = this.value.length;
        for (var i = this._curPos; i < this.value.length && this.value[i] != "/"; i++);
        this.selectionEnd = i;
        event.preventDefault();
      ]]></handler>
      <handler event="mousedown" button="0" clickcount="3" phase="capturing"><![CDATA[
        this.select();
        event.stopPropagation();
        event.preventDefault();
      ]]></handler>
    </handlers>
  </binding>
</bindings>