Compare commits

...
31 Commits
Author SHA1 Message Date
wolfbeast 1530f48c27 Improve origin-clean algorithm based on our previous changes.
- Instead of trying the failing refactored Mozilla way, simply add a
check where needed building on what was put in place previously.
2019-06-08 19:32:47 +02:00
wolfbeast 684778cb22 Revert "Improve origin-clean algorithm"
This reverts commit e69b3f567c.
2019-06-08 19:31:36 +02:00
wolfbeast dee00a8a79 Merge branch 'master' into Basilisk-release 2019-06-04 18:21:04 +02:00
wolfbeast 851cfd198b Simplify some alias sets in IonMonkey. 2019-03-26 18:42:38 +01:00
wolfbeast 1e1525c44c Merge commit 'eb77e289bbe056b58051db0fa868e95da803aa0a' into Basilisk-release 2019-03-26 18:41:32 +01:00
wolfbeast e25ad54395 Merge branch 'master' into Basilisk-release 2019-03-06 12:30:20 +01:00
wolfbeast 74533a8432 Expose TLS 1.3 cipher suite prefs. 2019-02-10 09:00:44 +01:00
wolfbeast 7715472ae4 Merge branch 'master' into Basilisk-release 2019-02-08 13:21:03 +01:00
wolfbeast 2b3b0e053e Merge branch 'master' into Basilisk-release 2019-02-07 23:03:00 +01:00
wolfbeast e66dd9ee75 Merge branch 'master' into Basilisk-release 2019-02-07 22:18:49 +01:00
wolfbeast 0dca00b282 Merge branch 'master' into Basilisk-release 2019-02-07 16:32:52 +01:00
wolfbeast 76fe52eb81 Merge branch 'master' into Basilisk-release 2018-12-18 11:39:00 +01:00
wolfbeast 63635e38ff Merge branch 'master' into Basilisk-release 2018-11-07 06:01:03 +01:00
wolfbeast 1626b5d704 Merge branch 'master' into Basilisk-release 2018-11-03 09:06:25 +01:00
wolfbeast 314fb761d1 Merge branch 'master' into Basilisk-release 2018-09-27 09:07:52 +02:00
wolfbeast fbaab39c94 Merge branch 'master' into Basilisk-release 2018-09-27 09:05:25 +02:00
wolfbeast 580084e9e1 Merge branch 'master' into Basilisk-release 2018-09-04 20:53:31 +02:00
wolfbeast fc61780b35 Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-release
# Conflicts:
#	browser/app/profile/firefox.js
#	browser/components/preferences/jar.mn
2018-07-18 08:24:24 +02:00
wolfbeast 69f7f9e5f1 Pre-process blocklists.js 2018-06-01 00:46:44 +02:00
wolfbeast 2d4ff8df91 Merge branch 'master' into Basilisk-release 2018-05-31 09:45:25 +02:00
wolfbeast f4b8be889c Merge branch 'master' into Basilisk-release 2018-05-14 12:21:38 +02:00
wolfbeast e9dd029f5d Merge branch 'master' into Basilisk-release 2018-05-14 10:50:01 +02:00
wolfbeast 9d6a7ae25d Merge branch 'master' into Basilisk-release 2018-04-27 01:28:11 +02:00
wolfbeast 42f8488a5f Merge branch 'master' into Basilisk-release 2018-04-25 23:08:37 +02:00
wolfbeast 681c39a0ec Hard-code the version number for Mozilla's version checker for add-ons. 2018-04-23 17:21:17 +02:00
wolfbeast 55eb2832f5 Set preferences for release. 2018-04-22 20:41:43 +02:00
wolfbeast 003273327d Make sure to keep the safebrowsing entities valid. 2018-04-22 18:17:19 +02:00
wolfbeast 650371311d Update about:rights legal text. 2018-04-22 14:59:26 +02:00
wolfbeast 1fccd9d8ee Remove undesired system add-ons (all except PDFjs) 2018-04-22 13:19:49 +02:00
wolfbeast f2f6f7e8b0 Disable Mozilla health report service. 2018-04-22 13:16:44 +02:00
wolfbeast e73929a782 Remove NPAPI deprecation statement from about:plugins. 2018-04-22 13:08:18 +02:00
6 changed files with 46 additions and 43 deletions

No files matched your search

@@ -41,8 +41,7 @@ pref("app.update.url.details", "https://@BRANDING_SITEURL@/@BRANDING_RELNOTESPAT
pref("general.useragent.compatMode.firefox",true);
pref("general.useragent.compatMode.gecko",true);
// Switch Application Updates off for now
pref("app.update.enabled", false);
pref("app.update.enabled", true);
// Shared User Agent Overrides
#include ../../shared/uaoverrides.inc
+10 -9
View File
@@ -2406,11 +2406,7 @@ CanvasRenderingContext2D::SetStyleFromUnion(const StringOrCanvasGradientOrCanvas
}
if (aValue.IsCanvasPattern()) {
CanvasPattern& pattern = aValue.GetAsCanvasPattern();
SetStyleFromPattern(pattern, aWhichStyle);
if (pattern.mForceWriteOnly) {
SetWriteOnly();
}
SetStyleFromPattern(aValue.GetAsCanvasPattern(), aWhichStyle);
return;
}
@@ -2585,12 +2581,11 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource,
nsLayoutUtils::SurfaceFromElement(element,
nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget);
RefPtr<SourceSurface> surface = res.GetSourceSurface();
if (!surface) {
if (!res.GetSourceSurface()) {
return nullptr;
}
RefPtr<CanvasPattern> pat = new CanvasPattern(this, surface, repeatMode,
RefPtr<CanvasPattern> pat = new CanvasPattern(this, res.GetSourceSurface(), repeatMode,
res.mPrincipal, res.mIsWriteOnly,
res.mCORSUsed);
return pat.forget();
@@ -4224,6 +4219,12 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
if (state->gradientStyles[style]) { // Gradient
pattern = GetGradientFor(style);
} else if (state->patternStyles[style]) { // Pattern
if (mCtx->mCanvasElement) {
CanvasUtils::DoDrawImageSecurityCheck(
mCtx->mCanvasElement, state->patternStyles[style]->mPrincipal,
state->patternStyles[style]->mForceWriteOnly,
state->patternStyles[style]->mCORSUsed);
}
pattern = GetPatternFor(style);
} else {
MOZ_ASSERT(false, "Should never reach here.");
@@ -4900,8 +4901,8 @@ CanvasRenderingContext2D::CachedSurfaceFromElement(Element* aElement)
res.mSize = res.mSourceSurface->GetSize();
res.mPrincipal = principal.forget();
res.mIsWriteOnly = false;
res.mImageRequest = imgRequest.forget();
res.mIsWriteOnly = CheckWriteOnlySecurity(res.mCORSUsed, res.mPrincipal);
return res;
}
-20
View File
@@ -126,25 +126,5 @@ CoerceDouble(const JS::Value& v, double* d)
return true;
}
bool CheckWriteOnlySecurity(bool aCORSUsed, nsIPrincipal* aPrincipal) {
if (!aPrincipal) {
return true;
}
if (!aCORSUsed) {
nsIGlobalObject* incumbentSettingsObject = dom::GetIncumbentGlobal();
if (NS_WARN_IF(!incumbentSettingsObject)) {
return true;
}
nsIPrincipal* principal = incumbentSettingsObject->PrincipalOrNull();
if (NS_WARN_IF(!principal) || !(principal->Subsumes(aPrincipal))) {
return true;
}
}
return false;
}
} // namespace CanvasUtils
} // namespace mozilla
-5
View File
@@ -11,7 +11,6 @@
#include "mozilla/dom/ToJSValue.h"
#include "jsapi.h"
#include "mozilla/FloatingPoint.h"
#include "nsLayoutUtils.h"
class nsIPrincipal;
@@ -157,10 +156,6 @@ DashArrayToJSVal(nsTArray<T>& dashes,
}
}
// returns true if write-only mode must used for this principal based on
// the incumbent global.
bool CheckWriteOnlySecurity(bool aCORSUsed, nsIPrincipal* aPrincipal);
} // namespace CanvasUtils
} // namespace mozilla
+32 -2
View File
@@ -315,6 +315,36 @@ private:
const Maybe<IntRect>& mCropRect;
};
static bool
CheckSecurityForHTMLElements(bool aIsWriteOnly, bool aCORSUsed, nsIPrincipal* aPrincipal)
{
MOZ_ASSERT(aPrincipal);
if (aIsWriteOnly) {
return false;
}
if (!aCORSUsed) {
nsIGlobalObject* incumbentSettingsObject = GetIncumbentGlobal();
if (NS_WARN_IF(!incumbentSettingsObject)) {
return false;
}
nsIPrincipal* principal = incumbentSettingsObject->PrincipalOrNull();
if (NS_WARN_IF(!principal) || !(principal->Subsumes(aPrincipal))) {
return false;
}
}
return true;
}
static bool
CheckSecurityForHTMLElements(const nsLayoutUtils::SurfaceFromElementResult& aRes)
{
return CheckSecurityForHTMLElements(aRes.mIsWriteOnly, aRes.mCORSUsed, aRes.mPrincipal);
}
/*
* A wrapper to the nsLayoutUtils::SurfaceFromElement() function followed by the
* security checking.
@@ -335,7 +365,7 @@ GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement,
}
// Check origin-clean and pass back
*aWriteOnly = res.mIsWriteOnly;
*aWriteOnly = !CheckSecurityForHTMLElements(res);
return surface.forget();
}
@@ -788,7 +818,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
nsCOMPtr<nsIPrincipal> principal = aVideoEl.GetCurrentVideoPrincipal();
bool CORSUsed = aVideoEl.GetCORSMode() != CORS_NONE;
writeOnly = CheckWriteOnlySecurity(CORSUsed, principal);
writeOnly = !CheckSecurityForHTMLElements(false, CORSUsed, principal);
// Create ImageBitmap.
ImageContainer *container = aVideoEl.GetImageContainer();
+3 -5
View File
@@ -8,7 +8,6 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/dom/CanvasUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
@@ -7286,10 +7285,10 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement,
}
result.mPrincipal = principal.forget();
// no images, including SVG images, can load content from another domain.
result.mIsWriteOnly = false;
result.mImageRequest = imgRequest.forget();
return result;
result.mIsWriteOnly =
CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal);
}
nsLayoutUtils::SurfaceFromElementResult
@@ -7401,8 +7400,7 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,
result.mHasSize = true;
result.mSize = result.mLayersImage->GetSize();
result.mPrincipal = principal.forget();
result.mIsWriteOnly =
CanvasUtils::CheckWriteOnlySecurity(result.mCORSUsed, result.mPrincipal);
result.mIsWriteOnly = false;
return result;
}