From c7e103b06e019832a7aa6ea91cf0d20f14796bc9 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 22 Aug 2025 01:28:16 +0200 Subject: [PATCH 1/7] No issue - Clarify Azure Back-end info. Only mention OpenGL accelerated canvas flag when it's relevant, and rename the entry to be more descriptive, to prevent confusion for users looking at Troubleshooting Information. --- gfx/thebes/gfxPlatform.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 178d261091..d939214ad5 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -272,7 +272,9 @@ public: virtual void GetAzureBackendInfo(mozilla::widget::InfoObject &aObj) { aObj.DefineProperty("AzureCanvasBackend", GetBackendName(mPreferredCanvasBackend)); - aObj.DefineProperty("AzureCanvasAccelerated", AllowOpenGLCanvas()); + if (mPreferredCanvasBackend == mozilla::gfx::BackendType::SKIA) { + aObj.DefineProperty("AzureCanvasSkiaOpenGL", AllowOpenGLCanvas()); + } aObj.DefineProperty("AzureFallbackCanvasBackend", GetBackendName(mFallbackCanvasBackend)); aObj.DefineProperty("AzureContentBackend", GetBackendName(mContentBackend)); } From 060e2965b83785c847f4e60feff3e1e5a6aa5484 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 27 Aug 2025 15:53:56 +0200 Subject: [PATCH 2/7] Revert "[gfx] Guard against possible race via gfxFontEntry::GetFontTable." This reverts commit a1cf966815240aef59e33c49c9496e3516b1fdd7. --- gfx/thebes/gfxFontEntry.cpp | 13 ++++--------- gfx/thebes/gfxFontEntry.h | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index bfc7cee2f7..e8bb39e689 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -495,7 +495,7 @@ public: private: // The font table data block - const nsTArray mTableData; + nsTArray mTableData; // The blob destroy function needs to know the owning font entry // so that it can hold the font-entry's reference while modifying the @@ -591,16 +591,11 @@ gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag, mFontTableCache = MakeUnique>(8); } - FontTableHashEntry* entry; - if (MOZ_UNLIKELY(entry = mFontTableCache->GetEntry(aTag))) { - // We must have been racing with another GetFontTable for the same table, - // and it won the race and filled in the entry before us. - // Ignore `aBuffer` in that case, and return a reference to the existing blob. - return entry->GetBlob(); + FontTableHashEntry *entry = mFontTableCache->PutEntry(aTag); + if (MOZ_UNLIKELY(!entry)) { // OOM + return nullptr; } - entry = mFontTableCache->PutEntry(aTag); - if (!aBuffer) { // ensure the entry is null entry->Clear(); diff --git a/gfx/thebes/gfxFontEntry.h b/gfx/thebes/gfxFontEntry.h index 04f27a3799..162fe4f083 100644 --- a/gfx/thebes/gfxFontEntry.h +++ b/gfx/thebes/gfxFontEntry.h @@ -265,7 +265,7 @@ public: // unregisters the table from the font entry. // // Pass nullptr for aBuffer to indicate that the table is not present and - // nullptr will be returned. + // nullptr will be returned. Also returns nullptr on OOM. hb_blob_t *ShareFontTableAndGetBlob(uint32_t aTag, nsTArray* aTable); From 6e19656e1196fc68feeb4f0122ba42a4b9101d24 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 27 Aug 2025 17:20:22 +0200 Subject: [PATCH 3/7] [gfx] Clarify comments. There may be other situations where putting a font entry in the cache table may fail that are perfectly valid. --- gfx/thebes/gfxFontEntry.cpp | 3 ++- gfx/thebes/gfxFontEntry.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index e8bb39e689..e07415983a 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -592,7 +592,8 @@ gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag, } FontTableHashEntry *entry = mFontTableCache->PutEntry(aTag); - if (MOZ_UNLIKELY(!entry)) { // OOM + if (MOZ_UNLIKELY(!entry)) { + // OOM or other issue storing the entry. return nullptr; } diff --git a/gfx/thebes/gfxFontEntry.h b/gfx/thebes/gfxFontEntry.h index 162fe4f083..506c240270 100644 --- a/gfx/thebes/gfxFontEntry.h +++ b/gfx/thebes/gfxFontEntry.h @@ -265,7 +265,8 @@ public: // unregisters the table from the font entry. // // Pass nullptr for aBuffer to indicate that the table is not present and - // nullptr will be returned. Also returns nullptr on OOM. + // nullptr will be returned. Also returns nullptr on OOM or when there are + // other issues storing the entry in the cache table. hb_blob_t *ShareFontTableAndGetBlob(uint32_t aTag, nsTArray* aTable); From 16164b3d38496ac585dc752b3f51ebcf1c958931 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 18 Sep 2025 09:45:30 +0200 Subject: [PATCH 4/7] Issue #2852 - Parse full cache-control headers. This makes sure we parse the merged/stored version of `cache-control` instead of just the latest-received header. `ResponseHead::ParseHeaderLine_locked` parses each header as it comes in. It then updates its member variables based on that header. For `cache-control`, it's important to reparse the merged (updated) version of the header instead of the most recent one, otherwise we'll miss directives present in previously received headers. Resolves #2852 --- netwerk/protocol/http/nsHttpResponseHead.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index 5e119ba437..6bb328f823 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -633,7 +633,7 @@ nsHttpResponseHead::ParseHeaderLine_locked(const nsACString &line, bool original mContentType, mContentCharset, &dummy); } else if (hdr == nsHttp::Cache_Control) - ParseCacheControl(val.get()); + ParseCacheControl(mHeaders.PeekHeader(hdr)); else if (hdr == nsHttp::Pragma) ParsePragma(val.get()); return NS_OK; From 3a121f34c8e6f443201f0774f769458be174ffb5 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 18 Sep 2025 11:42:40 +0200 Subject: [PATCH 5/7] [gfx] Use std::size rather than hardcoding an array size --- gfx/2d/FilterProcessingScalar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gfx/2d/FilterProcessingScalar.cpp b/gfx/2d/FilterProcessingScalar.cpp index 9e88c563e4..cd9e6f53fa 100644 --- a/gfx/2d/FilterProcessingScalar.cpp +++ b/gfx/2d/FilterProcessingScalar.cpp @@ -45,12 +45,12 @@ ApplyMorphologyHorizontal_Scalar(uint8_t* aSourceData, int32_t aSourceStride, for (int32_t x = aDestRect.x; x < aDestRect.XMost(); x++, startX++, endX++) { int32_t sourceIndex = y * aSourceStride + 4 * startX; uint8_t u[4]; - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { u[i] = aSourceData[sourceIndex + i]; } sourceIndex += 4; for (int32_t ix = startX + 1; ix <= endX; ix++, sourceIndex += 4) { - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { if (Operator == MORPHOLOGY_OPERATOR_ERODE) { u[i] = umin(u[i], aSourceData[sourceIndex + i]); } else { @@ -60,7 +60,7 @@ ApplyMorphologyHorizontal_Scalar(uint8_t* aSourceData, int32_t aSourceStride, } int32_t destIndex = y * aDestStride + 4 * x; - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { aDestData[destIndex+i] = u[i]; } } @@ -97,12 +97,12 @@ static void ApplyMorphologyVertical_Scalar(uint8_t* aSourceData, int32_t aSource for (int32_t x = aDestRect.x; x < aDestRect.XMost(); x++) { int32_t sourceIndex = startY * aSourceStride + 4 * x; uint8_t u[4]; - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { u[i] = aSourceData[sourceIndex + i]; } sourceIndex += aSourceStride; for (int32_t iy = startY + 1; iy <= endY; iy++, sourceIndex += aSourceStride) { - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { if (Operator == MORPHOLOGY_OPERATOR_ERODE) { u[i] = umin(u[i], aSourceData[sourceIndex + i]); } else { @@ -112,7 +112,7 @@ static void ApplyMorphologyVertical_Scalar(uint8_t* aSourceData, int32_t aSource } int32_t destIndex = y * aDestStride + 4 * x; - for (size_t i = 0; i < 4; i++) { + for (int32_t i = 0; i < int32_t(std::size(u)); i++) { aDestData[destIndex+i] = u[i]; } } From 1bcdad3ef1b2039b1de8f078ee8671987d11f0f7 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 18 Sep 2025 12:00:05 +0200 Subject: [PATCH 6/7] Issue #2852 - Follow-up: Add comment and fix formatting. --- netwerk/protocol/http/nsHttpResponseHead.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index 6bb328f823..4c3c2cd639 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -620,22 +620,22 @@ nsHttpResponseHead::ParseHeaderLine_locked(const nsACString &line, bool original // permit only a single value here. if (nsHttp::ParseInt64(val.get(), &ignored, &len)) { mContentLength = len; - } - else { + } else { // If this is a negative content length then just ignore it LOG(("invalid content-length! %s\n", val.get())); } - } - else if (hdr == nsHttp::Content_Type) { + } else if (hdr == nsHttp::Content_Type) { LOG(("ParseContentType [type=%s]\n", val.get())); bool dummy; net_ParseContentType(val, mContentType, mContentCharset, &dummy); - } - else if (hdr == nsHttp::Cache_Control) + } else if (hdr == nsHttp::Cache_Control) { + // Re-parse merged header in its entirety. See Issue #2852 ParseCacheControl(mHeaders.PeekHeader(hdr)); - else if (hdr == nsHttp::Pragma) + } else if (hdr == nsHttp::Pragma) { ParsePragma(val.get()); + } + return NS_OK; } From c9e08cb2f58cc4ea180df2076a2b448aa25c22bb Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 19 Sep 2025 21:03:13 +0200 Subject: [PATCH 7/7] Issue #2790 - Follow-up: Ensure both text and background are set. The common issue of needing to set both foreground and background for dark themes. --- layout/style/res/forms.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css index 8d8c53e148..260512eb4f 100644 --- a/layout/style/res/forms.css +++ b/layout/style/res/forms.css @@ -111,7 +111,7 @@ input:-moz-autofill-highlight, select:-moz-autofill-highlight, textarea:-moz-autofill-highlight { background-color: #fffcd0 !important; - color: #090909; + color: #090909 !important; } input > .anonymous-div,