diff -r 000000000000 -r 6474c204b198 browser/metro/base/content/bindings/urlbar.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/metro/base/content/bindings/urlbar.xml Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,937 @@ + + + + + +%browserDTD; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 || this.valueIsTyped) + return selectedVal; + + // The selection doesn't span the full domain if it doesn't contain a slash and is + // followed by some character other than a slash. + if (!selectedVal.contains("/")) { + let remainder = inputVal.replace(selectedVal, ""); + if (remainder != "" && remainder[0] != "/") + return selectedVal; + } + + let uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); + + let uri; + try { + uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE); + } catch (e) {} + if (!uri) + return selectedVal; + + // Only copy exposable URIs + try { + uri = uriFixup.createExposableURI(uri); + } catch (ex) {} + + // If the entire URL is selected, just use the actual loaded URI. + if (inputVal == selectedVal) { + // ... but only if isn't a javascript: or data: URI, since those + // are hard to read when encoded + if (!uri.schemeIs("javascript") && !uri.schemeIs("data")) { + // Parentheses are known to confuse third-party applications (bug 458565). + selectedVal = uri.spec.replace(/[()]/g, function (c) escape(c)); + } + + return selectedVal; + } + + // Just the beginning of the URL is selected, check for a trimmed value + let spec = uri.spec; + let trimmedSpec = this._trimURL(spec); + if (spec != trimmedSpec) { + // Prepend the portion that trimURL removed from the beginning. + // This assumes trimURL will only truncate the URL at + // the beginning or end (or both). + let trimmedSegments = spec.split(trimmedSpec); + selectedVal = trimmedSegments[0] + selectedVal; + } + + return selectedVal; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = 0) { + aURL = aURL.substring(0, firstSlash) + suffix + aURL.substring(firstSlash + 1); + } else { + aURL = aURL + suffix; + } + aURL = "http://www." + aURL; + } + } + + return aURL; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + null + + + + + + + + + + + + + + + + + + + + + + + + + + + = 0 || + this._searches.selectedIndex >= 0); + ]]> + + + + + + + + + + + + + + + + + + + + null + + document.getAnonymousElementByAttribute(this, 'anonid', 'results'); + document.getAnonymousElementByAttribute(this, 'anonid', 'results-container'); + + document.getAnonymousElementByAttribute(this, 'anonid', 'searches-header'); + document.getAnonymousElementByAttribute(this, 'anonid', 'searches'); + + + + + + + + + + + + + + + + + + + + + + + + + lastMatch) { + item.removeAttribute("value"); + item.removeAttribute("autocomplete"); + continue; + } + + let value = controller.getValueAt(i); + let label = controller.getCommentAt(i) || value; + let iconURI = controller.getImageAt(i); + + item.setAttribute("autocomplete", true); + item.setAttribute("label", label); + item.setAttribute("value", value); + item.setAttribute("iconURI", iconURI); + let xpFaviconURI = Services.io.newURI(iconURI.replace("moz-anno:favicon:",""), null, null); + Task.spawn(function() { + let colorInfo = yield ColorUtils.getForegroundAndBackgroundIconColors(xpFaviconURI); + if ( !(colorInfo && colorInfo.background && colorInfo.foreground) + || (item.getAttribute("iconURI") != iconURI) ) { + return; + } + let { background, foreground } = colorInfo; + item.style.color = foreground; //color text + item.setAttribute("customColor", background); + // when bound, use the setter to propogate the color change through the tile + if ('color' in item) { + item.color = background; + } + }).then(null, err => Components.utils.reportError(err)); + } + + this._results.arrangeItems(); + ]]> + + + + + + [] + + + + + + + + + + 0) + this._searches.removeItemAt(0, true); + + this._engines.forEach(function (anEngine) { + let item = this._searches.appendItem("", anEngine.name, true); + item.setAttribute("autocomplete", "true"); + item.setAttribute("search", "true"); + + let largeImage = anEngine.getIconURLBySize(74,74); + if (largeImage) { + item.setAttribute("iconsize", "large"); + item.setAttribute("iconURI", largeImage); + } else if (anEngine.iconURI && anEngine.iconURI.spec) { + item.setAttribute("iconURI", anEngine.iconURI.spec); + item.setAttribute("customColor", "#fff"); + } + }.bind(this)); + + this._searches.arrangeItems(); + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = 0) { + let url = this.input.controller.getValueAt(this._results.selectedIndex); + this.input.value = url; + return this.input.submitURL(); + } + + if (this._isGridBound(this._searches) && + this._searches.selectedIndex >= 0) { + let engine = this._engines[this._searches.selectedIndex]; + return this.input.submitSearch(engine.name); + } + + return false; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +