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]; } } diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index bfc7cee2f7..e07415983a 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,12 @@ 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 or other issue storing the entry. + 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..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. + // 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); 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)); } 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, diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index 5e119ba437..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) - ParseCacheControl(val.get()); - else if (hdr == nsHttp::Pragma) + } 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) { ParsePragma(val.get()); + } + return NS_OK; }