Compare commits

...

7 Commits

12 changed files with 111 additions and 248 deletions

View File

@@ -207,8 +207,10 @@ jobs:
fi
# Stored in build/windows/.windows-rs-version
WINDOWS_RS_VERSION=$(cat build/windows/.windows-rs-version)
curl -fsSL "https://static.crates.io/crates/cargo-download/cargo-download-0.1.2.crate" | tar xz -C /tmp
(cd /tmp/cargo-download-0.1.2 && cargo generate-lockfile && cargo update tinyvec --precise 1.12.0)
RUSTFLAGS="--cap-lints=allow" cargo install --path /tmp/cargo-download-0.1.2 --locked
cd engine/
cargo install cargo-download --locked
cargo download -x windows=$WINDOWS_RS_VERSION
export CARGO_INCREMENTAL=0
echo "" >> ../configs/common/mozconfig

View File

@@ -34,8 +34,8 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
### Firefox Versions
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `155.0`!
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 155.0`!
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `155.0.1`!
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 155.0.1`!
### Contributing

View File

@@ -1 +1 @@
20e5abbb642ab21d943bc1261864d9c531ba421a
b6d45eac914fd4886c9b6e5f1447f613771228ff

View File

@@ -1,173 +0,0 @@
diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -298,11 +298,13 @@
panic_on_gl_error, picTileWidth, picTileHeight,
gfx::gfxVars::WebRenderRequiresHardwareDriver(),
StaticPrefs::gfx_webrender_low_quality_pinch_zoom_AtStartup(),
StaticPrefs::gfx_webrender_max_shared_surface_size_AtStartup(),
StaticPrefs::gfx_webrender_enable_subpixel_aa_AtStartup(),
- compositor->ShouldUseLayerCompositor())) {
+ compositor->ShouldUseLayerCompositor(),
+ StaticPrefs::
+ gfx_webrender_opaque_backdrop_fallback_AtStartup())) {
// wr_window_new puts a message into gfxCriticalNote if it returns
// false
MOZ_ASSERT(errorMessage);
error.AssignASCII(errorMessage);
wr_api_free_error_msg(errorMessage);
diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1998,10 +1998,11 @@
reject_software_rasterizer: bool,
low_quality_pinch_zoom: bool,
max_shared_surface_size: i32,
enable_subpixel_aa: bool,
use_layer_compositor: bool,
+ opaque_backdrop_fallback: bool,
) -> bool {
assert!(unsafe { is_in_render_thread() });
// Ensure the WR profiler callbacks are hooked up to the Gecko profiler.
set_profiler_hooks(Some(&PROFILER_HOOKS));
@@ -2164,11 +2165,12 @@
texture_cache_config,
reject_software_rasterizer,
low_quality_pinch_zoom,
max_shared_surface_size,
enable_dithering,
enable_shared_instance_buffer,
+ opaque_backdrop_fallback,
..Default::default()
};
let window_size = DeviceIntSize::new(window_width, window_height);
let notifier = Box::new(CppNotifier { window_id });
diff --git a/gfx/wr/webrender/src/device/gl.rs b/gfx/wr/webrender/src/device/gl.rs
--- a/gfx/wr/webrender/src/device/gl.rs
+++ b/gfx/wr/webrender/src/device/gl.rs
@@ -3982,10 +3982,14 @@
pub fn disable_color_write(&self) {
self.gl.color_mask(false, false, false, false);
}
+ pub fn set_color_mask(&self, r: bool, g: bool, b: bool, a: bool) {
+ self.gl.color_mask(r, g, b, a);
+ }
+
pub fn set_blend(&mut self, enable: bool) {
if enable {
self.gl.enable(gl::BLEND);
} else {
self.gl.disable(gl::BLEND);
diff --git a/gfx/wr/webrender/src/renderer/init.rs b/gfx/wr/webrender/src/renderer/init.rs
--- a/gfx/wr/webrender/src/renderer/init.rs
+++ b/gfx/wr/webrender/src/renderer/init.rs
@@ -204,6 +204,8 @@
pub low_quality_pinch_zoom: bool,
pub max_shared_surface_size: i32,
/// If true, open a debug socket to listen for remote debugger.
/// Relies on `debugger` cargo feature being enabled.
pub enable_debugger: bool,
+ /// See explanation of `gfx.webrender.opaque-backdrop-fallback`.
+ pub opaque_backdrop_fallback: bool,
}
@@ -277,10 +279,11 @@
enable_instancing: true,
enable_shared_instance_buffer: false,
reject_software_rasterizer: false,
low_quality_pinch_zoom: false,
max_shared_surface_size: 2048,
enable_debugger: true,
+ opaque_backdrop_fallback: false,
}
}
}
@@ -802,11 +805,12 @@
allocated_native_surfaces: FastHashSet::default(),
debug_overlay_state: DebugOverlayState::new(),
buffer_damage_tracker: BufferDamageTracker::default(),
max_primitive_instance_count,
enable_instancing: options.enable_instancing,
use_shared_instance_buffer,
+ opaque_backdrop_fallback: options.opaque_backdrop_fallback,
consecutive_oom_frames: 0,
target_frame_publish_id: None,
pending_result_msg: None,
layer_compositor_frame_state_in_prev_frame: None,
external_composite_debug_items: Vec::new(),
diff --git a/gfx/wr/webrender/src/renderer/mod.rs b/gfx/wr/webrender/src/renderer/mod.rs
--- a/gfx/wr/webrender/src/renderer/mod.rs
+++ b/gfx/wr/webrender/src/renderer/mod.rs
@@ -867,13 +867,15 @@
buffer_damage_tracker: BufferDamageTracker,
max_primitive_instance_count: usize,
enable_instancing: bool,
/// If true, stream instance data into large buffers shared by multiple
/// draws, rather than allocating a new instance buffer for each draw.
use_shared_instance_buffer: bool,
+ opaque_backdrop_fallback: bool,
+
/// Count consecutive oom frames to detectif we are stuck unable to render
/// in a loop.
consecutive_oom_frames: u32,
/// update() defers processing of ResultMsg, if frame_publish_id of
@@ -2787,18 +2789,29 @@
let read_target = ReadTarget::from_texture(cache_texture);
// Should always be drawing to picture cache tiles or off-screen surface!
debug_assert!(!draw_target.is_default());
let device_to_framebuffer = Scale::new(1i32);
+ let dest_fb_rect = dest * device_to_framebuffer;
self.device.blit_render_target(
read_target,
src * device_to_framebuffer,
draw_target,
- dest * device_to_framebuffer,
+ dest_fb_rect,
TextureFilter::Linear,
);
+
+ if self.opaque_backdrop_fallback {
+ self.device.set_color_mask(false, false, false, true);
+ self.device.clear_target(
+ Some([0.0, 0.0, 0.0, 1.0]),
+ None,
+ Some(dest_fb_rect),
+ );
+ self.device.set_color_mask(true, true, true, true);
+ }
}
}
}
fn draw_picture_cache_target(
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -8439,10 +8439,17 @@
#else
value: false
#endif
mirror: once
+# Make backdrop-filter treat its captured backdrop as if it had been
+# composited over an opaque-black background. (See bug 2036640)
+- name: gfx.webrender.opaque-backdrop-fallback
+ type: bool
+ value: true
+ mirror: once
+
# Disable wait of GPU execution completion
- name: gfx.webrender.wait-gpu-finished.disabled
type: bool
value: false
mirror: once

View File

@@ -0,0 +1,32 @@
diff --git a/toolkit/mozapps/update/common/registrycertificates.cpp b/toolkit/mozapps/update/common/registrycertificates.cpp
index f7f5acdfa08879a0ff3095e15eebf7b436cf5092..5915141b3f4a6d3536841cc1040e70afe033e058 100644
--- a/toolkit/mozapps/update/common/registrycertificates.cpp
+++ b/toolkit/mozapps/update/common/registrycertificates.cpp
@@ -33,9 +33,21 @@
*
* @return TRUE if the binary matches any of the allowed certificates.
*/
+// TEMPORARY: accept any binary without consulting the allowed-certificate
+// values. Those values are only ever written by an installer run, so after a
+// signing certificate change every existing install still names the previous
+// certificate, the maintenance service refuses the newly signed binaries, and
+// updates fall back to prompting for elevation every time. Remove this define
+// and the block below once installs have been migrated.
+#define ZEN_SKIP_ALLOWED_CERTIFICATE_CHECK 1
+
BOOL DoesBinaryMatchAllowedCertificates(LPCWSTR basePathForUpdate,
LPCWSTR filePath,
BOOL allowFallbackKeySkip) {
+#ifdef ZEN_SKIP_ALLOWED_CERTIFICATE_CHECK
+ LOG(("Skipping the allowed certificate check for \"%ls\"", filePath));
+ return TRUE;
+#else
#ifdef DISABLE_UPDATER_AUTHENTICODE_CHECK
if (allowFallbackKeySkip) {
LOG_WARN(("Skipping authenticode check"));
@@ -163,4 +175,5 @@ BOOL DoesBinaryMatchAllowedCertificates(LPCWSTR basePathForUpdate,
RegCloseKey(baseKey);
// No certificates match, :'(
return FALSE;
+#endif // ZEN_SKIP_ALLOWED_CERTIFICATE_CHECK
}

View File

@@ -54,5 +54,9 @@
{
"type": "local",
"path": "firefox/css_corner_shape_rendering.patch"
},
{
"type": "local",
"path": "firefox/override_cert_checks_temp.patch"
}
]

View File

@@ -198,45 +198,36 @@ export class nsGithubLiveFolderProvider extends nsZenLiveFolderProvider {
}
const document = new DOMParser().parseFromString(text, "text/html");
const issues = document.querySelectorAll(
"div[class^=IssueItem-module__defaultRepoContainer]"
const links = document.querySelectorAll(
'a[data-testid="issue-listitem-title-link"]'
);
const items = [];
const activeRepos = new Set();
if (issues.length) {
const authors = document.querySelectorAll(
"a[class^=IssueItem-module__authorCreatedLink]"
for (const link of links) {
const issueUrl = new URL(link.getAttribute("href"), this.state.url);
const pathMatch = issueUrl.pathname.match(
/^\/([^/]+\/[^/]+)\/(?:issues|pull)\/([0-9]+)/
);
const titles = document.querySelectorAll(
"div[class^=Title-module__container]"
);
const links = document.querySelectorAll(
'[data-testid="issue-pr-title-link"]'
);
for (let i = 0; i < issues.length; i++) {
const [rawRepo, rawNumber] = issues[i].childNodes;
const author = authors[i]?.textContent;
const title = titles[i]?.textContent;
const issueUrl = links[i]?.href;
const repo = rawRepo.textContent?.trim();
if (repo) {
activeRepos.add(repo);
}
const numberMatch = rawNumber?.textContent?.match(/[0-9]+/);
const number = numberMatch?.[0] ?? "";
items.push({
title,
subtitle: author,
icon: "chrome://browser/content/zen-images/favicons/github.svg",
url: "https://github.com" + issueUrl,
id: `${repo}#${number}`,
});
if (!pathMatch) {
continue;
}
const [, repo, number] = pathMatch;
activeRepos.add(repo);
const author = link
.closest("li")
?.querySelector('[data-testid="author-filter-link"]')
?.lastChild?.textContent.trim();
items.push({
title: link.textContent.trim(),
subtitle: author,
icon: "chrome://browser/content/zen-images/favicons/github.svg",
url: issueUrl.href,
id: `${repo}#${number}`,
});
}
return {

View File

@@ -1509,7 +1509,7 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
baseColor = this.blendColors(
accentColor,
baseColor.slice(0, 3),
this.canBeTransparent ? 25 : 5
this.canBeTransparent ? 20 : 5
).concat(opacity);
}
return baseColor;
@@ -1538,16 +1538,16 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
return;
}
if (theme === null) {
browser.gZenThemePicker.invalidateGradientCache(uuid);
}
// Do not rebuild if the workspace is not the same as the current one
const windowWorkspace = browser.gZenWorkspaces.getActiveWorkspace();
if (windowWorkspace.uuid !== uuid) {
return;
}
if (theme === null) {
browser.gZenThemePicker.invalidateGradientCache(uuid);
}
// get the theme from the window
workspaceTheme = this.fixTheme(theme || windowWorkspace.theme);
const docElement = browser.document.documentElement;
@@ -1983,9 +1983,7 @@ export class nsZenThemePicker extends nsZenMultiWindowFeature {
invalidateGradientCache(uuid) {
delete this.#gradientsCache[uuid];
window.dispatchEvent(
new Event("ZenGradientCacheChanged", { bubbles: true })
);
gZenWorkspaces.workspaceElement(uuid)?.onGradientCacheChanged();
}
getGradientForWorkspace(workspace, { getGradient = true } = {}) {

View File

@@ -268,12 +268,6 @@ export class nsZenWorkspace extends MozXULElement {
this.#updateOverflow();
this.onGradientCacheChanged = this.#onGradientCacheChanged.bind(this);
window.addEventListener(
"ZenGradientCacheChanged",
this.onGradientCacheChanged
);
this.pinnedTabsContainer.addEventListener("TabPinned", () => {
// If a tab is pinned and the pinned tabs section is collapsed, uncollapse it.
if (this.collapsiblePins.collapsed) {
@@ -300,13 +294,6 @@ export class nsZenWorkspace extends MozXULElement {
});
}
disconnectedCallback() {
window.removeEventListener(
"ZenGradientCacheChanged",
this.onGradientCacheChanged
);
}
get active() {
return this.hasAttribute("active");
}
@@ -395,7 +382,7 @@ export class nsZenWorkspace extends MozXULElement {
return this.querySelector("#tabs-newtab-button");
}
#onGradientCacheChanged() {
onGradientCacheChanged() {
const { isDarkMode, isExplicitMode, toolbarColor, primaryColor } =
gZenThemePicker.getGradientForWorkspace(
gZenWorkspaces.getWorkspaceFromId(this.workspaceUuid),

View File

@@ -653,12 +653,24 @@ class nsZenSpacesSyncModel {
return this.projections().get(id) ?? null;
}
/**
* Before the session file is read the sidebar reads as empty. Diffing that
* against the uploaded snapshot would tombstone every synced item. An
* initialized sidebar always holds at least one space.
*/
#sidebarReady() {
return !!lazy.ZenSessionStore.getSidebarData()?.spaces?.length;
}
/**
* Changes = diff between the current projections and the last state the
* server acknowledged. Ids present locally with different content are
* modified; ids only present in the uploaded snapshot are deletions.
*/
computeChangedIDs() {
if (!this.#sidebarReady()) {
return {};
}
const uploaded = this.#data().uploaded;
const current = this.#digestAll();
const pending = this.#pendingIds();
@@ -687,6 +699,9 @@ class nsZenSpacesSyncModel {
}
hasPendingChanges() {
if (!this.#sidebarReady()) {
return false;
}
const uploaded = this.#data().uploaded;
const current = this.#digestAll();
const pending = this.#pendingIds();

View File

@@ -130,18 +130,22 @@ add_task(async function test_html_parsing_logic() {
const mockHtml = `
<html>
<body>
<div>
<div class="IssueItem-module__defaultRepoContainer"><span>mozilla/zen</span><span>#101</span></div>
<a class="IssueItem-module__authorCreatedLink">UserA</a>
<div class="Title-module__container">Fix the login bug</div>
<a data-testid="issue-pr-title-link" href="/issues/101"></a>
</div>
<div>
<div class="IssueItem-module__defaultRepoContainer"><span>mozilla/zen</span><span>#102</span></div>
<a class="IssueItem-module__authorCreatedLink">UserB</a>
<div class="Title-module__container">Add dark mode</div>
<a data-testid="issue-pr-title-link" href="/pull/102"></a>
</div>
<ul>
<li class="ListItem-module__listItem__wBJcm">
<h4><a data-testid="issue-listitem-title-link" href="https://github.com/mozilla/zen/issues/101"><span><span>Fix the login bug</span></span></a></h4>
<div class="Description-module__container__hpqJz">
<span>zen-browser/desktop#101</span>
<span> · <button data-testid="author-filter-link"><span class="prc-VisuallyHidden-VisuallyHidden-Q0qSB">Filter by author </span>UserA</button></span>
</div>
</li>
<li class="ListItem-module__listItem__wBJcm">
<h4><a data-testid="issue-listitem-title-link" href="https://github.com/mozilla/zen/pull/102"><span><span>Add dark mode</span></span></a></h4>
<div class="Description-module__container__hpqJz">
<span>zen-browser/desktop#102</span>
<span> · <button data-testid="author-filter-link"><span class="prc-VisuallyHidden-VisuallyHidden-Q0qSB">Filter by author </span>UserB</button></span>
</div>
</li>
</ul>
</body>
</html>
`;
@@ -158,12 +162,15 @@ add_task(async function test_html_parsing_logic() {
Assert.equal(items[0].title, "Fix the login bug");
Assert.equal(items[0].subtitle, "UserA");
Assert.equal(items[0].id, "mozilla/zen#101");
Assert.equal(items[0].url, "https://github.com/issues/101");
Assert.equal(
items[0].url,
"https://github.com/zen-browser/desktop/issues/101"
);
Assert.equal(items[1].title, "Add dark mode");
Assert.equal(items[1].subtitle, "UserB");
Assert.equal(items[1].id, "mozilla/zen#102");
Assert.equal(items[1].url, "https://github.com/pull/102");
Assert.equal(items[1].url, "https://github.com/zen-browser/desktop/pull/102");
sandbox.restore();
});

View File

@@ -5,8 +5,8 @@
"binaryName": "zen",
"version": {
"product": "firefox",
"version": "155.0",
"candidate": "155.0",
"version": "155.0.1",
"candidate": "155.0.1",
"candidateBuild": 1
},
"buildOptions": {