1
1
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
2
- index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a87a77c58 100644
2
+ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d1a80e97fa711352d4b725f2d299a073dbae4db 100644
3
3
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
4
4
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
5
5
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -16,19 +16,24 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
16
16
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
17
17
const SEARCH_BUTTON_CLASS = "urlbar-search-button";
18
18
19
- @@ -349,7 +356,11 @@ export class UrlbarInput {
19
+ @@ -349,7 +356,16 @@ export class UrlbarInput {
20
20
// See _on_select(). HTMLInputElement.select() dispatches a "select"
21
21
// event but does not set the primary selection.
22
22
this._suppressPrimaryAdjustment = true;
23
- + this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
23
+ + const zenToolbox = this.document.getElementById("navigator-toolbox");
24
+ + zenToolbox.setAttribute("supress-primary-adjustment", !(
25
+ + zenToolbox.hasAttribute("zen-has-hover") ||
26
+ + zenToolbox.hasAttribute("zen-has-empty-tab") ||
27
+ + zenToolbox.hasAttribute("zen-user-show")
28
+ + ));
24
29
this.inputField.select();
25
30
+ this.document.ownerGlobal.setTimeout(() => {
26
- + this.document.getElementById("navigator-toolbox") .removeAttribute("supress-primary-adjustment");
31
+ + zenToolbox .removeAttribute("supress-primary-adjustment");
27
32
+ }, 1000);
28
33
this._suppressPrimaryAdjustment = false;
29
34
}
30
35
31
- @@ -425,6 +436 ,10 @@ export class UrlbarInput {
36
+ @@ -425,6 +441 ,10 @@ export class UrlbarInput {
32
37
hideSearchTerms = false,
33
38
isSameDocument = false
34
39
) {
@@ -39,20 +44,25 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
39
44
// We only need to update the searchModeUI on tab switch conditionally
40
45
// as we only persist searchMode with ScotchBonnet enabled.
41
46
if (
42
- @@ -698,8 +713,11 @@ export class UrlbarInput {
47
+ @@ -698,8 +718,16 @@ export class UrlbarInput {
43
48
return;
44
49
}
45
50
}
46
51
-
47
- + this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
52
+ + const zenToolbox = this.document.getElementById("navigator-toolbox");
53
+ + zenToolbox.setAttribute("supress-primary-adjustment", !(
54
+ + zenToolbox.hasAttribute("zen-has-hover") ||
55
+ + zenToolbox.hasAttribute("zen-has-empty-tab") ||
56
+ + zenToolbox.hasAttribute("zen-user-show")
57
+ + ));
48
58
this.handleNavigation({ event });
49
59
+ this.document.ownerGlobal.setTimeout(() => {
50
- + this.document.getElementById("navigator-toolbox") .removeAttribute("supress-primary-adjustment");
51
- + }, 200 );
60
+ + zenToolbox .removeAttribute("supress-primary-adjustment");
61
+ + }, 1000 );
52
62
}
53
63
54
64
/**
55
- @@ -1093,7 +1111 ,11 @@ export class UrlbarInput {
65
+ @@ -1093,7 +1121 ,11 @@ export class UrlbarInput {
56
66
}
57
67
58
68
if (!this.#providesSearchMode(result)) {
@@ -65,7 +75,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
65
75
}
66
76
67
77
this.controller.recordSelectedResult(event, result);
68
- @@ -2125,6 +2147 ,10 @@ export class UrlbarInput {
78
+ @@ -2125,6 +2157 ,10 @@ export class UrlbarInput {
69
79
await this.#updateLayoutBreakoutDimensions();
70
80
}
71
81
@@ -76,7 +86,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
76
86
startLayoutExtend() {
77
87
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
78
88
// Do not expand if the Urlbar does not support being expanded or it is
79
- @@ -2147,6 +2173 ,13 @@ export class UrlbarInput {
89
+ @@ -2147,6 +2183 ,13 @@ export class UrlbarInput {
80
90
81
91
this.setAttribute("breakout-extend", "true");
82
92
@@ -90,7 +100,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
90
100
// Enable the animation only after the first extend call to ensure it
91
101
// doesn't run when opening a new window.
92
102
if (!this.hasAttribute("breakout-extend-animate")) {
93
- @@ -2166,6 +2199,19 @@ export class UrlbarInput {
103
+ @@ -2166,6 +2209,24 @@ export class UrlbarInput {
94
104
return;
95
105
}
96
106
@@ -99,18 +109,23 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
99
109
+ }
100
110
+
101
111
+ // Arc like URLbar: Blur the input on exit
102
- + this.document.getElementById("navigator-toolbox").setAttribute("supress-primary-adjustment", !this.document.getElementById("navigator-toolbox").hasAttribute("zen-has-hover"));
112
+ + const zenToolbox = this.document.getElementById("navigator-toolbox");
113
+ + zenToolbox.setAttribute("supress-primary-adjustment", !(
114
+ + zenToolbox.hasAttribute("zen-has-hover") ||
115
+ + zenToolbox.hasAttribute("zen-has-empty-tab") ||
116
+ + zenToolbox.hasAttribute("zen-user-show")
117
+ + ));
103
118
+ this.window.gBrowser.selectedBrowser.focus();
104
- + this.window .setTimeout(() => {
105
- + this.document.getElementById("navigator-toolbox") .removeAttribute("supress-primary-adjustment");
106
- + }, 100 );
119
+ + this.document.ownerGlobal .setTimeout(() => {
120
+ + zenToolbox .removeAttribute("supress-primary-adjustment");
121
+ + }, 1000 );
107
122
+
108
123
+ this.removeAttribute("zen-floating-urlbar");
109
124
+
110
125
this.removeAttribute("breakout-extend");
111
126
this.#updateTextboxPosition();
112
127
}
113
- @@ -2485,7 +2531 ,7 @@ export class UrlbarInput {
128
+ @@ -2485,7 +2546 ,7 @@ export class UrlbarInput {
114
129
115
130
this.textbox.parentNode.style.setProperty(
116
131
"--urlbar-container-height",
@@ -119,7 +134,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
119
134
);
120
135
this.textbox.style.setProperty(
121
136
"--urlbar-height",
122
- @@ -2998,7 +3044 ,7 @@ export class UrlbarInput {
137
+ @@ -2998,7 +3059 ,7 @@ export class UrlbarInput {
123
138
*/
124
139
_trimValue(val) {
125
140
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
@@ -128,7 +143,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
128
143
: val;
129
144
// Only trim value if the directionality doesn't change to RTL and we're not
130
145
// showing a strikeout https protocol.
131
- @@ -3368,6 +3414 ,10 @@ export class UrlbarInput {
146
+ @@ -3368,6 +3429 ,10 @@ export class UrlbarInput {
132
147
}
133
148
reuseEmpty = true;
134
149
}
@@ -139,7 +154,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
139
154
if (
140
155
where == "tab" &&
141
156
reuseEmpty &&
142
- @@ -3375,6 +3425 ,9 @@ export class UrlbarInput {
157
+ @@ -3375,6 +3440 ,9 @@ export class UrlbarInput {
143
158
) {
144
159
where = "current";
145
160
}
@@ -149,23 +164,23 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
149
164
return where;
150
165
}
151
166
152
- @@ -3632,6 +3685 ,7 @@ export class UrlbarInput {
167
+ @@ -3632,6 +3700 ,7 @@ export class UrlbarInput {
153
168
this.setResultForCurrentValue(null);
154
169
this.handleCommand();
155
170
this.controller.clearLastQueryContextCache();
156
171
+ this.view.close();
157
172
158
173
this._suppressStartQuery = false;
159
174
});
160
- @@ -3639,7 +3693 ,6 @@ export class UrlbarInput {
175
+ @@ -3639,7 +3708 ,6 @@ export class UrlbarInput {
161
176
contextMenu.addEventListener("popupshowing", () => {
162
177
// Close the results pane when the input field contextual menu is open,
163
178
// because paste and go doesn't want a result selection.
164
179
- this.view.close();
165
180
166
181
let controller =
167
182
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
168
- @@ -4053,6 +4106 ,11 @@ export class UrlbarInput {
183
+ @@ -4053,6 +4121 ,11 @@ export class UrlbarInput {
169
184
}
170
185
171
186
_on_click(event) {
@@ -177,7 +192,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
177
192
if (
178
193
event.target == this.inputField ||
179
194
event.target == this._inputContainer ||
180
- @@ -4124,7 +4182 ,7 @@ export class UrlbarInput {
195
+ @@ -4124,7 +4197 ,7 @@ export class UrlbarInput {
181
196
}
182
197
}
183
198
@@ -186,7 +201,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
186
201
this.view.autoOpen({ event });
187
202
} else {
188
203
if (this._untrimOnFocusAfterKeydown) {
189
- @@ -4164,9 +4222 ,12 @@ export class UrlbarInput {
204
+ @@ -4164,9 +4237 ,12 @@ export class UrlbarInput {
190
205
}
191
206
192
207
_on_mousedown(event) {
@@ -200,7 +215,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
200
215
201
216
if (
202
217
event.target != this.inputField &&
203
- @@ -4176,8 +4237 ,8 @@ export class UrlbarInput {
218
+ @@ -4176,8 +4252 ,8 @@ export class UrlbarInput {
204
219
break;
205
220
}
206
221
@@ -211,7 +226,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8ae25b8ba4ff4f599e1b5b2c545c681a
211
226
212
227
// Keep the focus status, since the attribute may be changed
213
228
// upon calling this.focus().
214
- @@ -4218,7 +4279 ,7 @@ export class UrlbarInput {
229
+ @@ -4218,7 +4294 ,7 @@ export class UrlbarInput {
215
230
}
216
231
// Don't close the view when clicking on a tab; we may want to keep the
217
232
// view open on tab switch, and the TabSelect event arrived earlier.
0 commit comments