Compare commits
29
Commits
master
...
RB_20221101
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71ae69aea8 | ||
|
|
9e34d697c7 | ||
|
|
8fa9125d02 | ||
|
|
4b4488c3e4 | ||
|
|
248db7d301 | ||
|
|
e199f2949b | ||
|
|
456b5450a4 | ||
|
|
d8e629c4a3 | ||
|
|
4898c4f297 | ||
|
|
7cd578bbc6 | ||
|
|
1e91df628a | ||
|
|
b110549cbd | ||
|
|
971047835a | ||
|
|
dd4d9eb032 | ||
|
|
8b94f1e480 | ||
|
|
c89610a5c7 | ||
|
|
217963cbed | ||
|
|
c4f4e18340 | ||
|
|
8a7c0e7345 | ||
|
|
52e304d450 | ||
|
|
cfc0eeca53 | ||
|
|
ebd3dd9228 | ||
|
|
cb40e4e7ef | ||
|
|
662dba55fd | ||
|
|
8760ce023c | ||
|
|
b86e148bb7 | ||
|
|
9e83721e5e | ||
|
|
dc2d6c2e60 | ||
|
|
4ada6f6762 |
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -63,6 +63,8 @@ enum class OperatingSystem {
|
||||
OSX10_15,
|
||||
OSX10_16,
|
||||
OSX11_0,
|
||||
OSX12_0,
|
||||
OSX13_0,
|
||||
Ios
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user