diff --git a/dom/base/Link.h b/dom/base/Link.h index 0974d6108c..99a5735110 100644 --- a/dom/base/Link.h +++ b/dom/base/Link.h @@ -13,6 +13,7 @@ #include "mozilla/IHistory.h" #include "mozilla/MemoryReporting.h" #include "nsIContent.h" // for nsLinkState +#include "nsIContentPolicyBase.h" // for nsContentPolicyType namespace mozilla { diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index d994716d32..5d5490206d 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -4171,7 +4171,7 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess already_AddRefed GetPatternFor(Style aStyle) { const CanvasPattern* pat = mCtx->CurrentState().patternStyles[aStyle]; - RefPtr pattern = new gfxPattern(pat->mSurface, Matrix()); + RefPtr pattern = new gfxPattern(pat->mSurface, pat->mTransform); pattern->SetExtend(CvtCanvasRepeatToGfxRepeat(pat->mRepeat)); return pattern.forget(); } diff --git a/dom/html/HTMLSlotElement.cpp b/dom/html/HTMLSlotElement.cpp index 9286ff9591..eb5b48c22a 100644 --- a/dom/html/HTMLSlotElement.cpp +++ b/dom/html/HTMLSlotElement.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/ShadowRoot.h" #include "nsGkAtoms.h" #include "nsDocument.h" +#include "nsLayoutUtils.h" nsGenericHTMLElement* NS_NewHTMLSlotElement(already_AddRefed&& aNodeInfo, diff --git a/dom/html/TextTrackManager.cpp b/dom/html/TextTrackManager.cpp index 1809478f2d..4b69675a0d 100644 --- a/dom/html/TextTrackManager.cpp +++ b/dom/html/TextTrackManager.cpp @@ -11,6 +11,7 @@ #include "mozilla/dom/TextTrackCue.h" #include "mozilla/dom/Event.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/CycleCollectedJSContext.h" #include "nsComponentManagerUtils.h" #include "nsVariant.h" #include "nsVideoFrame.h" diff --git a/dom/html/nsHTMLDNSPrefetch.cpp b/dom/html/nsHTMLDNSPrefetch.cpp index 1b91d8041d..2f55f9672b 100644 --- a/dom/html/nsHTMLDNSPrefetch.cpp +++ b/dom/html/nsHTMLDNSPrefetch.cpp @@ -15,6 +15,7 @@ #include "nsNetUtil.h" #include "nsNetCID.h" #include "nsIProtocolHandler.h" +#include "nsContentUtils.h" #include "nsIDNSListener.h" #include "nsIWebProgressListener.h" diff --git a/netwerk/protocol/http/nsCORSListenerProxy.cpp b/netwerk/protocol/http/nsCORSListenerProxy.cpp index add904092a..fdb6bb97e5 100644 --- a/netwerk/protocol/http/nsCORSListenerProxy.cpp +++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp @@ -215,15 +215,18 @@ static bool EnsurePreflightCache() void nsPreflightCache::CacheEntry::PurgeExpired(TimeStamp now) { - uint32_t i; - for (i = 0; i < mMethods.Length(); ++i) { + for (uint32_t i = 0, len = mMethods.Length(); i < len; ++i) { if (now >= mMethods[i].expirationTime) { - mMethods.RemoveElementAt(i--); + mMethods.UnorderedRemoveElementAt(i); + --i; // Examine the element again, if necessary. + --len; } } - for (i = 0; i < mHeaders.Length(); ++i) { + for (uint32_t i = 0, len = mHeaders.Length(); i < len; ++i) { if (now >= mHeaders[i].expirationTime) { - mHeaders.RemoveElementAt(i--); + mHeaders.UnorderedRemoveElementAt(i); + --i; // Examine the element again, if necessary. + --len; } } } @@ -235,25 +238,26 @@ nsPreflightCache::CacheEntry::CheckRequest(const nsCString& aMethod, PurgeExpired(TimeStamp::NowLoRes()); if (!aMethod.EqualsLiteral("GET") && !aMethod.EqualsLiteral("POST")) { - uint32_t i; - for (i = 0; i < mMethods.Length(); ++i) { - if (aMethod.Equals(mMethods[i].token)) - break; - } - if (i == mMethods.Length()) { + struct CheckToken { + bool Equals(const TokenTime& e, const nsCString& method) const { + return e.token.Equals(method); + } + }; + + if (!mMethods.Contains(aMethod, CheckToken())) { return false; } } - for (uint32_t i = 0; i < aHeaders.Length(); ++i) { - uint32_t j; - for (j = 0; j < mHeaders.Length(); ++j) { - if (aHeaders[i].Equals(mHeaders[j].token, - nsCaseInsensitiveCStringComparator())) { - break; - } + struct CheckHeaderToken { + bool Equals(const TokenTime& e, const nsCString& header) const { + return e.token.Equals(header, comparator); } - if (j == mHeaders.Length()) { + + const nsCaseInsensitiveCStringComparator comparator; + } checker; + for (uint32_t i = 0; i < aHeaders.Length(); ++i) { + if (!mHeaders.Contains(aHeaders[i], checker)) { return false; } } @@ -1382,8 +1386,8 @@ nsCORSPreflightListener::CheckPreflightRequestApproved(nsIRequest* aRequest) ) { continue; } - if (!headers.Contains(mPreflightHeaders[i], - nsCaseInsensitiveCStringArrayComparator())) { + const auto& comparator = nsCaseInsensitiveCStringArrayComparator(); + if (!headers.Contains(mPreflightHeaders[i], comparator)) { LogBlockedRequest(aRequest, "CORSMissingAllowHeaderFromPreflight", NS_ConvertUTF8toUTF16(mPreflightHeaders[i]).get()); return NS_ERROR_DOM_BAD_URI;