From 647685dd7060b2b75e8afbc4cda79aa0b7df4030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Tue, 10 Dec 2019 10:50:35 +0000 Subject: [PATCH] Bug 1602691 - Remove trimValue and textRunsMaxLen hooks from autocomplete-richlistitem.js. r=mak Differential Revision: https://phabricator.services.mozilla.com/D56518 --HG-- extra : moz-landing-system : lando --- .../widgets/autocomplete-richlistitem.js | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/toolkit/content/widgets/autocomplete-richlistitem.js b/toolkit/content/widgets/autocomplete-richlistitem.js index ea5f13e77035..8c628c80fc4b 100644 --- a/toolkit/content/widgets/autocomplete-richlistitem.js +++ b/toolkit/content/widgets/autocomplete-richlistitem.js @@ -403,10 +403,6 @@ this.setAttribute("title", title); this.setAttribute("text", this.getAttribute("ac-text")); - let popup = this.parentNode.parentNode; - let titleLooksLikeUrl = false; - let displayUrl = originalUrl; - let type = this.getAttribute("originaltype"); let types = new Set(type.split(/\s+/)); // Remove types that should ultimately not be in the `type` string. @@ -414,19 +410,11 @@ type = [...types][0] || ""; this.setAttribute("type", type); - let input = popup.input; - if (typeof input.trimValue == "function") { - displayUrl = input.trimValue(displayUrl); - } - displayUrl = this._unescapeUrl(displayUrl); - - // For performance reasons we may want to limit the displayUrl size. - if (popup.textRunsMaxLen && displayUrl) { - displayUrl = displayUrl.substr(0, popup.textRunsMaxLen); - } + let displayUrl = this._unescapeUrl(originalUrl); this.setAttribute("displayurl", displayUrl); // Show the domain as the title if we don't have a title. + let titleLooksLikeUrl = false; if (!title) { titleLooksLikeUrl = true; try { @@ -448,21 +436,8 @@ } if (Array.isArray(title)) { - // For performance reasons we may want to limit the title size. - if (popup.textRunsMaxLen) { - title.forEach(t => { - // Limit all the even items. - for (let i = 0; i < t.length; i += 2) { - t[i] = t[i].substr(0, popup.textRunsMaxLen); - } - }); - } this._setUpEmphasisedSections(this._titleText, title); } else { - // For performance reasons we may want to limit the title size. - if (popup.textRunsMaxLen && title) { - title = title.substr(0, popup.textRunsMaxLen); - } this._setUpDescription(this._titleText, title); } this._setUpDescription(this._urlText, displayUrl);