Closed Bug 1556566 Opened 5 years ago Closed 5 years ago

Remove `moz-input-box`

Categories

(Toolkit :: UI Widgets, task)

task
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1586591

People

(Reporter: ntim, Unassigned)

References

Details

Component: Search → XUL Widgets
Product: Firefox → Toolkit

Brian, would it be possible to add some kind of API to editMenuOverlay.js that would allow adding context menu items in there ?

We probably don't need to worry about the old urlbar, but the searchbar will need this for "Paste & Search", "Clear Search History" and "Show Search Suggestions".

Maybe this could be done in a nicer way than an API in editMenuOverlay.js though ? The goal is to be able to get rid of any child markup including moz-input-box from the autocomplete binding, so we can simply have <html:input is="autocomplete-input" />.

Flags: needinfo?(bgrinstead)

(In reply to Tim Nguyen :ntim from comment #1)

Brian, would it be possible to add some kind of API to editMenuOverlay.js that would allow adding context menu items in there ?

We probably don't need to worry about the old urlbar, but the searchbar will need this for "Paste & Search", "Clear Search History" and "Show Search Suggestions".

Maybe this could be done in a nicer way than an API in editMenuOverlay.js though ? The goal is to be able to get rid of any child markup including moz-input-box from the autocomplete binding, so we can simply have <html:input is="autocomplete-input" />.

Yeah, I'd ultimately like moz-input-box to go away. Perhaps we could either:

  1. implement a method on the input itself that editMenuOverlay.js would call to receive an alternative menupopup instead of https://searchfox.org/mozilla-central/rev/fe7dbedf223c0fc4b37d5bd72293438dfbca6cec/toolkit/content/editMenuOverlay.js#75 if it's implemented - like e.target.getContextMenu()
  2. have the element listen to the contextmenu event itself and create it's own popup & preventDefault(). This will already cause editMenuOverlay to bail out due to https://searchfox.org/mozilla-central/rev/fe7dbedf223c0fc4b37d5bd72293438dfbca6cec/toolkit/content/editMenuOverlay.js#66.

I sort of just lean towards (2) since it seems each consumer will have pretty specific needs (the search input items integrated throughout the rest of the menu, for instance). The amount of duplication is relatively small (https://searchfox.org/mozilla-central/rev/fe7dbedf223c0fc4b37d5bd72293438dfbca6cec/toolkit/content/editMenuOverlay.js#75-94) and would need to be partly duplicated anyway even in (1).

FWIW I'm guessing TB may want some kind of hook here too to enable spellcheck menuitems on inputs (as in https://bugzilla.mozilla.org/show_bug.cgi?id=1556203).

Flags: needinfo?(bgrinstead)

Looks like Andrew might be doing it all in one go for autocomplete in bug 1534455, but it's still desirable to get rid of moz-input-box regardless (from the urlbar notably).

No longer blocks: 1534455
Depends on: 1534455
Summary: Remove `moz-input-box` usage from autocomplete binding → Remove `moz-input-box`
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.