Browse Source

A few backports

Frank-Rainer Grahl 11 months ago
parent
commit
5a1ba0ff84

+ 42 - 0
mozilla-release/patches/1721612-11506.patch

@@ -0,0 +1,42 @@
+# HG changeset patch
+# User Jonathan Kew <jkew@mozilla.com>
+# Date 1699698977 0
+# Node ID b12746b922ba93213cd524a8686cb9ee09af7fde
+# Parent  e44dd46d8c3e4deeaa2f12ae284a2ce2c8256e4a
+Bug 1721612 - Fix AdjustAdvancesForSyntheticBold to reliably handle negative adjustments. r=gfx-reviewers,lsalzman a=RyanVM
+
+This method (as its name suggests) was originally created to handle synthetic-bold,
+which only ever increases the advance, and so its use of an unsigned value for the
+adjustment worked ok.
+
+But when applying tracking, the adjustment may be negative, and assigning this to
+a uint32_t value takes us into undefined-behavior territory. It seems this worked
+"as expected" on x86_64 (using modulo arithmetic), but on arm64 the value just
+clamped to zero, and the intended negative tracking doesn't get applied.
+
+Making it an int32_t results in consistent behavior across both architectures.
+
+Differential Revision: https://phabricator.services.mozilla.com/D193288
+
+diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp
+--- a/gfx/thebes/gfxFont.cpp
++++ b/gfx/thebes/gfxFont.cpp
+@@ -715,17 +715,17 @@ gfxShapedText::FilterIfIgnorable(uint32_
+     return false;
+ }
+ 
+ void
+ gfxShapedText::AdjustAdvancesForSyntheticBold(float aSynBoldOffset,
+                                               uint32_t aOffset,
+                                               uint32_t aLength)
+ {
+-    uint32_t synAppUnitOffset = aSynBoldOffset * mAppUnitsPerDevUnit;
++    int32_t synAppUnitOffset = aSynBoldOffset * mAppUnitsPerDevUnit;
+     CompressedGlyph *charGlyphs = GetCharacterGlyphs();
+     for (uint32_t i = aOffset; i < aOffset + aLength; ++i) {
+          CompressedGlyph *glyphData = charGlyphs + i;
+          if (glyphData->IsSimpleGlyph()) {
+              // simple glyphs ==> just add the advance
+              int32_t advance = glyphData->GetSimpleAdvance() + synAppUnitOffset;
+              if (CompressedGlyph::IsSimpleAdvance(advance)) {
+                  glyphData->SetSimpleGlyph(advance, glyphData->GetSimpleGlyph());

+ 39 - 0
mozilla-release/patches/1801501-PARTIAL-NOTESTS-120a1.patch

@@ -0,0 +1,39 @@
+# HG changeset patch
+# User june wilde <jewilde@mozilla.com>
+# Date 1695838763 0
+# Node ID b8981c31d4b9f3b2ae88588f41997f07c521e3f1
+# Parent  6754aa0d520d29fd8a7299289d38ae03317183ab
+Bug 1801501 - Check if rootDoc is secure context for web compat; r=ckerschb
+
+Differential Revision: https://phabricator.services.mozilla.com/D175134
+
+diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp
+--- a/dom/security/nsMixedContentBlocker.cpp
++++ b/dom/security/nsMixedContentBlocker.cpp
+@@ -757,21 +757,21 @@ nsMixedContentBlocker::ShouldLoad(bool a
+     return rv;
+   }
+ 
+   // Get the sameTypeRoot tree item from the docshell
+   nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
+   docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+   NS_ASSERTION(sameTypeRoot, "No root tree item from docshell!");
+ 
+-  // When navigating an iframe, the iframe may be https
+-  // but its parents may not be.  Check the parents to see if any of them are https.
+-  // If none of the parents are https, allow the load.
+-  if (aContentType == TYPE_SUBDOCUMENT && !rootHasSecureConnection) {
+-
++  // When navigating an iframe, the iframe may be https but its parents may not
++  // be. Check the parents to see if any of them are https. If none of the
++  // parents are https, allow the load.
++  if (aContentType == TYPE_SUBDOCUMENT &&
++      !rootHasSecureConnection && !parentIsHttps) {
+     bool httpsParentExists = false;
+ 
+     nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
+     parentTreeItem = docShell;
+ 
+     while(!httpsParentExists && parentTreeItem) {
+       nsCOMPtr<nsIWebNavigation> parentAsNav(do_QueryInterface(parentTreeItem));
+       NS_ASSERTION(parentAsNav, "No web navigation object from parent's docshell tree item");

+ 55 - 0
mozilla-release/patches/1854076-11505.patch

@@ -0,0 +1,55 @@
+# HG changeset patch
+# User Andrew Sutherland <asutherland@asutherland.org>
+# Date 1698176456 0
+# Node ID d04b0067e2ec64e290fc887c316e0b5ee6eb2b34
+# Parent  ee0e86a44f87ac70fb1372d06a89bf3ef32dc4b3
+Bug 1854076 - ESR115 Improve MessagePort state machine. r=dom-worker-reviewers,edenchuang, a=dsmith
+
+Differential Revision: https://phabricator.services.mozilla.com/D191773
+
+diff --git a/dom/messagechannel/MessagePort.cpp b/dom/messagechannel/MessagePort.cpp
+--- a/dom/messagechannel/MessagePort.cpp
++++ b/dom/messagechannel/MessagePort.cpp
+@@ -248,16 +248,21 @@ MessagePort::MessagePort(nsIGlobalObject
+   mIdentifier = new MessagePortIdentifier();
+   mIdentifier->neutered() = true;
+   mIdentifier->sequenceId() = 0;
+ }
+ 
+ MessagePort::~MessagePort()
+ {
+   CloseForced();
++  MOZ_ASSERT(!mActor);
++  if (mActor) {
++    mActor->SetPort(nullptr);
++    mActor = nullptr;
++  }
+   MOZ_ASSERT(!mWorkerHolder);
+ }
+ 
+ /* static */ already_AddRefed<MessagePort>
+ MessagePort::Create(nsIGlobalObject* aGlobal, const nsID& aUUID,
+                     const nsID& aDestinationUUID, ErrorResult& aRv)
+ {
+   MOZ_ASSERT(aGlobal);
+@@ -325,16 +330,20 @@ MessagePort::Initialize(const nsID& aUUI
+ 
+   if (!NS_IsMainThread()) {
+     WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
+     MOZ_ASSERT(workerPrivate);
+     MOZ_ASSERT(!mWorkerHolder);
+ 
+     nsAutoPtr<WorkerHolder> workerHolder(new MessagePortWorkerHolder(this));
+     if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Closing))) {
++      // The worker is shutting down.
++// -      mState = eStateDisentangled;
++// -      UpdateMustKeepAlive();
++      CloseForced();
+       aRv.Throw(NS_ERROR_FAILURE);
+       return;
+     }
+ 
+     mWorkerHolder = Move(workerHolder);
+   } else if (GetOwner()) {
+     MOZ_ASSERT(NS_IsMainThread());
+     MOZ_ASSERT(GetOwner()->IsInnerWindow());

+ 39 - 0
mozilla-release/patches/1858570-11505.patch

@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Valentin Gosu <valentin.gosu@gmail.com>
+# Date 1697701228 0
+# Node ID ec15c0924e3973d5e1afb6117039964d233adc42
+# Parent  c830ddd5e555d3750eb60dc2b477ea7f7ba54d6f
+Bug 1858570 - Fix relative URL path starting with multiple slashes r=necko-reviewers,kershaw a=RyanVM
+
+Differential Revision: https://phabricator.services.mozilla.com/D190784
+
+diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp
+--- a/netwerk/base/nsStandardURL.cpp
++++ b/netwerk/base/nsStandardURL.cpp
+@@ -2576,17 +2576,25 @@ nsStandardURL::Resolve(const nsACString 
+         return NS_ERROR_OUT_OF_MEMORY;
+ 
+     if (resultPath)
+         net_CoalesceDirs(coalesceFlag, resultPath);
+     else {
+         // locate result path
+         resultPath = PL_strstr(result, "://");
+         if (resultPath) {
+-            resultPath = PL_strchr(resultPath + 3, '/');
++            // If there are multiple slashes after :// we must ignore them
++            // otherwise net_CoalesceDirs may think the host is a part of the path.
++            resultPath += 3;
++            if (protocol.IsEmpty() && !SegmentIs(mScheme,"file")) {
++              while (*resultPath == '/') {
++                resultPath++;
++              }
++            }
++            resultPath = PL_strchr(resultPath, '/');
+             if (resultPath)
+                 net_CoalesceDirs(coalesceFlag,resultPath);
+         }
+     }
+     out.Adopt(result);
+     return NS_OK;
+ }
+ 

+ 4 - 0
mozilla-release/patches/series

@@ -5183,3 +5183,7 @@ PPPPPPP-NSSgetentropy.patch
 1539780-70a1.patch
 1590907-5-72a1.patch
 1635764-78a1.patch
+1801501-PARTIAL-NOTESTS-120a1.patch
+1858570-11505.patch
+1854076-11505.patch
+1721612-11506.patch