Skip to content

Commit

Permalink
Merge release to esr128. a=release
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Jul 3, 2024
2 parents bc28725 + 6beae68 commit 4fe9c72
Show file tree
Hide file tree
Showing 357 changed files with 1,083 additions and 1,068 deletions.
3 changes: 3 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ pref("browser.urlbar.scotchBonnet.enableOverride", false);

// Enable trending suggestions and recent searches.
pref("browser.urlbar.trending.featureGate", true);
#if defined(RELEASE_OR_BETA)
pref("browser.urlbar.trending.enabledLocales", "en-US, en-CA");
#endif
pref("browser.urlbar.trending.requireSearchMode", false);
pref("browser.urlbar.recentsearches.featureGate", true);

Expand Down
15 changes: 13 additions & 2 deletions browser/components/preferences/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Preferences.addAll([
{ id: "browser.search.separatePrivateDefault.ui.enabled", type: "bool" },
{ id: "browser.urlbar.suggest.trending", type: "bool" },
{ id: "browser.urlbar.trending.featureGate", type: "bool" },
{ id: "browser.urlbar.trending.enabledLocales", type: "string" },
{ id: "browser.urlbar.recentsearches.featureGate", type: "bool" },
{ id: "browser.urlbar.suggest.recentsearches", type: "bool" },
]);
Expand Down Expand Up @@ -283,8 +284,18 @@ var gSearchPane = {
let trendingSupported = (
await Services.search.getDefault()
).supportsResponseType(lazy.SearchUtils.URL_TYPE.TRENDING_JSON);
trendingBox.hidden = !Preferences.get("browser.urlbar.trending.featureGate")
.value;
let trendingEnabled = Preferences.get(
"browser.urlbar.trending.featureGate"
).value;
let enabledLocales = Preferences.get(
"browser.urlbar.trending.enabledLocales"
).value;
if (trendingEnabled && enabledLocales) {
trendingEnabled = enabledLocales.includes(
Services.locale.appLocaleAsBCP47
);
}
trendingBox.hidden = !trendingEnabled;
trendingCheckBox.disabled = suggestDisabled || !trendingSupported;
},

Expand Down
5 changes: 5 additions & 0 deletions browser/components/urlbar/UrlbarPrefs.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ const PREF_URLBAR_DEFAULTS = new Map([
// Feature gate pref for trending suggestions in the urlbar.
["trending.featureGate", true],

// Only enable trending suggestions if the users browser locale is contained
// in this list; enable in all locales if empty.
// (if the value was "en-US", trending would only be enabled for en-US users).
["trending.enabledLocales", ""],

// The maximum number of trending results to show while not in search mode.
["trending.maxResultsNoSearchMode", 10],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,16 @@ class ProviderSearchSuggestions extends UrlbarProvider {
* Whether we should fetch trending results.
*/
#shouldFetchTrending(queryContext) {
let trendingEnabled = lazy.UrlbarPrefs.get("trending.featureGate");
let enabledLocales = lazy.UrlbarPrefs.get("trending.enabledLocales");
if (trendingEnabled && enabledLocales) {
trendingEnabled = enabledLocales.includes(
Services.locale.appLocaleAsBCP47
);
}
return !!(
queryContext.searchString == "" &&
lazy.UrlbarPrefs.get("trending.featureGate") &&
trendingEnabled &&
lazy.UrlbarPrefs.get("suggest.trending") &&
(queryContext.searchMode ||
!lazy.UrlbarPrefs.get("trending.requireSearchMode"))
Expand Down
1 change: 0 additions & 1 deletion browser/themes/ThemeVariableMap.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const ThemeVariableMap = [
"--lwt-tab-line-color",
{
lwtProperty: "tab_line",
optionalElementID: "TabsToolbar",
},
],
[
Expand Down
55 changes: 25 additions & 30 deletions browser/themes/shared/tabbrowser/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@
--tab-selected-textcolor: var(--toolbar-color);
--tab-selected-bgcolor: var(--toolbar-bgcolor);
--tab-selected-color-scheme: var(--toolbar-color-scheme);

&[lwt-tab-selected="light"] {
--tab-selected-color-scheme: light;
}
&[lwt-tab-selected="dark"] {
--tab-selected-color-scheme: dark;
}
--tab-selected-outline-color: transparent;
--tab-hover-outline-color: transparent;
@media (prefers-contrast) {
--tab-selected-outline-color: currentColor;
--tab-hover-outline-color: currentColor;
}
&[lwtheme] {
--tab-selected-outline-color: var(--lwt-tab-line-color, currentColor);
}
}

#tabbrowser-tabs {
Expand Down Expand Up @@ -123,13 +131,6 @@
}
}

/* tabbrowser-tab keyboard focus */
&.keyboard-focused-tab > .tab-stack > .tab-background,
&:focus:not([aria-activedescendant]) > .tab-stack > .tab-background {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}

#tabbrowser-tabs[movingtab] > #tabbrowser-arrowscrollbox > &:is([selected], [multiselected]) {
position: relative;
z-index: 2;
Expand Down Expand Up @@ -563,18 +564,22 @@
#TabsToolbar #firefox-view-button:hover:not([open]) > .toolbarbutton-icon,
.tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected], [multiselected]) {
background-color: color-mix(in srgb, currentColor 11%, transparent);
}

#TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon,
#tabbrowser-tabs:not([noshadowfortests]) .tab-background:is([selected], [multiselected]) {
box-shadow: 0 0 4px rgba(0,0,0,.4);
outline: 1px solid var(--tab-hover-outline-color);
outline-offset: -1px;
}

#TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon,
.tab-background:is([selected], [multiselected]) {
background-color: var(--tab-selected-bgcolor);
background-origin: border-box;
background-repeat: repeat-x;
box-shadow: 0 0 4px rgba(0,0,0,.4);
outline: 1px solid var(--tab-selected-outline-color);
outline-offset: -1px;

#tabbrowser-tabs[noshadowfortests] & {
box-shadow: none;
}
}

#TabsToolbar #firefox-view-button[open] > .toolbarbutton-icon,
Expand All @@ -583,23 +588,6 @@
color-scheme: var(--tab-selected-color-scheme);
}

@media (prefers-contrast) {
#TabsToolbar #firefox-view-button:is([open], :hover):not(:focus-visible) > .toolbarbutton-icon,
.tab-background[selected],
.tabbrowser-tab:hover > .tab-stack > .tab-background {
outline: 1px solid currentColor;
outline-offset: -1px;
}
}

@media not (prefers-contrast) {
:root[lwtheme] #TabsToolbar #firefox-view-button[open]:not(:focus-visible) > .toolbarbutton-icon,
:root[lwtheme] .tab-background[selected]:not([multiselected]) {
outline: 1px solid var(--lwt-tab-line-color, var(--lwt-tabs-border-color, currentColor));
outline-offset: -1px;
}
}

/* Add a focus outline on top of the multiselected tabs, with the currently selected
tab getting a slightly thicker outline. */
.tab-background[multiselected] {
Expand All @@ -612,6 +600,13 @@
}
}

/* Keyboard focus outline */
#TabsToolbar #firefox-view-button:focus-visible > .toolbarbutton-icon,
.tabbrowser-tab:is(.keyboard-focused-tab, :focus:not([aria-activedescendant])) > .tab-stack > .tab-background {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}

/* Pinned tabs */

.tabbrowser-tab:is([image], [pinned]) > .tab-stack > .tab-content[attention]:not([selected]),
Expand Down
12 changes: 6 additions & 6 deletions dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3991,7 +3991,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
if (mType == FormControlType::InputSearch) {
if (nsSearchControlFrame* searchControlFrame =
do_QueryFrame(GetPrimaryFrame())) {
Element* clearButton = searchControlFrame->GetAnonClearButton();
Element* clearButton = searchControlFrame->GetButton();
if (clearButton &&
aVisitor.mEvent->mOriginalTarget == clearButton) {
SetUserInput(EmptyString(),
Expand All @@ -4005,7 +4005,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
} else if (mType == FormControlType::InputPassword) {
if (nsTextControlFrame* textControlFrame =
do_QueryFrame(GetPrimaryFrame())) {
auto* reveal = textControlFrame->GetRevealButton();
auto* reveal = textControlFrame->GetButton();
if (reveal && aVisitor.mEvent->mOriginalTarget == reveal) {
SetRevealPassword(!RevealPassword());
// TODO(emilio): This should focus the input, but calling
Expand Down Expand Up @@ -6974,20 +6974,20 @@ Maybe<int32_t> HTMLInputElement::GetNumberInputCols() const {
(size.mAfterDecimal ? 1 : 0));
}

int32_t HTMLInputElement::GetCols() {
Maybe<int32_t> HTMLInputElement::GetCols() {
if (const nsAttrValue* attr = GetParsedAttr(nsGkAtoms::size);
attr && attr->Type() == nsAttrValue::eInteger) {
int32_t cols = attr->GetIntegerValue();
if (cols > 0) {
return cols;
return Some(cols);
}
}

if (Maybe<int32_t> cols = GetNumberInputCols(); cols && *cols > 0) {
return *cols;
return cols;
}

return DEFAULT_COLS;
return {};
}

int32_t HTMLInputElement::GetWrapCols() {
Expand Down
2 changes: 1 addition & 1 deletion dom/html/HTMLInputElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class HTMLInputElement final : public TextControlElement,
bool IsSingleLineTextControl() const override;
bool IsTextArea() const override;
bool IsPasswordTextControl() const override;
int32_t GetCols() override;
Maybe<int32_t> GetCols() override;
int32_t GetWrapCols() override;
int32_t GetRows() override;
void GetDefaultValueFromContent(nsAString& aValue, bool aForDisplay) override;
Expand Down
10 changes: 8 additions & 2 deletions dom/html/HTMLTextAreaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,13 @@ bool HTMLTextAreaElement::IsTextArea() const { return true; }

bool HTMLTextAreaElement::IsPasswordTextControl() const { return false; }

int32_t HTMLTextAreaElement::GetCols() { return Cols(); }
Maybe<int32_t> HTMLTextAreaElement::GetCols() {
const nsAttrValue* value = GetParsedAttr(nsGkAtoms::cols);
if (!value || value->Type() != nsAttrValue::eInteger) {
return {};
}
return Some(value->GetIntegerValue());
}

int32_t HTMLTextAreaElement::GetWrapCols() {
nsHTMLTextWrap wrapProp;
Expand All @@ -1064,7 +1070,7 @@ int32_t HTMLTextAreaElement::GetWrapCols() {
}

// Otherwise we just wrap at the given number of columns
return GetCols();
return GetColsOrDefault();
}

int32_t HTMLTextAreaElement::GetRows() {
Expand Down
4 changes: 2 additions & 2 deletions dom/html/HTMLTextAreaElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class HTMLTextAreaElement final : public TextControlElement,
bool IsSingleLineTextControl() const override;
bool IsTextArea() const override;
bool IsPasswordTextControl() const override;
int32_t GetCols() override;
Maybe<int32_t> GetCols() override;
int32_t GetWrapCols() override;
int32_t GetRows() override;
void GetDefaultValueFromContent(nsAString& aValue, bool aForDisplay) override;
Expand Down Expand Up @@ -171,7 +171,7 @@ class HTMLTextAreaElement final : public TextControlElement,
void SetAutocomplete(const nsAString& aValue, ErrorResult& aRv) {
SetHTMLAttr(nsGkAtoms::autocomplete, aValue, aRv);
}
uint32_t Cols() { return GetUnsignedIntAttr(nsGkAtoms::cols, DEFAULT_COLS); }
uint32_t Cols() { return GetColsOrDefault(); }
void SetCols(uint32_t aCols, ErrorResult& aError) {
uint32_t cols = aCols ? aCols : DEFAULT_COLS;
SetUnsignedIntAttr(nsGkAtoms::cols, cols, DEFAULT_COLS, aError);
Expand Down
11 changes: 6 additions & 5 deletions dom/html/TextControlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TextControlElement : public nsGenericHTMLFormControlElementWithState {
* Get the cols attribute (if textarea) or a default
* @return the number of columns to use
*/
virtual int32_t GetCols() = 0;
virtual Maybe<int32_t> GetCols() = 0;
int32_t GetColsOrDefault() { return GetCols().valueOr(DEFAULT_COLS); }

/**
* Get the column index to wrap at, or -1 if we shouldn't wrap
Expand Down Expand Up @@ -216,10 +217,10 @@ class TextControlElement : public nsGenericHTMLFormControlElementWithState {
MOZ_CAN_RUN_SCRIPT virtual nsresult SetValueFromSetRangeText(
const nsAString& aValue) = 0;

static const int32_t DEFAULT_COLS = 20;
static const int32_t DEFAULT_ROWS = 1;
static const int32_t DEFAULT_ROWS_TEXTAREA = 2;
static const int32_t DEFAULT_UNDO_CAP = 1000;
inline static constexpr int32_t DEFAULT_COLS = 20;
inline static constexpr int32_t DEFAULT_ROWS = 1;
inline static constexpr int32_t DEFAULT_ROWS_TEXTAREA = 2;
inline static constexpr int32_t DEFAULT_UNDO_CAP = 1000;

// wrap can be one of these three values.
typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion dom/html/TextControlState.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class TextControlState final : public SupportsWeakPtr {
bool IsPasswordTextControl() const {
return mTextCtrlElement->IsPasswordTextControl();
}
int32_t GetCols() { return mTextCtrlElement->GetCols(); }
int32_t GetColsOrDefault() { return mTextCtrlElement->GetColsOrDefault(); }
int32_t GetWrapCols() {
int32_t wrapCols = mTextCtrlElement->GetWrapCols();
MOZ_ASSERT(wrapCols >= 0);
Expand Down
2 changes: 1 addition & 1 deletion dom/privateattribution/PrivateAttributionService.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class PrivateAttributionService {
await impressionStore.put(impressions, key);
}

async compareImpression(cur, impression) {
compareImpression(cur, impression) {
return cur.source === impression.source && cur.target === impression.target;
}

Expand Down
Loading

0 comments on commit 4fe9c72

Please sign in to comment.