Gate address-bar-only chrome machinery on the input being the address bar
Categories
(Firefox :: Address Bar, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox156 | --- | affected |
People
(Reporter: dao, Assigned: dao)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sng][mcab-hnt])
Attachments
(4 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 2064279 - Keep per-tab state and the trimmed-prefix derivation to the address bar. r?daleharvey!
48 bytes,
text/x-phabricator-request
|
Details | Review |
Two pieces of UrlbarInputBase reach for chrome window structure that only the address bar needs, which a content-realm <moz-urlbar> then trips over.
_initCopyCutController() installs a controller so copy/cut put an untrimmed URL on the clipboard. _trimValue() returns early unless the input is the address bar, so on the searchbar the controller only reimplements native copy/cut -- and its hand-rolled cmd_cut splices inputField.value directly instead of going through the editor, so it isn't undoable. It needs controllers and editor on the input plus the clipboard service, all chrome-only.
#deferUpdatePlaceholder() defers the placeholder update until the user looks away, taking TabSelect on gBrowser.tabContainer as one of its two cues. Only the address bar takes its value from the selected tab, so on the searchbar that listener can only ever fire with its this.value guard already false, by which time the input listener has removed both.
Gating both on #isAddressbar drops dead work from the searchbar and lets a content instance work without a realm branch. Note the small behaviour change for the chrome searchbar: cmd_cut goes back through the editor, restoring undo.
addGBrowserListeners() should keep its this.window.gBrowser check rather than move to an #isAddressbar gate -- its TabClose handler triggers bounce telemetry, which is recorded for the searchbar SAP too.
Updated•1 day ago
|
| Assignee | ||
Comment 1•1 day ago
|
||
It exists to put an untrimmed URL on the clipboard, and _trimValue returns
early unless the input is the address bar, so on the searchbar the controller
only reimplements native copy/cut -- and its hand-rolled cmd_cut splices
inputField.value directly, so it doesn't go through the editor's undo.
This is what lets a content-realm input work without a realm branch here: the
controller needs controllers and editor on the input plus the clipboard
service, all chrome-only.
Updated•1 day ago
|
| Assignee | ||
Comment 2•1 day ago
|
||
The update waits for the user to look away, and a tab switch qualifies only for
the address bar, which takes its value from the selected tab. Nothing gives the
searchbar a value on TabSelect, so its listener could only ever fire with the
guard already false -- and by then the input listener has removed both.
A content-realm input, not being the address bar, is left with the same single
cue, which is what this needs to not reach for a tabbrowser it doesn't have.
| Assignee | ||
Comment 3•1 day ago
|
||
Persistence is an address bar feature and its state is keyed by the selected
tab's browser, which a content-realm input has no way to reach.
Worth knowing how this presented: handleEvent wraps every _on_* in a
try/catch and reports through console.error, so the resulting exception left
_on_input silently half-done -- typing updated the value and started no query,
with nothing in the parent-process log.
Comment 5•13 hours ago
|
||
Reverted this because it was causing mochitests failures in browser_searchbar_new.js.
- Revert link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | accessible/tests/browser/tree/browser_searchbar_new.js | test_searchbar_a11y_tree - [DOM node id: searchbar-new, role: grouping, address: [xpconnect wrapped nsIAccessible]] has an extra child at index 1 : [role: section, address: [xpconnect wrapped nsIAccessible]]
Comment 7•11 hours ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/bdb2fd01d5f2
https://hg.mozilla.org/mozilla-central/rev/484b10e80c66
https://hg.mozilla.org/mozilla-central/rev/6176008fb1e9
| Assignee | ||
Comment 8•11 hours ago
|
||
The unified search button's availability is stored per tab, which only a browser window has, so a content realm threw on every result selection. _trimValue only trims in the address bar, so elsewhere there is no prefix to derive and no need for BrowserUIUtils.
Comment 10•9 hours ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
| Assignee | ||
Updated•8 hours ago
|
Updated•8 hours ago
|
Updated•4 hours ago
|
Description
•