Skip to content

Commit

Permalink
sync upstream gecko-dev 133.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Dec 7, 2024
1 parent 4773a24 commit a40f31f
Show file tree
Hide file tree
Showing 27 changed files with 338 additions and 255 deletions.
4 changes: 4 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -5459,3 +5459,7 @@ bb415f62ee5e9008ef76e7fca71d82f402e23079 FIREFOX_RELEASE_132_END
8141aab3ba856d7cbae6c851dd71f2e0cb69649c FIREFOX_133_0_BUILD2
8141aab3ba856d7cbae6c851dd71f2e0cb69649c FIREFOX_133_0_RELEASE
8141aab3ba856d7cbae6c851dd71f2e0cb69649c FIREFOX-ANDROID_133_0_RELEASE
5728bc568997c2b615a11f7ec12d93010754c632 FIREFOX-ANDROID_133_0_1_BUILD1
5728bc568997c2b615a11f7ec12d93010754c632 FIREFOX-ANDROID_133_0_1_RELEASE
209dcdd9680fd795f6ef282575faf3a77982229b FIREFOX-ANDROID_133_0_2_BUILD1
209dcdd9680fd795f6ef282575faf3a77982229b FIREFOX-ANDROID_133_0_2_RELEASE
2 changes: 1 addition & 1 deletion browser/config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
133.0.1
133.0.3
2 changes: 1 addition & 1 deletion browser/config/version_display.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
133.0.1
133.0.3
8 changes: 3 additions & 5 deletions browser/themes/shared/toolbarbuttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
--toolbarbutton-outer-padding: 2px;
--toolbarbutton-inner-padding: 8px;

--toolbarbutton-hover-background: var(--button-background-color-hover);
--toolbarbutton-active-background: var(--button-background-color-active);
--toolbarbutton-hover-background: color-mix(in srgb, currentColor 17%, transparent);
--toolbarbutton-active-background: color-mix(in srgb, currentColor 30%, transparent);
--toolbarbutton-outline-color: transparent;
--toolbarbutton-hover-outline-color: transparent;
--toolbarbutton-active-outline-color: transparent;
Expand Down Expand Up @@ -128,15 +128,13 @@ toolbar .toolbarbutton-1 {
outline-color: var(--toolbarbutton-hover-outline-color);
}

&:hover:active > :is(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack) {
&:is(:hover:active, [open], [checked]) > :is(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack) {
background-color: var(--toolbarbutton-active-background);
color: inherit;
outline-color: var(--toolbarbutton-active-outline-color);
}

&:is([open], [checked]) > :is(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack) {
background-color: var(--toolbarbutton-active-background);
color: inherit;
outline-color: var(--toolbarbutton-selected-outline-color);
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/milestone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------

133.0.1
133.0.3
8 changes: 6 additions & 2 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6114,9 +6114,13 @@ nsresult nsDocShell::FilterStatusForErrorPage(
if (aStatus == NS_ERROR_UNKNOWN_PROTOCOL) {
// For unknown protocols we only display an error if the load is triggered
// by the browser itself. Showing the error for page-triggered navigations
// causes annoying behavior for users, see bug 1528305.
// causes annoying behavior for users when a page tries to open an external
// app which has not been installed, see bug 1528305. A missing WebExtension
// protocol handlers will however always load the error page, as it is not
// expected to be opened externally, see bug 1921426.
nsCOMPtr<nsILoadInfo> info = aChannel->LoadInfo();
if (!info->TriggeringPrincipal()->IsSystemPrincipal()) {
if (!info->TriggeringPrincipal()->IsSystemPrincipal() &&
!BasePrincipal::Cast(info->TriggeringPrincipal())->AddonPolicy()) {
if (aSkippedUnknownProtocolNavigation) {
*aSkippedUnknownProtocolNavigation = true;
}
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ void ContentParent::LogAndAssertFailedPrincipalValidationInfo(
} else {
principalType.AssignLiteral("Unknown");
}
extra.principalType = Some(principalType);
extra.principaltype = Some(principalType);
extra.value = Some(aMethod);

// Do not send telemetry when chrome-debugging is enabled
Expand Down
2 changes: 1 addition & 1 deletion dom/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ security:
The `value` of the event. Mirrors to the Legacy Telemetry
event's `value` parameter.
type: string
principal_type:
principalType:
description: >
The type of principal that was received. Expected values for this field are
NullPtr
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.fenix.browser.desktopmode

import org.mozilla.fenix.Config

/**
* @see [DefaultDesktopModeFeatureFlag]
*/
class DefaultDesktopModeFeatureFlagImpl : DefaultDesktopModeFeatureFlag {

override fun isDesktopModeEnabled(): Boolean = Config.channel.isDebug
}

/**
* Interface for checking if the app wide default desktop mode functionality is enabled.
*/
interface DefaultDesktopModeFeatureFlag {

/**
* Returns true if the default desktop mode functionality is enabled.
*/
fun isDesktopModeEnabled(): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ import mozilla.components.lib.state.MiddlewareContext
* @param scope [CoroutineScope] used for writing settings changes to disk.
* @param repository [DesktopModeRepository] used to interact with the desktop mode preference.
* @param engine [Engine] used to clear any relevant browsing data after a desktop mode preference update.
* @param desktopModeFeatureFlag [DefaultDesktopModeFeatureFlag] used to determine if the desktop mode
* feature is enabled.
*/
class DesktopModeMiddleware(
private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO),
private val repository: DesktopModeRepository,
private val engine: Engine,
private val desktopModeFeatureFlag: DefaultDesktopModeFeatureFlag = DefaultDesktopModeFeatureFlagImpl(),
) : Middleware<BrowserState, BrowserAction> {

override fun invoke(
Expand All @@ -35,6 +38,11 @@ class DesktopModeMiddleware(
action: BrowserAction,
) {
next(action)

if (!desktopModeFeatureFlag.isDesktopModeEnabled()) {
return
}

when (action) {
InitAction -> {
scope.launch {
Expand All @@ -45,6 +53,7 @@ class DesktopModeMiddleware(
)
}
}

DefaultDesktopModeAction.ToggleDesktopMode -> {
scope.launch {
val updatedDesktopMode = context.state.desktopMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import androidx.core.content.ContextCompat
import androidx.navigation.Navigation
import androidx.preference.Preference
import androidx.preference.Preference.OnPreferenceClickListener
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceScreen
import androidx.preference.SwitchPreference
import mozilla.components.browser.state.action.DefaultDesktopModeAction
import mozilla.telemetry.glean.private.NoExtras
import org.mozilla.fenix.Config
import org.mozilla.fenix.GleanMetrics.Autoplay
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.desktopmode.DefaultDesktopModeFeatureFlagImpl
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.navigateWithBreadcrumb
Expand All @@ -31,11 +34,16 @@ import org.mozilla.fenix.settings.requirePreference
@SuppressWarnings("TooManyFunctions")
class SiteSettingsFragment : PreferenceFragmentCompat() {

private val defaultDesktopModeFeatureFlag by lazy { DefaultDesktopModeFeatureFlagImpl() }

override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.site_permissions_preferences, rootKey)

val preferenceDescription = requirePreference<Preference>(R.string.pref_key_site_permissions_description)
preferenceDescription.isVisible = Config.channel.isMozillaOnline

// This should be setup in onCreatePreferences so we setup only once when the fragment is created
bindDesktopMode()
}

override fun onResume() {
Expand All @@ -45,21 +53,28 @@ class SiteSettingsFragment : PreferenceFragmentCompat() {
}

private fun setupPreferences() {
bindDesktopMode()
bindCategoryPhoneFeatures()
bindExceptions()
}

private fun bindDesktopMode() {
requirePreference<SwitchPreference>(R.string.pref_key_desktop_browsing).apply {
icon?.setTint(ContextCompat.getColor(context, R.color.fx_mobile_icon_color_primary))
isChecked = requireComponents.core.store.state.desktopMode
isPersistent = false
onPreferenceChangeListener =
Preference.OnPreferenceChangeListener { _, _ ->
requireComponents.core.store.dispatch(DefaultDesktopModeAction.ToggleDesktopMode)
true
}
if (defaultDesktopModeFeatureFlag.isDesktopModeEnabled()) {
requirePreference<SwitchPreference>(R.string.pref_key_desktop_browsing).apply {
icon?.setTint(ContextCompat.getColor(context, R.color.fx_mobile_icon_color_primary))
isChecked = requireComponents.core.store.state.desktopMode
isPersistent = false
onPreferenceChangeListener =
Preference.OnPreferenceChangeListener { _, _ ->
requireComponents.core.store.dispatch(DefaultDesktopModeAction.ToggleDesktopMode)
true
}
}
} else {
// Remove the preference category if the feature is not enabled
val preferenceScreen: PreferenceScreen =
requirePreference(R.string.pref_key_site_permissions_preference_screen)
val contentPreferenceCategory: PreferenceCategory = requirePreference(R.string.pref_key_category_content)
preferenceScreen.removePreference(contentPreferenceCategory)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
<string name="pref_key_app_cold_start_count" translatable="false">pref_key_app_cold_start_count</string>

<string name="pref_key_desktop_browsing" translatable="false">pref_key_desktop_browsing</string>
<string name="pref_key_category_content" translatable="false">pref_key_category_content</string>
<string name="pref_key_site_permissions_preference_screen" translatable="false">pref_key_site_permissions_preference_screen</string>

<!-- Crash reporting -->
<string name="pref_key_crash_reporting_deferred_until" translatable="false">pref_key_crash_reporting_deferred_until</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.preference.PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="@string/pref_key_site_permissions_preference_screen"
xmlns:app="http://schemas.android.com/apk/res-auto">

<androidx.preference.PreferenceCategory
Expand All @@ -15,6 +16,7 @@
tools:targetApi="o" />

<androidx.preference.PreferenceCategory
android:key="@string/pref_key_category_content"
android:layout="@layout/preference_category_no_icon_style"
android:title="@string/preferences_category_content">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.browser.desktopmode.DefaultDesktopModeFeatureFlag
import org.mozilla.fenix.browser.desktopmode.DesktopModeMiddleware
import org.mozilla.fenix.browser.desktopmode.DesktopModeRepository

Expand All @@ -48,7 +49,28 @@ class DesktopModeMiddlewareTest {
val expected = true
val middleware = createMiddleware(
scope = this,
getDesktopBrowsingEnabled = { expected },
getDesktopBrowsingEnabled = { true },
)
val store = BrowserStore(
initialState = BrowserState(),
middleware = listOf(middleware),
)

advanceUntilIdle()
store.waitUntilIdle()

launch {
assertEquals(expected, store.state.desktopMode)
}
}

@Test
fun `GIVEN the feature is disabled WHEN the desktop mode is enabled and the Store is initialized THEN the middleware should set the correct value in the Store`() = runTestOnMain {
val expected = false
val middleware = createMiddleware(
scope = this,
getDesktopBrowsingEnabled = { true },
isDesktopModeFeatureEnabled = false,
)
val store = BrowserStore(
initialState = BrowserState(),
Expand Down Expand Up @@ -213,6 +235,7 @@ class DesktopModeMiddlewareTest {
scope: CoroutineScope,
getDesktopBrowsingEnabled: () -> Boolean = { false },
updateDesktopBrowsingEnabled: (Boolean) -> Boolean = { true },
isDesktopModeFeatureEnabled: Boolean = true,
clearSpeculativeSession: () -> Unit = {},
) = DesktopModeMiddleware(
scope = scope,
Expand All @@ -223,6 +246,9 @@ class DesktopModeMiddlewareTest {
engine = createEngine(
clearSpeculativeSession = clearSpeculativeSession,
),
desktopModeFeatureFlag = object : DefaultDesktopModeFeatureFlag {
override fun isDesktopModeEnabled(): Boolean = isDesktopModeFeatureEnabled
},
)

private fun createRepository(
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
133.0.1
133.0.3
7 changes: 7 additions & 0 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13846,6 +13846,13 @@
value: false
mirror: always

# When true, Firefox will send Extensivle prioritization scheme
# PRIORITY_UPDATE frames.
- name: network.http.http2.priority_updates
type: RelaxedAtomicBool
value: false
mirror: always

# This pref controls whether to send the
# SETTINGS_NO_RFC7540_PRIORITIES when stream dependencies
# are disabled, and extensible prioritization scheme is in use.
Expand Down
4 changes: 4 additions & 0 deletions netwerk/protocol/http/Http2StreamBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,10 @@ void Http2StreamBase::UpdatePriority(Http2Session* session) {
nsHttp::NotifyActiveTabLoadOptimization();
}

if (!StaticPrefs::network_http_http2_priority_updates()) {
return;
}

nsHttpTransaction* trans = HttpTransaction();
if (!trans) {
return;
Expand Down
Loading

0 comments on commit a40f31f

Please sign in to comment.