Compare commits

...
29 Commits
Author SHA1 Message Date
Moonchild 71ae69aea8 [WebGL] Implement webgl.max-size-per-texture-mib 2022-10-26 14:50:05 +00:00
Moonchild 9e34d697c7 [XPCOM] Fix Base64 off-by-one issue and safeguard against this mistake in the future. 2022-10-26 14:49:55 +00:00
Moonchild 8fa9125d02 [No issue] Hold some strong references on nsRefreshDriver 2022-10-26 14:49:46 +00:00
Brian Smith 4b4488c3e4 Issue #2022 - Part 2 - Add Ventura version detection.
Also add Monterey and Ventura to the graphics driver blocklist.
2022-10-26 14:49:33 +00:00
Brian Smith 248db7d301 Issue #2022 - Part 1 - Fix transparent windows on MacOS 13 Ventura.
During the BaseWindow creation contenView is nil on Ventura...
So create a NSView with the requested dimensions and set is as the contenView.
2022-10-26 14:49:23 +00:00
Moonchild e199f2949b [No issue] Ensure LockImpl::Try() returns the correct bool value. 2022-10-26 14:45:39 +00:00
Moonchild 456b5450a4 Issue #2010 - Ensure raw tagnames are safe exiting internalEntityParser
This resolves #2010
2022-09-28 13:50:10 +00:00
Moonchild d8e629c4a3 Merge branch 'master' into release 2022-09-27 20:12:40 +00:00
Moonchild 4898c4f297 Merge branch 'master' into release 2022-09-24 12:16:59 +00:00
Moonchild 7cd578bbc6 Merge branch 'master' into release 2022-09-22 13:16:48 +00:00
Moonchild 1e91df628a Merge branch 'master' into release 2022-09-22 11:52:16 +00:00
Moonchild b110549cbd Merge branch 'master' into release 2022-07-27 06:07:45 +00:00
Moonchild 971047835a Merge branch 'master' into release
# Conflicts:
#	config/milestone.txt
#	toolkit/mozapps/extensions/internal/XPIProvider.jsm
2022-07-25 20:47:06 +00:00
Moonchild dd4d9eb032 [XPCOM] Crash safely when TArray replacements are OOB.
In the unlikely event of TArray element replacement calls are OOB, crash safely
with a debug breakpoint instead of corrupting memory.
2022-07-03 15:49:44 +00:00
Moonchild 8b94f1e480 [DOM] use the sanitizer to restrict href in svg:use to fragment-only URLs 2022-07-03 15:49:34 +00:00
Moonchild c89610a5c7 [network] Clear PAC loader when the load failed 2022-07-03 15:49:23 +00:00
Moonchild 217963cbed Update NSS to 3.52.7 2022-07-03 15:49:14 +00:00
Moonchild c4f4e18340 [DOM media] Remove potentially unsafe type accesses when debug logging 2022-07-03 15:49:04 +00:00
Moonchild 8a7c0e7345 [network] Clean up and update the list of external protocol handlers. 2022-07-03 15:48:54 +00:00
Moonchild 52e304d450 Issue #1053 - Follow-up: Correct conditional define on POSIX systems. (uplift)
This conditional was incorrectly changed when removing Android support.
This potentially causes issues on Linux systems by not using pthreads correctly,
which may lead to high idle CPU usage.
2022-06-28 13:28:20 +00:00
Moonchild cfc0eeca53 Revert "Issue #1909 - Guard against empty update manifest URL"
This reverts commit d7fadcdef9.
2022-06-07 11:59:07 +00:00
Moonchild ebd3dd9228 Merge branch 'master' into release 2022-06-03 21:50:44 +00:00
Moonchild cb40e4e7ef Merge branch 'master' into release 2022-06-01 13:54:11 +00:00
Moonchild 662dba55fd Merge branch 'master' into release 2022-05-29 11:13:44 +00:00
Moonchild 8760ce023c Issue #1895 - Implement queueMicroTask(callback()) (uplift) 2022-05-07 14:40:14 +00:00
Moonchild b86e148bb7 Roll back milestone version to release. 2022-05-06 12:43:43 +00:00
Moonchild 9e83721e5e Merge branch 'master' into release 2022-05-06 12:43:00 +00:00
Moonchild dc2d6c2e60 Revert "No Issue - Make content-type on JAR channels behave the same as HTTP channels."
This reverts commit 425677ada7.
2022-05-03 17:38:19 +00:00
Moonchild 4ada6f6762 Update 7zSD for v31 2022-05-03 17:38:12 +00:00
15 changed files with 94 additions and 38 deletions

No files matched your search

+1 -1
View File
@@ -2478,7 +2478,7 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(int64_t aMilliseconds)
nsPresContext* presContext = GetPresContext();
if (presContext) {
nsRefreshDriver* driver = presContext->RefreshDriver();
RefPtr<nsRefreshDriver> driver = presContext->RefreshDriver();
driver->AdvanceTimeAndRefresh(aMilliseconds);
RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
+36 -14
View File
@@ -303,13 +303,13 @@ WebGLContext::FromDomElem(const char* funcName, TexImageTarget target, uint32_t
uint32_t height, uint32_t depth, const dom::Element& elem,
ErrorResult* const out_error)
{
if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
if (canvas->IsWriteOnly()) {
out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
}
if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
if (canvas->IsWriteOnly()) {
out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
}
}
uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR;
@@ -1032,9 +1032,27 @@ ValidateCompressedTexImageRestrictions(const char* funcName, WebGLContext* webgl
}
static bool
ValidateTargetForFormat(const char* funcName, WebGLContext* webgl, TexImageTarget target,
const webgl::FormatInfo* format)
{
ValidateFormatAndSize(const char* funcName,
WebGLContext* webgl,
TexImageTarget target,
const webgl::FormatInfo* format,
const uint32_t width,
const uint32_t height,
const uint32_t depth) {
// Check if texture size will likely be rejected by the driver and give a more
// meaningful error message.
auto baseImageSize = CheckedInt<uint64_t>(format->estimatedBytesPerPixel) *
width * height * depth;
if (target == LOCAL_GL_TEXTURE_CUBE_MAP) {
baseImageSize *= 6;
}
if (!baseImageSize.isValid() ||
baseImageSize.value() > (uint64_t)gfxPrefs::WebGLMaxSizePerTextureMB * (1024 * 1024)) {
webgl->ErrorOutOfMemory("Texture size too large; base image MB > webgl.max-size-per-texture-mb");
return false;
}
// GLES 3.0.4 p127:
// "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL are
// supported by texture image specification commands only if `target` is TEXTURE_2D,
@@ -1137,7 +1155,8 @@ WebGLTexture::TexStorage(const char* funcName, TexTarget target, GLsizei levels,
}
auto dstFormat = dstUsage->format;
if (!ValidateTargetForFormat(funcName, mContext, testTarget, dstFormat))
if (!ValidateFormatAndSize(funcName, mContext, testTarget, dstFormat,
width, height, depth))
return;
if (dstFormat->compression) {
@@ -1264,7 +1283,8 @@ WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level,
// Check that source and dest info are compatible
auto dstFormat = dstUsage->format;
if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat))
if (!ValidateFormatAndSize(funcName, mContext, target, dstFormat,
blob->mWidth, blob->mHeight, blob->mDepth))
return;
if (!mContext->IsWebGL2() && dstFormat->d) {
@@ -1484,7 +1504,8 @@ WebGLTexture::CompressedTexImage(const char* funcName, TexImageTarget target, GL
return;
}
if (!ValidateTargetForFormat(funcName, mContext, target, format))
if (!ValidateFormatAndSize(funcName, mContext, target, format,
blob->mWidth, blob->mHeight, blob->mDepth))
return;
////////////////////////////////////
@@ -2143,7 +2164,8 @@ WebGLTexture::CopyTexImage2D(TexImageTarget target, GLint level, GLenum internal
return;
const auto& dstFormat = dstUsage->format;
if (!ValidateTargetForFormat(funcName, mContext, target, dstFormat))
if (!ValidateFormatAndSize(funcName, mContext, target, dstFormat,
width, height, depth))
return;
if (!mContext->IsWebGL2() && dstFormat->d) {
+1
View File
@@ -591,6 +591,7 @@ private:
DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false);
DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false);
DECL_GFX_PREF(Live, "webgl.max-warnings-per-context", WebGLMaxWarningsPerContext, uint32_t, 32);
DECL_GFX_PREF(Live, "webgl.max-size-per-texture-mb", WebGLMaxSizePerTextureMB, uint32_t, 1024);
DECL_GFX_PREF(Live, "webgl.min_capability_mode", WebGLMinCapabilityMode, bool, false);
DECL_GFX_PREF(Live, "webgl.msaa-force", WebGLForceMSAA, bool, false);
DECL_GFX_PREF(Live, "webgl.prefer-16bpp", WebGLPrefer16bpp, bool, false);
+5 -2
View File
@@ -212,9 +212,12 @@ SVGDocumentWrapper::TickRefreshDriver()
nsCOMPtr<nsIPresShell> presShell;
mViewer->GetPresShell(getter_AddRefs(presShell));
if (presShell) {
nsPresContext* presContext = presShell->GetPresContext();
RefPtr<nsPresContext> presContext = presShell->GetPresContext();
if (presContext) {
presContext->RefreshDriver()->DoTick();
RefPtr<nsRefreshDriver> driver = presContext->RefreshDriver();
if (driver) {
driver->DoTick();
}
}
}
}
+1
View File
@@ -45,6 +45,7 @@ LockImpl::~LockImpl() {
bool LockImpl::Try() {
int rv = pthread_mutex_trylock(&native_handle_);
DCHECK(rv == 0 || rv == EBUSY) << ". " << strerror(rv);
return rv == 0;
}
void LockImpl::Lock() {
+1
View File
@@ -4228,6 +4228,7 @@ pref("webgl.lose-context-on-memory-pressure", false);
pref("webgl.can-lose-context-in-foreground", true);
pref("webgl.restore-context-when-visible", true);
pref("webgl.max-warnings-per-context", 32);
pref("webgl.max-size-per-texture-mb", 1024);
pref("webgl.enable-draft-extensions", false);
pref("webgl.enable-privileged-extensions", false);
pref("webgl.bypass-shader-validation", false);
+12 -2
View File
@@ -4999,8 +4999,18 @@ internalEntityProcessor(XML_Parser parser,
{
processor = contentProcessor;
/* see externalEntityContentProcessor vs contentProcessor */
return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
nextPtr, (XML_Bool)!ps_finalBuffer);
result = doContent(parser,
parentParser ? 1 : 0,
encoding,
s,
end,
nextPtr,
(XML_Bool)!ps_finalBuffer);
if (result == XML_ERROR_NONE) {
if (!storeRawNames(parser))
return XML_ERROR_NO_MEMORY;
}
return result;
}
}
@@ -611,14 +611,6 @@ function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
let requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, true);
logger.debug("Requesting " + aUrl);
if (!aUrl) {
logger.warn("Request failed: empty update manifest URL");
this._doneAt = new Error("UP_emptyManifestURL");
this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
return;
}
try {
this.request = new ServiceRequest();
this.request.open("GET", this.url, true);
+2
View File
@@ -63,6 +63,8 @@ enum class OperatingSystem {
OSX10_15,
OSX10_16,
OSX11_0,
OSX12_0,
OSX13_0,
Ios
};
+4
View File
@@ -282,6 +282,10 @@ BlacklistOSToOperatingSystem(const nsAString& os)
return OperatingSystem::OSX10_15;
else if (os.EqualsLiteral("Darwin 20"))
return OperatingSystem::OSX11_0;
else if (os.EqualsLiteral("Darwin 21"))
return OperatingSystem::OSX12_0;
else if (os.EqualsLiteral("Darwin 22"))
return OperatingSystem::OSX13_0;
// For historical reasons, "All" in blocklist means "All Windows"
else if (os.EqualsLiteral("All"))
return OperatingSystem::Windows;
+6 -6
View File
@@ -63,12 +63,12 @@ OSXVersionToOperatingSystem(uint32_t aOSXVersion) {
}
break;
case 11:
switch (nsCocoaFeatures::ExtractMinorVersion(aOSXVersion)) {
case 0:
return OperatingSystem::OSX11_0;
default:
break;
}
return OperatingSystem::OSX11_0;
case 12:
return OperatingSystem::OSX12_0;
case 13:
return OperatingSystem::OSX13_0;
default:
break;
}
+1
View File
@@ -26,6 +26,7 @@ public:
static bool OnCatalinaOrLater();
static bool OnBigSurOrLater();
static bool OnMontereyOrLater();
static bool OnVenturaOrLater();
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
+11 -2
View File
@@ -27,6 +27,7 @@
#define MACOS_VERSION_10_16_HEX 0x000A1000
#define MACOS_VERSION_11_0_HEX 0x000B0000
#define MACOS_VERSION_12_0_HEX 0x000C0000
#define MACOS_VERSION_13_0_HEX 0x000D0000
#include "nsCocoaFeatures.h"
#include "nsCocoaUtils.h"
@@ -212,7 +213,8 @@ nsCocoaFeatures::OnBigSurOrLater()
(macOSVersion() >= MACOS_VERSION_11_0_HEX));
}
/* static */ bool nsCocoaFeatures::OnMontereyOrLater()
/* static */ bool
nsCocoaFeatures::OnMontereyOrLater()
{
// Monterey pretends to be 10.16 and is indistinguishable from Big Sur.
// In practice, this means that an Intel build can return false
@@ -221,6 +223,12 @@ nsCocoaFeatures::OnBigSurOrLater()
return (macOSVersion() >= MACOS_VERSION_12_0_HEX);
}
/* static */ bool
nsCocoaFeatures::OnVenturaOrLater()
{
return (macOSVersion() >= MACOS_VERSION_13_0_HEX);
}
/* static */ bool
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
{
@@ -234,7 +242,8 @@ nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFi
* for this purpose. Note: using this in a sandboxed process requires allowing
* the sysctl in the sandbox policy.
*/
/* static */ bool nsCocoaFeatures::ProcessIsRosettaTranslated()
/* static */ bool
nsCocoaFeatures::ProcessIsRosettaTranslated()
{
int ret = 0;
size_t size = sizeof(ret);
+4
View File
@@ -2903,6 +2903,10 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
{
mDrawsIntoWindowFrame = NO;
[super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag];
// MacOS 13 Ventura, doesn't seem to create the contentView... so create it ourselves
if(![super contentView]) {
[super setContentView:[[NSView alloc] initWithFrame:aContentRect]];
}
mState = nil;
mActiveTitlebarColor = nil;
mInactiveTitlebarColor = nil;
+9 -3
View File
@@ -246,6 +246,7 @@ EncodeInputStream(nsIInputStream* aInputStream,
static const char kBase64URLAlphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
static_assert(mozilla::ArrayLength(kBase64URLAlphabet) == 0x41);
// Maps an encoded character to a value in the Base64 URL alphabet, per
// RFC 4648, Table 2. Invalid input characters map to UINT8_MAX.
@@ -267,14 +268,19 @@ static const uint8_t kBase64URLDecodeTable[] = {
255,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, /* a - z */
255, 255, 255, 255,
255, 255, 255, 255, 255
};
static_assert(mozilla::ArrayLength(kBase64URLDecodeTable) == 0x80);
bool
Base64URLCharToValue(char aChar, uint8_t* aValue) {
uint8_t index = static_cast<uint8_t>(aChar);
*aValue = kBase64URLDecodeTable[index & 0x7f];
return (*aValue != 255) && !(index & ~0x7f);
if (index >= mozilla::ArrayLength(kBase64URLDecodeTable)) {
*aValue = 255;
return false;
}
*aValue = kBase64URLDecodeTable[index];
return *aValue != 255;
}
} // namespace