tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5f2e0bd90026f637bf18dd1f51bcd76c594f1cf1
parent a19065d0c314e73c9015ab4907e798ba9145a72f
Author: Moritz Beier <mbeier@mozilla.com>
Date:   Mon, 27 Oct 2025 10:02:41 +0000

Bug 1995002 - Remove "Add a keyword for this search". r=search-reviewers,places-reviewers,tgiles,Standard8

Differential Revision: https://phabricator.services.mozilla.com/D269047

Diffstat:
Mbrowser/actors/ContextMenuChild.sys.mjs | 47-----------------------------------------------
Mbrowser/actors/ContextMenuParent.sys.mjs | 6------
Mbrowser/app/profile/firefox.js | 3---
Mbrowser/base/content/browser-context.inc | 2--
Mbrowser/base/content/browser-context.js | 6------
Mbrowser/base/content/nsContextMenu.sys.mjs | 43+------------------------------------------
Mbrowser/base/content/test/contextMenu/browser_contextmenu_add_search_engine.js | 4----
Mbrowser/components/places/tests/browser/browser.toml | 2--
Dbrowser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js | 188-------------------------------------------------------------------------------
Mbrowser/components/preferences/search.inc.xhtml | 2--
Mbrowser/components/preferences/search.js | 19-------------------
Mbrowser/components/preferences/tests/browser_search_subdialogs_within_preferences_9.js | 6------
Mbrowser/components/preferences/tests/browser_search_userEngineDialog.js | 6------
Mbrowser/components/search/test/browser/browser.toml | 2--
Dbrowser/components/search/test/browser/browser_addKeywordSearch.js | 121-------------------------------------------------------------------------------
Mbrowser/components/search/test/browser/browser_addSearchEngineFromForm.js | 6------
Mbrowser/locales/en-US/browser/browserContext.ftl | 4----
Mtoolkit/modules/InlineSpellChecker.sys.mjs | 38++------------------------------------
18 files changed, 3 insertions(+), 502 deletions(-)

diff --git a/browser/actors/ContextMenuChild.sys.mjs b/browser/actors/ContextMenuChild.sys.mjs @@ -179,50 +179,6 @@ export class ContextMenuChild extends JSWindowActorChild { break; } - case "ContextMenu:SearchFieldBookmarkData": { - let node = lazy.ContentDOMReference.resolve( - message.data.targetIdentifier - ); - let charset = node.ownerDocument.characterSet; - let formBaseURI = Services.io.newURI(node.form.baseURI, charset); - let formURI = Services.io.newURI( - node.form.getAttribute("action"), - charset, - formBaseURI - ); - let spec = formURI.spec; - let isURLEncoded = - node.form.method.toUpperCase() == "POST" && - (node.form.enctype == "application/x-www-form-urlencoded" || - node.form.enctype == ""); - let title = node.ownerDocument.title; - - function escapeNameValuePair([aName, aValue]) { - if (isURLEncoded) { - return escape(aName + "=" + aValue); - } - - return encodeURIComponent(aName) + "=" + encodeURIComponent(aValue); - } - let formData = new this.contentWindow.FormData(node.form); - formData.delete(node.name); - formData = Array.from(formData).map(escapeNameValuePair); - formData.push( - escape(node.name) + (isURLEncoded ? escape("=%s") : "=%s") - ); - - let postData; - - if (isURLEncoded) { - postData = formData.join("&"); - } else { - let separator = spec.includes("?") ? "&" : "?"; - spec += separator + formData.join("&"); - } - - return Promise.resolve({ spec, title, postData, charset }); - } - case "ContextMenu:SearchFieldEngineData": { let node = lazy.ContentDOMReference.resolve( message.data.targetIdentifier @@ -913,7 +869,6 @@ export class ContextMenuChild extends JSWindowActorChild { context.onPiPVideo = false; context.onEditable = false; context.onImage = false; - context.onKeywordField = false; context.onLink = false; context.onLoadedImage = false; context.onMailtoLink = false; @@ -1148,7 +1103,6 @@ export class ContextMenuChild extends JSWindowActorChild { context.shouldInitInlineSpellCheckerUINoChildren = true; } - context.onKeywordField = editFlags & lazy.SpellCheckHelper.KEYWORD; context.onSearchField = editFlags & lazy.SpellCheckHelper.SEARCHENGINE; } else if (this.contentWindow.HTMLHtmlElement.isInstance(context.target)) { const bodyElt = context.target.ownerDocument.body; @@ -1276,7 +1230,6 @@ export class ContextMenuChild extends JSWindowActorChild { // If this.onEditable is false but editFlags is CONTENTEDITABLE, then // the document itself must be editable. context.onTextInput = true; - context.onKeywordField = false; context.onImage = false; context.onLoadedImage = false; context.onCompletedImage = false; diff --git a/browser/actors/ContextMenuParent.sys.mjs b/browser/actors/ContextMenuParent.sys.mjs @@ -117,12 +117,6 @@ export class ContextMenuParent extends JSWindowActorParent { }); } - getSearchFieldBookmarkData(targetIdentifier) { - return this.sendQuery("ContextMenu:SearchFieldBookmarkData", { - targetIdentifier, - }); - } - getSearchFieldEngineData(targetIdentifier) { return this.sendQuery("ContextMenu:SearchFieldEngineData", { targetIdentifier, diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js @@ -752,9 +752,6 @@ pref("browser.urlbar.wikipedia.featureGate", false); // Wikipedia suggestions are turned on. pref("browser.urlbar.suggest.wikipedia", true); -// Enable creating and editing user defined search engines. -pref("browser.urlbar.update2.engineAliasRefresh", true); - // Controls whether realtime opt-in suggestions are turned on. pref("browser.urlbar.suggest.realtimeOptIn", true); diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc @@ -351,8 +351,6 @@ <menuitem id="context-take-screenshot" data-l10n-id="main-context-menu-take-screenshot"/> <menuseparator id="context-sep-screenshots"/> - <menuitem id="context-keywordfield" - data-l10n-id="main-context-menu-keyword"/> <menuitem id="context-add-engine" data-l10n-id="main-context-menu-add-engine"/> <menuitem id="context-searchselect"/> diff --git a/browser/base/content/browser-context.js b/browser/base/content/browser-context.js @@ -206,12 +206,6 @@ document.addEventListener( case "context-take-screenshot": gContextMenu.takeScreenshot(); break; - case "context-keywordfield": - if (!gContextMenu) { - throw new Error("Context menu doesn't seem to be open."); - } - gContextMenu.addKeywordForSearchField(); - break; case "context-add-engine": if (!gContextMenu) { throw new Error("Context menu doesn't seem to be open."); diff --git a/browser/base/content/nsContextMenu.sys.mjs b/browser/base/content/nsContextMenu.sys.mjs @@ -22,7 +22,6 @@ ChromeUtils.defineESModuleGetters(lazy, { "resource://gre/modules/LoginManagerContextMenu.sys.mjs", NetUtil: "resource://gre/modules/NetUtil.sys.mjs", NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", - PlacesUIUtils: "moz-src:///browser/components/places/PlacesUIUtils.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs", SearchUIUtils: "moz-src:///browser/components/search/SearchUIUtils.sys.mjs", @@ -242,7 +241,6 @@ export class nsContextMenu { this.onPiPVideo = context.onPiPVideo; this.onEditable = context.onEditable; this.onImage = context.onImage; - this.onKeywordField = context.onKeywordField; this.onSearchField = context.onSearchField; this.onLink = context.onLink; this.onLoadedImage = context.onLoadedImage; @@ -936,7 +934,6 @@ export class nsContextMenu { this.onPlainTextLink ); this.showItem("context-add-engine", this.shouldShowAddEngine()); - this.showItem("context-keywordfield", this.shouldShowAddKeyword()); this.showItem("frame", this.inFrame); if (this.inFrame) { @@ -2308,28 +2305,6 @@ export class nsContextMenu { } } - addKeywordForSearchField() { - this.actor.getSearchFieldBookmarkData(this.targetIdentifier).then(data => { - let title = this.window.gNavigatorBundle.getFormattedString( - "addKeywordTitleAutoFill", - [data.title] - ); - lazy.PlacesUIUtils.showBookmarkDialog( - { - action: "add", - type: "bookmark", - uri: this.window.makeURI(data.spec), - title, - keyword: "", - postData: data.postData, - charSet: data.charset, - hiddenRows: ["location", "tags"], - }, - this.window - ); - }); - } - async addSearchFieldAsEngine() { let { url, formData, charset, method } = await this.actor.getSearchFieldEngineData(this.targetIdentifier); @@ -2508,18 +2483,6 @@ export class nsContextMenu { return false; } - shouldShowAddKeyword() { - return ( - this.onTextInput && - this.onKeywordField && - !this.isLoginForm() && - !Services.prefs.getBoolPref( - "browser.urlbar.update2.engineAliasRefresh", - false - ) - ); - } - shouldShowAddEngine() { let uri = this.browser.currentURI; @@ -2527,11 +2490,7 @@ export class nsContextMenu { this.onTextInput && this.onSearchField && !this.isLoginForm() && - (uri.schemeIs("http") || uri.schemeIs("https")) && - Services.prefs.getBoolPref( - "browser.urlbar.update2.engineAliasRefresh", - false - ) + (uri.schemeIs("http") || uri.schemeIs("https")) ); } diff --git a/browser/base/content/test/contextMenu/browser_contextmenu_add_search_engine.js b/browser/base/content/test/contextMenu/browser_contextmenu_add_search_engine.js @@ -26,10 +26,6 @@ add_task(async function test_setup() { const contextmenu_common = chrome_base + "contextmenu_common.js"; /* import-globals-from contextmenu_common.js */ Services.scriptloader.loadSubScript(contextmenu_common, this); - - await SpecialPowers.pushPrefEnv({ - set: [["browser.urlbar.update2.engineAliasRefresh", true]], - }); }); add_task(async function test_text_input_spellcheck_noform() { diff --git a/browser/components/places/tests/browser/browser.toml b/browser/components/places/tests/browser/browser.toml @@ -25,8 +25,6 @@ run-if = ["os == 'mac'"] # Mac-only functionality ["browser_bookmarkProperties_addFolderDefaultButton.js"] -["browser_bookmarkProperties_addKeywordForThisSearch.js"] - ["browser_bookmarkProperties_bookmarkAllTabs.js"] ["browser_bookmarkProperties_cancel.js"] diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js b/browser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js @@ -1,188 +0,0 @@ -"use strict"; - -const TEST_URL = - "http://mochi.test:8888/browser/browser/components/places/tests/browser/keyword_form.html"; - -let contentAreaContextMenu = document.getElementById("contentAreaContextMenu"); - -add_task(async function add_keyword() { - await BrowserTestUtils.withNewTab( - { - gBrowser, - url: TEST_URL, - }, - async function (browser) { - // We must wait for the context menu code to build metadata. - await openContextMenuForContentSelector( - browser, - '#form1 > input[name="search"]' - ); - - await withBookmarksDialog( - false, - function () { - gContextMenu.addKeywordForSearchField(); - contentAreaContextMenu.hidePopup(); - }, - async function (dialogWin) { - let acceptBtn = dialogWin.document - .getElementById("bookmarkpropertiesdialog") - .getButton("accept"); - Assert.ok(acceptBtn.disabled, "Accept button is disabled"); - - let promiseKeywordNotification = PlacesTestUtils.waitForNotification( - "bookmark-keyword-changed", - events => events.some(event => event.keyword === "kw") - ); - - fillBookmarkTextField("editBMPanel_keywordField", "kw", dialogWin); - - Assert.ok(!acceptBtn.disabled, "Accept button is enabled"); - - acceptBtn.click(); - await promiseKeywordNotification; - - // After the notification, the keywords cache will update asynchronously. - info("Check the keyword entry has been created"); - let entry; - await TestUtils.waitForCondition(async function () { - entry = await PlacesUtils.keywords.fetch("kw"); - return !!entry; - }, "Unable to find the expected keyword"); - Assert.equal(entry.keyword, "kw", "keyword is correct"); - Assert.equal(entry.url.href, TEST_URL, "URL is correct"); - Assert.equal( - entry.postData, - "accenti%3D%E0%E8%EC%F2%F9&search%3D%25s", - "POST data is correct" - ); - let bm = await PlacesUtils.bookmarks.fetch({ url: TEST_URL }); - Assert.equal( - bm.parentGuid, - await PlacesUIUtils.defaultParentGuid, - "Should have created the keyword in the right folder." - ); - - info("Check the charset has been saved"); - let pageInfo = await PlacesUtils.history.fetch(TEST_URL, { - includeAnnotations: true, - }); - Assert.equal( - pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO), - "windows-1252", - "charset is correct" - ); - - // Now check getShortcutOrURI. - let data = await UrlbarUtils.getShortcutOrURIAndPostData("kw test"); - Assert.equal( - getPostDataString(data.postData), - "accenti=\u00E0\u00E8\u00EC\u00F2\u00F9&search=test", - "getShortcutOrURI POST data is correct" - ); - Assert.equal(data.url, TEST_URL, "getShortcutOrURI URL is correct"); - }, - () => PlacesUtils.bookmarks.eraseEverything() - ); - } - ); -}); - -add_task(async function reopen_same_field() { - await PlacesUtils.keywords.insert({ - url: TEST_URL, - keyword: "kw", - postData: "accenti%3D%E0%E8%EC%F2%F9&search%3D%25s", - }); - registerCleanupFunction(async function () { - await PlacesUtils.keywords.remove("kw"); - }); - // Reopening on the same input field should show the existing keyword. - await BrowserTestUtils.withNewTab( - { - gBrowser, - url: TEST_URL, - }, - async function (browser) { - // We must wait for the context menu code to build metadata. - await openContextMenuForContentSelector( - browser, - '#form1 > input[name="search"]' - ); - - await withBookmarksDialog( - true, - function () { - gContextMenu.addKeywordForSearchField(); - contentAreaContextMenu.hidePopup(); - }, - async function (dialogWin) { - let elt = dialogWin.document.getElementById( - "editBMPanel_keywordField" - ); - Assert.equal(elt.value, "kw", "Keyword should be the previous value"); - - let acceptBtn = dialogWin.document - .getElementById("bookmarkpropertiesdialog") - .getButton("accept"); - ok(!acceptBtn.disabled, "Accept button is enabled"); - }, - () => PlacesUtils.bookmarks.eraseEverything() - ); - } - ); -}); - -add_task(async function open_other_field() { - await PlacesUtils.keywords.insert({ - url: TEST_URL, - keyword: "kw2", - postData: "search%3D%25s", - }); - registerCleanupFunction(async function () { - await PlacesUtils.keywords.remove("kw2"); - }); - // Reopening on another field of the same page that has different postData - // should not show the existing keyword. - await BrowserTestUtils.withNewTab( - { - gBrowser, - url: TEST_URL, - }, - async function (browser) { - // We must wait for the context menu code to build metadata. - await openContextMenuForContentSelector( - browser, - '#form2 > input[name="search"]' - ); - - await withBookmarksDialog( - true, - function () { - gContextMenu.addKeywordForSearchField(); - contentAreaContextMenu.hidePopup(); - }, - function (dialogWin) { - let acceptBtn = dialogWin.document - .getElementById("bookmarkpropertiesdialog") - .getButton("accept"); - ok(acceptBtn.disabled, "Accept button is disabled"); - - let elt = dialogWin.document.getElementById( - "editBMPanel_keywordField" - ); - is(elt.value, ""); - }, - () => PlacesUtils.bookmarks.eraseEverything() - ); - } - ); -}); - -function getPostDataString(stream) { - let sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance( - Ci.nsIScriptableInputStream - ); - sis.init(stream); - return sis.read(stream.available()).split("\n").pop(); -} diff --git a/browser/components/preferences/search.inc.xhtml b/browser/components/preferences/search.inc.xhtml @@ -173,7 +173,6 @@ <button id="addEngineButton" is="highlightable-button" class="searchEngineAction" - hidden="true" data-l10n-id="search-add-engine" search-l10n-ids=" add-engine-button, @@ -186,7 +185,6 @@ <button id="editEngineButton" is="highlightable-button" class="searchEngineAction" - hidden="true" disabled="true" data-l10n-id="search-edit-engine" /> diff --git a/browser/components/preferences/search.js b/browser/components/preferences/search.js @@ -31,7 +31,6 @@ Preferences.addAll([ { id: "browser.urlbar.recentsearches.featureGate", type: "bool" }, { id: "browser.urlbar.suggest.recentsearches", type: "bool" }, { id: "browser.urlbar.scotchBonnet.enableOverride", type: "bool" }, - { id: "browser.urlbar.update2.engineAliasRefresh", type: "bool" }, // Suggest Section. { id: "browser.urlbar.suggest.bookmark", type: "bool" }, @@ -98,11 +97,6 @@ var gSearchPane = { "browser.search.suggest.enabled.private" ); - Preferences.get("browser.urlbar.update2.engineAliasRefresh").on( - "change", - () => gEngineView.updateUserEngineButtonVisibility() - ); - let updateSuggestionCheckboxes = this._updateSuggestionCheckboxes.bind(this); suggestsPref.on("change", updateSuggestionCheckboxes); @@ -830,7 +824,6 @@ class EngineView { this.loadL10nNames(); this.#addListeners(); - this.updateUserEngineButtonVisibility(); } async loadL10nNames() { @@ -884,18 +877,6 @@ class EngineView { this._engineList.addEventListener("dblclick", this); } - /** - * Shows the Add and Edit Search Engines buttons if the pref is enabled. - */ - updateUserEngineButtonVisibility() { - let aliasRefresh = Services.prefs.getBoolPref( - "browser.urlbar.update2.engineAliasRefresh", - false - ); - document.getElementById("addEngineButton").hidden = !aliasRefresh; - document.getElementById("editEngineButton").hidden = !aliasRefresh; - } - get lastEngineIndex() { return this._engineStore.engines.length - 1; } diff --git a/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_9.js b/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_9.js @@ -7,12 +7,6 @@ * This file contains tests for the "Add Engine" subdialog. */ -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.urlbar.update2.engineAliasRefresh", true]], - }); -}); - /** * Test for searching for the "Add Engine" subdialog. */ diff --git a/browser/components/preferences/tests/browser_search_userEngineDialog.js b/browser/components/preferences/tests/browser_search_userEngineDialog.js @@ -15,12 +15,6 @@ const { SearchUtils } = ChromeUtils.importESModule( "moz-src:///toolkit/components/search/SearchUtils.sys.mjs" ); -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.urlbar.update2.engineAliasRefresh", true]], - }); -}); - add_task(async function test_addEngineGet() { await openPreferencesViaOpenPreferencesAPI("search", { leaveOpen: true, diff --git a/browser/components/search/test/browser/browser.toml b/browser/components/search/test/browser/browser.toml @@ -34,8 +34,6 @@ skip-if = [ "win10_2009 && bits == 64 && !debug", # Bug 1399648, bug 1402502 ] -["browser_addKeywordSearch.js"] - ["browser_addSearchEngineFromForm.js"] support-files = ["test.html", "test_windows1252.html"] diff --git a/browser/components/search/test/browser/browser_addKeywordSearch.js b/browser/components/search/test/browser/browser_addKeywordSearch.js @@ -1,121 +0,0 @@ -var testData = [ - { desc: "No path", action: "https://example.com/", param: "q" }, - { - desc: "With path", - action: "https://example.com/new-path-here/", - param: "q", - }, - { desc: "No action", action: "", param: "q" }, - { - desc: "With Query String", - action: "https://example.com/search?oe=utf-8", - param: "q", - }, - { - desc: "With Unicode Query String", - action: "https://example.com/searching", - param: "q", - testHiddenUnicode: true, - }, -]; - -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["test.wait300msAfterTabSwitch", true]], - }); -}); - -add_task(async function () { - const TEST_URL = - "https://example.org/browser/browser/components/search/test/browser/test.html"; - let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL); - - let count = 0; - for (let method of ["GET", "POST"]) { - for (let { desc, action, param, testHiddenUnicode = false } of testData) { - info(`Running ${method} keyword test '${desc}'`); - let id = `keyword-form-${count++}`; - let contextMenu = document.getElementById("contentAreaContextMenu"); - let contextMenuPromise = BrowserTestUtils.waitForEvent( - contextMenu, - "popupshown" - ); - - await SpecialPowers.spawn( - tab.linkedBrowser, - [{ action, param, method, id, testHiddenUnicode }], - async function (args) { - let doc = content.document; - let form = doc.createElement("form"); - form.id = args.id; - form.method = args.method; - form.action = args.action; - let element = doc.createElement("input"); - element.setAttribute("type", "text"); - element.setAttribute("name", args.param); - form.appendChild(element); - if (args.testHiddenUnicode) { - form.insertAdjacentHTML( - "beforeend", - `<input name="utf8✓" type="hidden" value="✓">` - ); - } - doc.body.appendChild(form); - } - ); - - await BrowserTestUtils.synthesizeMouseAtCenter( - `#${id} > input`, - { type: "contextmenu", button: 2 }, - tab.linkedBrowser - ); - await contextMenuPromise; - let url = action || tab.linkedBrowser.currentURI.spec; - let actor = gContextMenu.actor; - - let data = await actor.getSearchFieldBookmarkData( - gContextMenu.targetIdentifier - ); - if (method == "GET") { - ok( - data.spec.endsWith(`${param}=%s`), - `Check expected url for field named ${param} and action ${action}` - ); - if (testHiddenUnicode) { - ok( - data.spec.includes(`utf8%E2%9C%93=%E2%9C%93`), - `Check the unicode param is correctly encoded` - ); - } - } else { - is( - data.spec, - url, - `Check expected url for field named ${param} and action ${action}` - ); - if (testHiddenUnicode) { - is( - data.postData, - `utf8%u2713%3D%u2713&q%3D%25s`, - `Check expected POST data for field named ${param} and action ${action}` - ); - } else { - is( - data.postData, - `${param}%3D%25s`, - `Check expected POST data for field named ${param} and action ${action}` - ); - } - } - - let popupHiddenPromise = BrowserTestUtils.waitForEvent( - contextMenu, - "popuphidden" - ); - contextMenu.hidePopup(); - await popupHiddenPromise; - } - } - - BrowserTestUtils.removeTab(tab); -}); diff --git a/browser/components/search/test/browser/browser_addSearchEngineFromForm.js b/browser/components/search/test/browser/browser_addSearchEngineFromForm.js @@ -178,12 +178,6 @@ async function openAddEngineDialog(browser, selector) { return dialogWin; } -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.urlbar.update2.engineAliasRefresh", true]], - }); -}); - add_task(async function testAddingEngines() { let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser); let browser = tab.linkedBrowser; diff --git a/browser/locales/en-US/browser/browserContext.ftl b/browser/locales/en-US/browser/browserContext.ftl @@ -363,10 +363,6 @@ main-context-menu-manage-passwords = .label = Manage Passwords .accesskey = M -main-context-menu-keyword = - .label = Add a Keyword for this Search… - .accesskey = K - main-context-menu-add-engine = .label = Add Search Engine .accesskey = S diff --git a/toolkit/modules/InlineSpellChecker.sys.mjs b/toolkit/modules/InlineSpellChecker.sys.mjs @@ -425,8 +425,8 @@ export var SpellCheckHelper = { // Set when over any text-entry <input>. TEXTINPUT: 0x8, - // Set when over an <input> that can be used as a keyword field. - KEYWORD: 0x10, + // Set when over an <input> that can be used as a search engine. + SEARCHENGINE: 0x10, // Set when over an element that otherwise would not be considered // "editable" but is because content editable is enabled for the document. @@ -442,37 +442,6 @@ export var SpellCheckHelper = { // specifically for spellcheck. SPELLCHECKABLE: 0x100, - SEARCHENGINE: 0x200, - - isTargetAKeywordField(aNode, window) { - if (!window.HTMLInputElement.isInstance(aNode)) { - return false; - } - - var form = aNode.form; - if (!form || aNode.type == "password") { - return false; - } - - var method = form.method.toUpperCase(); - - // These are the following types of forms we can create keywords for: - // - // method encoding type can create keyword - // GET * YES - // * YES - // POST YES - // POST application/x-www-form-urlencoded YES - // POST text/plain NO (a little tricky to do) - // POST multipart/form-data NO - // POST everything else YES - return ( - method == "GET" || - method == "" || - (form.enctype != "text/plain" && form.enctype != "multipart/form-data") - ); - }, - /** * Returns whether the element is counted as a search engine field. * @@ -532,9 +501,6 @@ export var SpellCheckHelper = { ) { flags |= this.SPELLCHECKABLE; } - if (this.isTargetAKeywordField(element, window)) { - flags |= this.KEYWORD; - } if (this.isTargetASearchEngineField(element, window)) { flags |= this.SEARCHENGINE; }