(In reply to alexander :surkov (:asurkov) from comment #1)
(In reply to Tim Nguyen :ntim from comment #0)
Since I believe only the searchbar CE uses the searchbar-textbox binding, they could be folded together.
searchbar-textbox overrides a lot coming from autocomplete, so as long as searchbar is not an autocomplete itself, it makes sense to keep these things separately I'd say. Also, both searchbar and searchbar-textbox widgets are not small (300+ lines in each), which might make another argument to keep those separately. And it will require less changes if we keep status quo.
By "folding", I meant overriding by setting the
searchbar-textbox expando properties from
searchbar, similar to what bgrins has done in bug 1539665.
But thinking more about it, it might make sense to fix this at the same time as bug 1534455 rather than separately, since bug 1534455 moves out some
searchbar-textbox specific logic from the
autocomplete binding (mainly the
<children includes=""> which are only needed for
So after bug 1534455, this markup would simply become:
<hbox class="searchbar-search-button" tooltiptext="&searchIcon.tooltip;">
<html:input class="searchbar-textbox" is="autocomplete-input" inputtype="search" placeholder="&searchInput.placeholder;" flex="1" autocompletepopup="PopupSearchAutoComplete" autocompletesearch="search-autocomplete" autocompletesearchparam="searchbar-history" maxrows="10" completeselectedindex="true" minresultsforpopup="0"/>
<image class="search-go-button urlbar-icon" hidden="true" onclick="handleSearchCommand(event);" tooltiptext="&contentSearchSubmit.tooltip;"></image>
As for the other properties in
I think it would be fine to move the context menu logic to
searchbar since it's not tied to
autocomplete at all, especially since the new markup shouldn't involve
moz-input-box but use what
input are using instead.
autocomplete properties, but overriding should be feasible from the parent CE as well, by doing
this._textbox.searchParam = ....
These are mainly used as event handlers, so it should be possible to init those from the searchbar CE.
These are props specific to searchbar-textbox and we can move them to the
If the size of the
searchbar CE turns out to be unreasonable, I think it's fine to create a customized input element that extends autocomplete-input, but I don't think it will necessarily make things cleaner, given that we'd need to keep existing hacks like
this.closest("searchbar")._textboxInitialized = true to synchronise
Anyway, I'm not planning to work on this or bug 1534455 anytime soon, so feel free to finish this work in whatever way you think is cleaner, but overall, I'd really like
<textbox> to go away for these usages and that we start using
<html:input/> with custom behaviour, this way we can get rid of textbox completely in the future.