Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw

Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
This commit is contained in:
Sylvestre Ledru
2025-05-17 19:07:22 +00:00
committed by sledru@mozilla.com
parent 1df22ac023
commit 8ae54ea4f9
331 changed files with 2084 additions and 2460 deletions

View File

@@ -57,11 +57,7 @@ class xpcAccessibilityService : public nsIAccessibilityService {
// for component registration // for component registration
// {3b265b69-f813-48ff-880d-d88d101af404} // {3b265b69-f813-48ff-880d-d88d101af404}
#define NS_ACCESSIBILITY_SERVICE_CID \ #define NS_ACCESSIBILITY_SERVICE_CID \
{ \ {0x3b265b69, 0xf813, 0x48ff, {0x88, 0x0d, 0xd8, 0x8d, 0x10, 0x1a, 0xf4, 0x04}}
0x3b265b69, 0xf813, 0x48ff, { \
0x88, 0x0d, 0xd8, 0x8d, 0x10, 0x1a, 0xf4, 0x04 \
} \
}
extern nsresult NS_GetAccessibilityService(nsIAccessibilityService** aResult); extern nsresult NS_GetAccessibilityService(nsIAccessibilityService** aResult);

View File

@@ -6,36 +6,23 @@
#ifdef XP_WIN #ifdef XP_WIN
# define NS_WINIEHISTORYENUMERATOR_CID \ # define NS_WINIEHISTORYENUMERATOR_CID \
{ \ {0x93480624, \
0x93480624, 0x806e, 0x4756, { \ 0x806e, \
0xb7, 0xcb, 0x0f, 0xb7, 0xdd, 0x74, 0x6a, 0x8f \ 0x4756, \
} \ {0xb7, 0xcb, 0x0f, 0xb7, 0xdd, 0x74, 0x6a, 0x8f}}
}
# define NS_IEHISTORYENUMERATOR_CONTRACTID \ # define NS_IEHISTORYENUMERATOR_CONTRACTID \
"@mozilla.org/profile/migrator/iehistoryenumerator;1" "@mozilla.org/profile/migrator/iehistoryenumerator;1"
#endif #endif
#define NS_SHELLSERVICE_CID \ #define NS_SHELLSERVICE_CID \
{ \ {0x63c7b9f4, 0xcc8, 0x43f8, {0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73}}
0x63c7b9f4, 0xcc8, 0x43f8, { \
0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 \
} \
}
#define NS_SHELLSERVICE_CONTRACTID "@mozilla.org/browser/shell-service;1" #define NS_SHELLSERVICE_CONTRACTID "@mozilla.org/browser/shell-service;1"
#define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \ #define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \
{ \ {0x7a024bcf, 0xedd5, 0x4d9a, {0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3}}
0x7a024bcf, 0xedd5, 0x4d9a, { \
0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3 \
} \
}
// 136e2c4d-c5a4-477c-b131-d93d7d704f64 // 136e2c4d-c5a4-477c-b131-d93d7d704f64
#define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \ #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \
{ \ {0x136e2c4d, 0xc5a4, 0x477c, {0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64}}
0x136e2c4d, 0xc5a4, 0x477c, { \
0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 \
} \
}

View File

@@ -69,8 +69,7 @@ struct RelR : public Elf<bits> {
using Elf_Verneed = typename Elf<bits>::Verneed; using Elf_Verneed = typename Elf<bits>::Verneed;
using Elf_Vernaux = typename Elf<bits>::Vernaux; using Elf_Vernaux = typename Elf<bits>::Vernaux;
#define TAG_NAME(t) \ #define TAG_NAME(t) {t, #t}
{ t, #t }
class DynInfo { class DynInfo {
public: public:
using Tag = decltype(Elf_Dyn::d_tag); using Tag = decltype(Elf_Dyn::d_tag);

View File

@@ -86,10 +86,6 @@ class ContentPrincipal final : public BasePrincipal {
} // namespace mozilla } // namespace mozilla
#define NS_PRINCIPAL_CID \ #define NS_PRINCIPAL_CID \
{ \ {0x653e0e4d, 0x3ee4, 0x45fa, {0xb2, 0x72, 0x97, 0xc2, 0x0b, 0xc0, 0x1e, 0xb8}}
0x653e0e4d, 0x3ee4, 0x45fa, { \
0xb2, 0x72, 0x97, 0xc2, 0x0b, 0xc0, 0x1e, 0xb8 \
} \
}
#endif // mozilla_ContentPrincipal_h #endif // mozilla_ContentPrincipal_h

View File

@@ -91,10 +91,6 @@ class ExpandedPrincipal : public nsIExpandedPrincipal,
}; };
#define NS_EXPANDEDPRINCIPAL_CID \ #define NS_EXPANDEDPRINCIPAL_CID \
{ \ {0xe8ee88b0, 0x5571, 0x4086, {0xa4, 0x5b, 0x39, 0xa7, 0x16, 0x90, 0x6b, 0xdb}}
0xe8ee88b0, 0x5571, 0x4086, { \
0xa4, 0x5b, 0x39, 0xa7, 0x16, 0x90, 0x6b, 0xdb \
} \
}
#endif // ExpandedPrincipal_h #endif // ExpandedPrincipal_h

View File

@@ -23,11 +23,7 @@ class nsIDocShell;
class nsIURI; class nsIURI;
#define NS_NULLPRINCIPAL_CID \ #define NS_NULLPRINCIPAL_CID \
{ \ {0xbd066e5f, 0x146f, 0x4472, {0x83, 0x31, 0x7b, 0xfd, 0x05, 0xb1, 0xed, 0x90}}
0xbd066e5f, 0x146f, 0x4472, { \
0x83, 0x31, 0x7b, 0xfd, 0x05, 0xb1, 0xed, 0x90 \
} \
}
#define NS_NULLPRINCIPAL_SCHEME "moz-nullprincipal" #define NS_NULLPRINCIPAL_SCHEME "moz-nullprincipal"

View File

@@ -15,11 +15,7 @@
#include "mozilla/BasePrincipal.h" #include "mozilla/BasePrincipal.h"
#define NS_SYSTEMPRINCIPAL_CID \ #define NS_SYSTEMPRINCIPAL_CID \
{ \ {0x4a6212db, 0xaccb, 0x11d3, {0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb}}
0x4a6212db, 0xaccb, 0x11d3, { \
0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb \
} \
}
#define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1" #define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1"
class nsScriptSecurityManager; class nsScriptSecurityManager;

View File

@@ -12,8 +12,8 @@ TEST(PrincipalHash, DocumentDomain)
nsCOMPtr<nsIScriptSecurityManager> ssm = nsCOMPtr<nsIScriptSecurityManager> ssm =
nsScriptSecurityManager::GetScriptSecurityManager(); nsScriptSecurityManager::GetScriptSecurityManager();
nsCOMPtr<nsIPrincipal> principal; nsCOMPtr<nsIPrincipal> principal;
nsresult rv = nsresult rv = ssm->CreateContentPrincipalFromOrigin(
ssm->CreateContentPrincipalFromOrigin("https://sub.mozilla.org"_ns, getter_AddRefs(principal)); "https://sub.mozilla.org"_ns, getter_AddRefs(principal));
EXPECT_NS_SUCCEEDED(rv); EXPECT_NS_SUCCEEDED(rv);
const auto hash = principal->GetHashValue(); const auto hash = principal->GetHashValue();
@@ -23,5 +23,6 @@ TEST(PrincipalHash, DocumentDomain)
EXPECT_NS_SUCCEEDED(rv); EXPECT_NS_SUCCEEDED(rv);
principal->SetDomain(domain); principal->SetDomain(domain);
ASSERT_EQ(principal->GetHashValue(), hash) << "Principal hash shouldn't change"; ASSERT_EQ(principal->GetHashValue(), hash)
<< "Principal hash shouldn't change";
} }

View File

@@ -12,10 +12,10 @@
#define NS_CHROMEPROTOCOLHANDLER_CID \ #define NS_CHROMEPROTOCOLHANDLER_CID \
{/* 61ba33c0-3031-11d3-8cd0-0060b0fc14a3 */ \ {/* 61ba33c0-3031-11d3-8cd0-0060b0fc14a3 */ \
0x61ba33c0, 0x3031, 0x11d3, { \ 0x61ba33c0, \
0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 \ 0x3031, \
} \ 0x11d3, \
} {0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3}}
class nsChromeProtocolHandler final : public nsIProtocolHandler, class nsChromeProtocolHandler final : public nsIProtocolHandler,
public nsSupportsWeakReference { public nsSupportsWeakReference {

View File

@@ -30,11 +30,7 @@ class nsIURL;
// for component registration // for component registration
// {47049e42-1d87-482a-984d-56ae185e367a} // {47049e42-1d87-482a-984d-56ae185e367a}
#define NS_CHROMEREGISTRY_CID \ #define NS_CHROMEREGISTRY_CID \
{ \ {0x47049e42, 0x1d87, 0x482a, {0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a}}
0x47049e42, 0x1d87, 0x482a, { \
0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a \
} \
}
class nsChromeRegistry : public nsIToolkitChromeRegistry, class nsChromeRegistry : public nsIToolkitChromeRegistry,
public nsIObserver, public nsIObserver,

View File

@@ -14,11 +14,7 @@
#define JSDEBUGGER_CONTRACTID "@mozilla.org/jsdebugger;1" #define JSDEBUGGER_CONTRACTID "@mozilla.org/jsdebugger;1"
#define JSDEBUGGER_CID \ #define JSDEBUGGER_CID \
{ \ {0x0365cbd5, 0xd46e, 0x4e94, {0xa3, 0x9f, 0x83, 0xb6, 0x3c, 0xd1, 0xa9, 0x63}}
0x0365cbd5, 0xd46e, 0x4e94, { \
0xa3, 0x9f, 0x83, 0xb6, 0x3c, 0xd1, 0xa9, 0x63 \
} \
}
namespace mozilla::jsdebugger { namespace mozilla::jsdebugger {

View File

@@ -12,11 +12,7 @@
#define JSINSPECTOR_CONTRACTID "@mozilla.org/jsinspector;1" #define JSINSPECTOR_CONTRACTID "@mozilla.org/jsinspector;1"
#define JSINSPECTOR_CID \ #define JSINSPECTOR_CID \
{ \ {0xec5aa99c, 0x7abb, 0x4142, {0xac, 0x5f, 0xaa, 0xb2, 0x41, 0x9e, 0x38, 0xe2}}
0xec5aa99c, 0x7abb, 0x4142, { \
0xac, 0x5f, 0xaa, 0xb2, 0x41, 0x9e, 0x38, 0xe2 \
} \
}
namespace mozilla { namespace mozilla {
namespace jsinspector { namespace jsinspector {

View File

@@ -18,6 +18,7 @@ namespace mozilla {
template <typename AnimationPtrType> template <typename AnimationPtrType>
class AnimationPtrComparator { class AnimationPtrComparator {
mutable nsContentUtils::NodeIndexCache mCache; mutable nsContentUtils::NodeIndexCache mCache;
public: public:
bool Equals(const AnimationPtrType& a, const AnimationPtrType& b) const { bool Equals(const AnimationPtrType& a, const AnimationPtrType& b) const {
return a == b; return a == b;

View File

@@ -2652,8 +2652,7 @@ void ChromeUtils::AndroidMoveTaskToBack(GlobalObject& aGlobal) {
already_AddRefed<nsIContentSecurityPolicy> ChromeUtils::CreateCSPFromHeader( already_AddRefed<nsIContentSecurityPolicy> ChromeUtils::CreateCSPFromHeader(
GlobalObject& aGlobal, const nsAString& aHeader, nsIURI* aSelfURI, GlobalObject& aGlobal, const nsAString& aHeader, nsIURI* aSelfURI,
nsIPrincipal* aLoadingPrincipal, ErrorResult& aRv) { nsIPrincipal* aLoadingPrincipal, ErrorResult& aRv) {
return CSP_CreateFromHeader(aHeader, aSelfURI, aLoadingPrincipal, return CSP_CreateFromHeader(aHeader, aSelfURI, aLoadingPrincipal, aRv);
aRv);
} }
} // namespace mozilla::dom } // namespace mozilla::dom

View File

@@ -20370,8 +20370,8 @@ already_AddRefed<Document> Document::ParseHTML(GlobalObject& aGlobal,
// Step 4. Let sanitizer be the result of calling get a sanitizer instance // Step 4. Let sanitizer be the result of calling get a sanitizer instance
// from options with options and true. // from options with options and true.
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports()); nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<Sanitizer> sanitizer = RefPtr<Sanitizer> sanitizer = Sanitizer::GetInstance(
Sanitizer::GetInstance(global, aOptions.mSanitizer, /* aSafe */ true, aError); global, aOptions.mSanitizer, /* aSafe */ true, aError);
if (aError.Failed()) { if (aError.Failed()) {
return nullptr; return nullptr;
} }

View File

@@ -140,7 +140,8 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE_AND_DESTROY(nsIContent,
LastRelease(), LastRelease(),
Destroy()) Destroy())
nsIContent* nsIContent::FindFirstNonChromeOnlyAccessContent() const { nsIContent*
nsIContent::FindFirstNonChromeOnlyAccessContent() const {
// This handles also nested native anonymous content. // This handles also nested native anonymous content.
// Oops, this function signature allows casting const to non-const. (Then // Oops, this function signature allows casting const to non-const. (Then
// again, so does GetFirstChild()->GetParent().) // again, so does GetFirstChild()->GetParent().)

View File

@@ -1557,8 +1557,7 @@ int32_t nsAttrValue::EnumTableEntryToValue(EnumTableSpan aEnumTable,
return value; return value;
} }
bool nsAttrValue::ParseEnumValue(const nsAString& aValue, bool nsAttrValue::ParseEnumValue(const nsAString& aValue, EnumTableSpan aTable,
EnumTableSpan aTable,
bool aCaseSensitive, bool aCaseSensitive,
const EnumTableEntry* aDefaultValue) { const EnumTableEntry* aDefaultValue) {
ResetIfSet(); ResetIfSet();

View File

@@ -11,17 +11,17 @@
#define NS_DOM_SCRIPT_OBJECT_FACTORY_CID \ #define NS_DOM_SCRIPT_OBJECT_FACTORY_CID \
{/* 9eb760f0-4380-11d2-b328-00805f8a3859 */ \ {/* 9eb760f0-4380-11d2-b328-00805f8a3859 */ \
0x9eb760f0, 0x4380, 0x11d2, { \ 0x9eb760f0, \
0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59 \ 0x4380, \
} \ 0x11d2, \
} {0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
#define NS_SCRIPT_NAMESET_REGISTRY_CID \ #define NS_SCRIPT_NAMESET_REGISTRY_CID \
{/* 45f27d10-987b-11d2-bd40-00105aa45e89 */ \ {/* 45f27d10-987b-11d2-bd40-00105aa45e89 */ \
0x45f27d10, 0x987b, 0x11d2, { \ 0x45f27d10, \
0xbd, 0x40, 0x00, 0x10, 0x5a, 0xa4, 0x5e, 0x89 \ 0x987b, \
} \ 0x11d2, \
} {0xbd, 0x40, 0x00, 0x10, 0x5a, 0xa4, 0x5e, 0x89}}
#define NS_XPATH_EVALUATOR_CONTRACTID "@mozilla.org/dom/xpath-evaluator;1" #define NS_XPATH_EVALUATOR_CONTRACTID "@mozilla.org/dom/xpath-evaluator;1"

View File

@@ -15,11 +15,7 @@
/* 1147d32c-215b-4014-b180-07fe7aedf915 */ /* 1147d32c-215b-4014-b180-07fe7aedf915 */
#define NS_DATADOCUMENTCONTENTPOLICY_CID \ #define NS_DATADOCUMENTCONTENTPOLICY_CID \
{ \ {0x1147d32c, 0x215b, 0x4014, {0xb1, 0x80, 0x07, 0xfe, 0x7a, 0xed, 0xf9, 0x15}}
0x1147d32c, 0x215b, 0x4014, { \
0xb1, 0x80, 0x07, 0xfe, 0x7a, 0xed, 0xf9, 0x15 \
} \
}
#define NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID \ #define NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID \
"@mozilla.org/data-document-content-policy;1" "@mozilla.org/data-document-content-policy;1"

View File

@@ -50,8 +50,7 @@ using mozilla::dom::ServiceWorkerRegistration;
using mozilla::dom::ServiceWorkerRegistrationDescriptor; using mozilla::dom::ServiceWorkerRegistrationDescriptor;
using mozilla::dom::VoidFunction; using mozilla::dom::VoidFunction;
nsIGlobalObject::nsIGlobalObject() nsIGlobalObject::nsIGlobalObject() : mIsDying(false), mIsInnerWindow(false) {}
: mIsDying(false), mIsInnerWindow(false) {}
bool nsIGlobalObject::IsScriptForbidden(JSObject* aCallback, bool nsIGlobalObject::IsScriptForbidden(JSObject* aCallback,
bool aIsJSImplementedWebIDL) const { bool aIsJSImplementedWebIDL) const {

View File

@@ -15,11 +15,7 @@
/* ac9e3e82-bfbd-4f26-941e-f58c8ee178c1 */ /* ac9e3e82-bfbd-4f26-941e-f58c8ee178c1 */
#define NS_NODATAPROTOCOLCONTENTPOLICY_CID \ #define NS_NODATAPROTOCOLCONTENTPOLICY_CID \
{ \ {0xac9e3e82, 0xbfbd, 0x4f26, {0x94, 0x1e, 0xf5, 0x8c, 0x8e, 0xe1, 0x78, 0xc1}}
0xac9e3e82, 0xbfbd, 0x4f26, { \
0x94, 0x1e, 0xf5, 0x8c, 0x8e, 0xe1, 0x78, 0xc1 \
} \
}
#define NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID \ #define NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID \
"@mozilla.org/no-data-protocol-content-policy;1" "@mozilla.org/no-data-protocol-content-policy;1"

View File

@@ -18,10 +18,10 @@ class nsIVariant;
"@mozilla.org/docshell/structured-clone-container;1" "@mozilla.org/docshell/structured-clone-container;1"
#define NS_STRUCTUREDCLONECONTAINER_CID \ #define NS_STRUCTUREDCLONECONTAINER_CID \
{/* 38bd0634-0fd4-46f0-b85f-13ced889eeec */ \ {/* 38bd0634-0fd4-46f0-b85f-13ced889eeec */ \
0x38bd0634, 0x0fd4, 0x46f0, { \ 0x38bd0634, \
0xb8, 0x5f, 0x13, 0xce, 0xd8, 0x89, 0xee, 0xec \ 0x0fd4, \
} \ 0x46f0, \
} {0xb8, 0x5f, 0x13, 0xce, 0xd8, 0x89, 0xee, 0xec}}
class nsStructuredCloneContainer final class nsStructuredCloneContainer final
: public nsIStructuredCloneContainer, : public nsIStructuredCloneContainer,

View File

@@ -344,4 +344,6 @@ TEST(TestScheduler, Idle)
} }
TEST(TestScheduler, NonIdle) TEST(TestScheduler, NonIdle)
{ EXPECT_TRUE(BasicScenario(scheduler, &gc, &ccNonIdle)); } {
EXPECT_TRUE(BasicScenario(scheduler, &gc, &ccNonIdle));
}

View File

@@ -677,12 +677,8 @@ RefPtr<WebGLContext> WebGLContext::Create(HostWebGLContext* host,
LOCAL_GL_FRAGMENT_SHADER, LOCAL_GL_FRAGMENT_SHADER,
}; };
constexpr GLenum PRECISIONS[] = { constexpr GLenum PRECISIONS[] = {
LOCAL_GL_LOW_FLOAT, LOCAL_GL_LOW_FLOAT, LOCAL_GL_MEDIUM_FLOAT, LOCAL_GL_HIGH_FLOAT,
LOCAL_GL_MEDIUM_FLOAT, LOCAL_GL_LOW_INT, LOCAL_GL_MEDIUM_INT, LOCAL_GL_HIGH_INT,
LOCAL_GL_HIGH_FLOAT,
LOCAL_GL_LOW_INT,
LOCAL_GL_MEDIUM_INT,
LOCAL_GL_HIGH_INT,
}; };
for (const auto& shaderType : SHADER_TYPES) { for (const auto& shaderType : SHADER_TYPES) {
for (const auto& precisionType : PRECISIONS) { for (const auto& precisionType : PRECISIONS) {
@@ -701,8 +697,10 @@ RefPtr<WebGLContext> WebGLContext::Create(HostWebGLContext* host,
} }
if (webgl->mDisableFragHighP) { if (webgl->mDisableFragHighP) {
out->shaderPrecisions->at({LOCAL_GL_FRAGMENT_SHADER, LOCAL_GL_HIGH_FLOAT}) = {}; out->shaderPrecisions->at(
out->shaderPrecisions->at({LOCAL_GL_FRAGMENT_SHADER, LOCAL_GL_HIGH_INT}) = {}; {LOCAL_GL_FRAGMENT_SHADER, LOCAL_GL_HIGH_FLOAT}) = {};
out->shaderPrecisions->at(
{LOCAL_GL_FRAGMENT_SHADER, LOCAL_GL_HIGH_INT}) = {};
} }
// - // -

View File

@@ -806,14 +806,10 @@ struct InitContextResult final {
Limits limits; Limits limits;
EnumMask<layers::SurfaceDescriptor::Type> uploadableSdTypes; EnumMask<layers::SurfaceDescriptor::Type> uploadableSdTypes;
// Padded because of "Android 5.0 ARMv7" builds: // Padded because of "Android 5.0 ARMv7" builds:
Padded< Padded<std::unordered_map<GetShaderPrecisionFormatArgs, ShaderPrecisionFormat,
std::unordered_map< TupleStdHash<GetShaderPrecisionFormatArgs>>,
GetShaderPrecisionFormatArgs, 64>
ShaderPrecisionFormat, shaderPrecisions;
TupleStdHash<GetShaderPrecisionFormatArgs>
>,
64
> shaderPrecisions;
auto MutTiedFields() { auto MutTiedFields() {
return std::tie(error, options, vendor, optionalRenderableFormatBits, return std::tie(error, options, vendor, optionalRenderableFormatBits,
@@ -1413,9 +1409,8 @@ inline std::string ToStringWithCommas(uint64_t v) {
namespace detail { namespace detail {
template <class T, size_t N, size_t... I> template <class T, size_t N, size_t... I>
constexpr std::array<std::remove_cv_t<T>, N> constexpr std::array<std::remove_cv_t<T>, N> to_array_impl(
to_array_impl(T (&a)[N], std::index_sequence<I...>) T (&a)[N], std::index_sequence<I...>) {
{
return {{a[I]...}}; return {{a[I]...}};
} }

View File

@@ -818,7 +818,8 @@ static bool IsUncancelableIfOnlyPassiveListeners(const WidgetEvent* aEvent) {
// There might be non-passive listeners in the remote document // There might be non-passive listeners in the remote document
// So return false if we are in the parent process with remote target // So return false if we are in the parent process with remote target
nsCOMPtr<nsIContent> target = nsIContent::FromEventTargetOrNull(aEvent->mOriginalTarget); nsCOMPtr<nsIContent> target =
nsIContent::FromEventTargetOrNull(aEvent->mOriginalTarget);
return !(XRE_IsParentProcess() && BrowserParent::GetFrom(target)); return !(XRE_IsParentProcess() && BrowserParent::GetFrom(target));
} }

View File

@@ -1852,16 +1852,20 @@ bool EventListenerManager::HasNonPassiveListenersFor(
// After dispatching wheel, legacy mouse scroll events are dispatched // After dispatching wheel, legacy mouse scroll events are dispatched
// and listeners on those can also default prevent the behavior. // and listeners on those can also default prevent the behavior.
if (aEvent->mMessage == eWheel) { if (aEvent->mMessage == eWheel) {
if (const auto& listeners = mListenerMap.GetListenersForType(nsGkAtoms::onDOMMouseScroll)) { if (const auto& listeners =
mListenerMap.GetListenersForType(nsGkAtoms::onDOMMouseScroll)) {
for (const Listener& listener : listeners->NonObservingRange()) { for (const Listener& listener : listeners->NonObservingRange()) {
if (!listener.mFlags.mPassive && ListenerCanHandle(&listener, aEvent)) { if (!listener.mFlags.mPassive &&
ListenerCanHandle(&listener, aEvent)) {
return true; return true;
} }
} }
} }
if (const auto& listeners = mListenerMap.GetListenersForType(nsGkAtoms::onMozMousePixelScroll)) { if (const auto& listeners = mListenerMap.GetListenersForType(
nsGkAtoms::onMozMousePixelScroll)) {
for (const Listener& listener : listeners->NonObservingRange()) { for (const Listener& listener : listeners->NonObservingRange()) {
if (!listener.mFlags.mPassive && ListenerCanHandle(&listener, aEvent)) { if (!listener.mFlags.mPassive &&
ListenerCanHandle(&listener, aEvent)) {
return true; return true;
} }
} }

View File

@@ -4368,19 +4368,21 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// events after they have been processed. When determining if // events after they have been processed. When determining if
// a swipe should occur, we should not prefer the current wheel // a swipe should occur, we should not prefer the current wheel
// transaction. // transaction.
nsIFrame* lastScrollFrame = WheelTransaction::GetScrollTargetFrame(); nsIFrame* lastScrollFrame =
WheelTransaction::GetScrollTargetFrame();
bool wheelTransactionHandlesInput = false; bool wheelTransactionHandlesInput = false;
if (lastScrollFrame) { if (lastScrollFrame) {
ScrollContainerFrame* scrollContainerFrame = lastScrollFrame->GetScrollTargetFrame(); ScrollContainerFrame* scrollContainerFrame =
lastScrollFrame->GetScrollTargetFrame();
if (scrollContainerFrame->IsRootScrollFrameOfDocument()) { if (scrollContainerFrame->IsRootScrollFrameOfDocument()) {
// If the current wheel transaction target is the root scroll // If the current wheel transaction target is the root scroll
// frame and is not scrollable on the x-axis, all delta is // frame and is not scrollable on the x-axis, all delta is
// overflown and swipe-to-nav may occur. // overflown and swipe-to-nav may occur.
wheelTransactionHandlesInput = true; wheelTransactionHandlesInput = true;
allDeltaOverflown = !WheelHandlingUtils::CanScrollOn(scrollContainerFrame, allDeltaOverflown = !WheelHandlingUtils::CanScrollOn(
wheelEvent->mDeltaX, 0.0); scrollContainerFrame, wheelEvent->mDeltaX, 0.0);
} else if(WheelHandlingUtils::CanScrollOn(scrollContainerFrame, } else if (WheelHandlingUtils::CanScrollOn(
wheelEvent->mDeltaX, scrollContainerFrame, wheelEvent->mDeltaX,
wheelEvent->mDeltaY)) { wheelEvent->mDeltaY)) {
// If the current wheel transaction target is not the root // If the current wheel transaction target is not the root
// scroll frame, ensure that swipe to nav does not occur if // scroll frame, ensure that swipe to nav does not occur if

View File

@@ -282,7 +282,8 @@ void HTMLDialogElement::Show(ErrorResult& aError) {
} }
bool HTMLDialogElement::Open() const { bool HTMLDialogElement::Open() const {
MOZ_ASSERT(GetBoolAttr(nsGkAtoms::open) == State().HasState(ElementState::OPEN)); MOZ_ASSERT(GetBoolAttr(nsGkAtoms::open) ==
State().HasState(ElementState::OPEN));
return State().HasState(ElementState::OPEN); return State().HasState(ElementState::OPEN);
} }
@@ -369,7 +370,8 @@ void HTMLDialogElement::ShowModal(ErrorResult& aError) {
// 3. If subject's node document is not fully active, then throw an // 3. If subject's node document is not fully active, then throw an
// "InvalidStateError" DOMException. // "InvalidStateError" DOMException.
if (!OwnerDoc()->IsFullyActive()) { if (!OwnerDoc()->IsFullyActive()) {
return aError.ThrowInvalidStateError("The owner document is not fully active"); return aError.ThrowInvalidStateError(
"The owner document is not fully active");
} }
// 4. If subject is not connected, then throw an "InvalidStateError" // 4. If subject is not connected, then throw an "InvalidStateError"

View File

@@ -613,8 +613,10 @@ void nsHTMLDocument::NamedGetter(JSContext* aCx, const nsAString& aName,
} }
} }
// To limit the possible performance/memory impact, only collect at most 10 properties. // To limit the possible performance/memory impact, only collect at most 10
if (mShadowedHTMLDocumentProperties.Length() <= 10 && HTMLDocument_Binding::InterfaceHasNonEventHandlerProperty(aName)) { // properties.
if (mShadowedHTMLDocumentProperties.Length() <= 10 &&
HTMLDocument_Binding::InterfaceHasNonEventHandlerProperty(aName)) {
if (!mShadowedHTMLDocumentProperties.Contains(aName)) { if (!mShadowedHTMLDocumentProperties.Contains(aName)) {
mShadowedHTMLDocumentProperties.AppendElement(aName); mShadowedHTMLDocumentProperties.AppendElement(aName);
} }

View File

@@ -297,8 +297,8 @@ template <typename T>
class CheckedUnsafePtr; class CheckedUnsafePtr;
template <typename T> template <typename T>
SafeRefPtr(const CheckedUnsafePtr<T>&, SafeRefPtr(const CheckedUnsafePtr<T>&, const AcquireStrongRefFromRawPtr&)
const AcquireStrongRefFromRawPtr&) -> SafeRefPtr<T>; -> SafeRefPtr<T>;
template <typename T> template <typename T>
SafeRefPtr<T>::SafeRefPtr(T* aRawPtr, detail::InitialConstructionTag) SafeRefPtr<T>::SafeRefPtr(T* aRawPtr, detail::InitialConstructionTag)

View File

@@ -1624,8 +1624,8 @@ void MaybeLogBlockShutdownDiagnostics(ContentParent* aSelf, const char* aMsg,
if (aSelf->IsBlockingShutdown()) { if (aSelf->IsBlockingShutdown()) {
MOZ_LOG( MOZ_LOG(
ContentParent::GetLog(), LogLevel::Info, ContentParent::GetLog(), LogLevel::Info,
("ContentParent: id=%p childID=%" PRIu64 " pid=%d - %s at %s(%d)", aSelf, ("ContentParent: id=%p childID=%" PRIu64 " pid=%d - %s at %s(%d)",
(uint64_t)aSelf->ChildID(), aSelf->Pid(), aMsg, aFile, aLine)); aSelf, (uint64_t)aSelf->ChildID(), aSelf->Pid(), aMsg, aFile, aLine));
} }
#else #else
Unused << aSelf; Unused << aSelf;

View File

@@ -326,7 +326,8 @@ bool MathMLElement::ParseNumericValue(const nsString& aString,
return true; return true;
} else { } else {
uint8_t unitType = SVGLength::GetUnitTypeForString(unit); uint8_t unitType = SVGLength::GetUnitTypeForString(unit);
if (unitType == SVGLength_Binding::SVG_LENGTHTYPE_UNKNOWN) { // unexpected unit if (unitType ==
SVGLength_Binding::SVG_LENGTHTYPE_UNKNOWN) { // unexpected unit
if (!(aFlags & PARSE_SUPPRESS_WARNINGS)) { if (!(aFlags & PARSE_SUPPRESS_WARNINGS)) {
ReportLengthParseError(aString, aDocument); ReportLengthParseError(aString, aDocument);
} }

View File

@@ -14,8 +14,7 @@ namespace mozilla {
BaseMediaMgrError::BaseMediaMgrError(Name aName, const nsACString& aMessage, BaseMediaMgrError::BaseMediaMgrError(Name aName, const nsACString& aMessage,
const nsAString& aConstraint) const nsAString& aConstraint)
: mMessage(aMessage), mConstraint(aConstraint), mName(aName) { : mMessage(aMessage), mConstraint(aConstraint), mName(aName) {
#define MAP_MEDIAERR(name, msg) \ #define MAP_MEDIAERR(name, msg) {Name::name, #name, msg}
{ Name::name, #name, msg }
static struct { static struct {
Name mName; Name mName;

View File

@@ -47,8 +47,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaStreamTrackSource)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
auto MediaStreamTrackSource::ApplyConstraints( auto MediaStreamTrackSource::ApplyConstraints(
const dom::MediaTrackConstraints& aConstraints, const dom::MediaTrackConstraints& aConstraints, CallerType aCallerType)
CallerType aCallerType) -> RefPtr<ApplyConstraintsPromise> { -> RefPtr<ApplyConstraintsPromise> {
return ApplyConstraintsPromise::CreateAndReject( return ApplyConstraintsPromise::CreateAndReject(
MakeRefPtr<MediaMgrError>(MediaMgrError::Name::OverconstrainedError, ""), MakeRefPtr<MediaMgrError>(MediaMgrError::Name::OverconstrainedError, ""),
__func__); __func__);

View File

@@ -328,7 +328,8 @@ static bool IsMFCDMAllowedByOrigin(const Maybe<nsCString>& aOrigin) {
for (const auto& entry : sOriginStatusEntries) { for (const auto& entry : sOriginStatusEntries) {
// Check if the given origin matches the entry, or if it's a suborigin. // Check if the given origin matches the entry, or if it's a suborigin.
if (FindInReadable(entry.origin(), *aOrigin)) { if (FindInReadable(entry.origin(), *aOrigin)) {
isAllowed = entry.status() == isAllowed =
entry.status() ==
nsIWindowsMediaFoundationCDMOriginsListService::ORIGIN_ALLOWED; nsIWindowsMediaFoundationCDMOriginsListService::ORIGIN_ALLOWED;
isFound = true; isFound = true;
break; break;
@@ -337,7 +338,8 @@ static bool IsMFCDMAllowedByOrigin(const Maybe<nsCString>& aOrigin) {
EME_LOG( EME_LOG(
"MediaKeySystemAccess::IsMFCDMAllowedByOrigin, origin (%s) " "MediaKeySystemAccess::IsMFCDMAllowedByOrigin, origin (%s) "
"is %s to use MFCDM %s(Remote)", "is %s to use MFCDM %s(Remote)",
aOrigin->get(), isAllowed ? "ALLOWED" : "BLOCKED", isFound ? "" : "by default "); aOrigin->get(), isAllowed ? "ALLOWED" : "BLOCKED",
isFound ? "" : "by default ");
return isAllowed; return isAllowed;
} }
#endif #endif

View File

@@ -76,16 +76,24 @@ static void TestAudioCompactor(size_t aBytes) {
} }
TEST(Media, AudioCompactor_4000) TEST(Media, AudioCompactor_4000)
{ TestAudioCompactor(4000); } {
TestAudioCompactor(4000);
}
TEST(Media, AudioCompactor_4096) TEST(Media, AudioCompactor_4096)
{ TestAudioCompactor(4096); } {
TestAudioCompactor(4096);
}
TEST(Media, AudioCompactor_5000) TEST(Media, AudioCompactor_5000)
{ TestAudioCompactor(5000); } {
TestAudioCompactor(5000);
}
TEST(Media, AudioCompactor_5256) TEST(Media, AudioCompactor_5256)
{ TestAudioCompactor(5256); } {
TestAudioCompactor(5256);
}
TEST(Media, AudioCompactor_NativeCopy) TEST(Media, AudioCompactor_NativeCopy)
{ {

View File

@@ -276,8 +276,11 @@ void MFMediaEngineParent::NotifyError(MF_MEDIA_ENGINE_ERR aError,
// A special error requires to reset the hareware context, not a real error. // A special error requires to reset the hareware context, not a real error.
if (aResult == DRM_E_TEE_INVALID_HWDRM_STATE) { if (aResult == DRM_E_TEE_INVALID_HWDRM_STATE) {
LOG("Notify error 'DRM_E_TEE_INVALID_HWDRM_STATE', hr=%lx", aResult); LOG("Notify error 'DRM_E_TEE_INVALID_HWDRM_STATE', hr=%lx", aResult);
ENGINE_MARKER("MFMediaEngineParent,Received 'DRM_E_TEE_INVALID_HWDRM_STATE'"); ENGINE_MARKER(
auto* proxy = mContentProtectionManager ? mContentProtectionManager->GetCDMProxy() : nullptr; "MFMediaEngineParent,Received 'DRM_E_TEE_INVALID_HWDRM_STATE'");
auto* proxy = mContentProtectionManager
? mContentProtectionManager->GetCDMProxy()
: nullptr;
if (proxy) { if (proxy) {
proxy->OnHardwareContextReset(); proxy->OnHardwareContextReset();
} }

View File

@@ -192,8 +192,8 @@ RefPtr<GenericNonExclusivePromise> RDDProcessManager::LaunchRDDProcess() {
} }
auto RDDProcessManager::EnsureRDDProcessAndCreateBridge( auto RDDProcessManager::EnsureRDDProcessAndCreateBridge(
ipc::EndpointProcInfo aOtherProcess, ipc::EndpointProcInfo aOtherProcess, dom::ContentParentId aParentId)
dom::ContentParentId aParentId) -> RefPtr<EnsureRDDPromise> { -> RefPtr<EnsureRDDPromise> {
return InvokeAsync( return InvokeAsync(
GetMainThreadSerialEventTarget(), __func__, GetMainThreadSerialEventTarget(), __func__,
[aOtherProcess, aParentId, this]() -> RefPtr<EnsureRDDPromise> { [aOtherProcess, aParentId, this]() -> RefPtr<EnsureRDDPromise> {

View File

@@ -316,8 +316,7 @@ Result<H265SPS, nsresult> H265::DecodeSPSFromSPSNALU(const H265NALU& aSPSNALU) {
return Err(NS_ERROR_FAILURE); return Err(NS_ERROR_FAILURE);
} }
IN_RANGE_OR_RETURN(width.value(), 0, sps.pic_width_in_luma_samples); IN_RANGE_OR_RETURN(width.value(), 0, sps.pic_width_in_luma_samples);
CheckedUint32 height = CheckedUint32 height = sps.pic_height_in_luma_samples;
sps.pic_height_in_luma_samples;
height -= height -=
sps.subHeightC * (sps.conf_win_bottom_offset - sps.conf_win_top_offset); sps.subHeightC * (sps.conf_win_bottom_offset - sps.conf_win_top_offset);
if (!height.isValid()) { if (!height.isValid()) {

View File

@@ -12,4 +12,6 @@
using namespace mozilla; using namespace mozilla;
TEST(CanCreateMFTDecoder, NoIPC) TEST(CanCreateMFTDecoder, NoIPC)
{ EXPECT_TRUE(WMFDecoderModule::CanCreateMFTDecoder(WMFStreamType::H264)); } {
EXPECT_TRUE(WMFDecoderModule::CanCreateMFTDecoder(WMFStreamType::H264));
}

View File

@@ -45,7 +45,8 @@ inline bool FuzzyEqual(double v1, double v2) { return fabs(v1 - v2) < 1e-7; }
*/ */
inline float ConvertLinearToDecibels(float aLinearValue, float aMinDecibels) { inline float ConvertLinearToDecibels(float aLinearValue, float aMinDecibels) {
MOZ_ASSERT(aLinearValue >= 0); MOZ_ASSERT(aLinearValue >= 0);
return aLinearValue > 0.0f ? 20.0f * fdlibm_log10f(aLinearValue) : aMinDecibels; return aLinearValue > 0.0f ? 20.0f * fdlibm_log10f(aLinearValue)
: aMinDecibels;
} }
/** /**

View File

@@ -51,8 +51,8 @@ void RemoteTrackSource::Destroy() {
} }
auto RemoteTrackSource::ApplyConstraints( auto RemoteTrackSource::ApplyConstraints(
const dom::MediaTrackConstraints& aConstraints, const dom::MediaTrackConstraints& aConstraints, dom::CallerType aCallerType)
dom::CallerType aCallerType) -> RefPtr<ApplyConstraintsPromise> { -> RefPtr<ApplyConstraintsPromise> {
return ApplyConstraintsPromise::CreateAndReject( return ApplyConstraintsPromise::CreateAndReject(
MakeRefPtr<MediaMgrError>( MakeRefPtr<MediaMgrError>(
dom::MediaStreamError::Name::OverconstrainedError, ""), dom::MediaStreamError::Name::OverconstrainedError, ""),

View File

@@ -162,8 +162,9 @@ auto WebrtcGlobalStatsHistory::Entry::Prune(const DOMHighResTimeStamp aBefore)
// Note: we always keep the most recent SDP // Note: we always keep the most recent SDP
} }
auto WebrtcGlobalStatsHistory::InitHistory( auto WebrtcGlobalStatsHistory::InitHistory(const nsAString& aPcId,
const nsAString& aPcId, const bool aIsLongTermStatsDisabled) -> void { const bool aIsLongTermStatsDisabled)
-> void {
MOZ_ASSERT(XRE_IsParentProcess()); MOZ_ASSERT(XRE_IsParentProcess());
if (WebrtcGlobalStatsHistory::Get().MaybeGet(aPcId)) { if (WebrtcGlobalStatsHistory::Get().MaybeGet(aPcId)) {
return; return;

View File

@@ -57,4 +57,4 @@ webrtc::NtpTime CreateNtp(webrtc::Timestamp aTime) {
namespace webrtc { namespace webrtc {
int64_t SystemTimeNanos() { return mozilla::WebrtcSystemTime().us() * 1000; } int64_t SystemTimeNanos() { return mozilla::WebrtcSystemTime().us() * 1000; }
} // namespace rtc } // namespace webrtc

View File

@@ -28,7 +28,9 @@ class TestSimpleTokenBucket : public SimpleTokenBucket {
}; };
TEST(SimpleTokenBucketTest, TestConstruct) TEST(SimpleTokenBucketTest, TestConstruct)
{ TestSimpleTokenBucket b(10, 1); } {
TestSimpleTokenBucket b(10, 1);
}
TEST(SimpleTokenBucketTest, TestGet) TEST(SimpleTokenBucketTest, TestGet)
{ {

View File

@@ -12,11 +12,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#define TCPSERVERSOCKETCHILD_CID \ #define TCPSERVERSOCKETCHILD_CID \
{ \ {0x41a77ec8, 0xfd86, 0x409e, {0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e}}
0x41a77ec8, 0xfd86, 0x409e, { \
0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e \
} \
}
class nsITCPServerSocketInternal; class nsITCPServerSocketInternal;

View File

@@ -14,11 +14,7 @@
#include "js/TypeDecls.h" #include "js/TypeDecls.h"
#define TCPSOCKETPARENT_CID \ #define TCPSOCKETPARENT_CID \
{ \ {0x4e7246c6, 0xa8b3, 0x426d, {0x9c, 0x17, 0x76, 0xda, 0xb1, 0xe1, 0xe1, 0x4a}}
0x4e7246c6, 0xa8b3, 0x426d, { \
0x9c, 0x17, 0x76, 0xda, 0xb1, 0xe1, 0xe1, 0x4a \
} \
}
namespace mozilla::dom { namespace mozilla::dom {

View File

@@ -12,11 +12,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#define UDPSOCKETCHILD_CID \ #define UDPSOCKETCHILD_CID \
{ \ {0xb47e5a0f, 0xd384, 0x48ef, {0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0}}
0xb47e5a0f, 0xd384, 0x48ef, { \
0x88, 0x85, 0x42, 0x59, 0x79, 0x3d, 0x9c, 0xf0 \
} \
}
class nsIInputStream; class nsIInputStream;
class nsIPrincipal; class nsIPrincipal;

View File

@@ -614,7 +614,8 @@ nsresult Notification::ResolveIconURL(nsIGlobalObject* aGlobal,
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
nsAutoCString src; nsAutoCString src;
srcUri->GetSpec(src); srcUri->GetSpec(src);
// XXX(krosylight): We should be able to pass UTF8 as-is, or ideally the URI object itself. // XXX(krosylight): We should be able to pass UTF8 as-is, or ideally the URI
// object itself.
CopyUTF8toUTF16(src, aDecodedUrl); CopyUTF8toUTF16(src, aDecodedUrl);
} }

View File

@@ -194,7 +194,9 @@ class Notification : public DOMEventTargetHelper, public SupportsWeakPtr {
bool CreateActor(); bool CreateActor();
bool SendShow(Promise* aPromise); bool SendShow(Promise* aPromise);
static nsresult ResolveIconURL(nsIGlobalObject* aGlobal, const nsAString& aIconURL, nsString& aResolvedURL); static nsresult ResolveIconURL(nsIGlobalObject* aGlobal,
const nsAString& aIconURL,
nsString& aResolvedURL);
}; };
} // namespace mozilla::dom } // namespace mozilla::dom

View File

@@ -21,10 +21,8 @@ using std::begin;
using std::end; using std::end;
template <typename T, typename NestedRange> template <typename T, typename NestedRange>
auto Flatten(NestedRange&& aRange) auto Flatten(NestedRange&& aRange) -> std::enable_if_t<
-> std::enable_if_t< std::is_same_v<T, std::decay_t<typename decltype(begin(
std::is_same_v<T,
std::decay_t<typename decltype(begin(
std::declval<const NestedRange&>()))::value_type>>, std::declval<const NestedRange&>()))::value_type>>,
std::conditional_t<std::is_rvalue_reference_v<NestedRange>, std::conditional_t<std::is_rvalue_reference_v<NestedRange>,
std::decay_t<NestedRange>, NestedRange>> { std::decay_t<NestedRange>, NestedRange>> {
@@ -100,11 +98,10 @@ struct FlatRange {
}; };
template <typename T, typename NestedRange> template <typename T, typename NestedRange>
auto Flatten(NestedRange&& aRange) auto Flatten(NestedRange&& aRange) -> std::enable_if_t<
-> std::enable_if_t< !std::is_same_v<
!std::is_same_v<T, std::decay_t<typename decltype(begin( T, std::decay_t<typename decltype(begin(
std::declval<const std::decay_t< std::declval<const std::decay_t<NestedRange>&>()))::value_type>>,
NestedRange>&>()))::value_type>>,
FlatRange<T, NestedRange>> { FlatRange<T, NestedRange>> {
return FlatRange<T, NestedRange>{std::forward<NestedRange>(aRange)}; return FlatRange<T, NestedRange>{std::forward<NestedRange>(aRange)};
} }

View File

@@ -29,10 +29,8 @@ struct IsExclusiveMozPromise<
} // namespace detail } // namespace detail
template <typename T, typename U, typename F> template <typename T, typename U, typename F>
auto Map(RefPtr<U> aPromise, F&& aFunc) auto Map(RefPtr<U> aPromise, F&& aFunc) -> std::enable_if_t<
-> std::enable_if_t< detail::IsExclusiveMozPromise<RemoveSmartPointer<U>>::value, RefPtr<T>> {
detail::IsExclusiveMozPromise<RemoveSmartPointer<U>>::value,
RefPtr<T>> {
return aPromise->Then( return aPromise->Then(
GetCurrentSerialEventTarget(), __func__, GetCurrentSerialEventTarget(), __func__,
[func = [func =
@@ -48,10 +46,8 @@ auto Map(RefPtr<U> aPromise, F&& aFunc)
} }
template <typename T, typename U, typename F> template <typename T, typename U, typename F>
auto Map(RefPtr<U> aPromise, F&& aFunc) auto Map(RefPtr<U> aPromise, F&& aFunc) -> std::enable_if_t<
-> std::enable_if_t< !detail::IsExclusiveMozPromise<RemoveSmartPointer<U>>::value, RefPtr<T>> {
!detail::IsExclusiveMozPromise<RemoveSmartPointer<U>>::value,
RefPtr<T>> {
return aPromise->Then(GetCurrentSerialEventTarget(), __func__, return aPromise->Then(GetCurrentSerialEventTarget(), __func__,
[func = std::forward<F>(aFunc)]( [func = std::forward<F>(aFunc)](
const typename U::ResolveOrRejectValue& aValue) { const typename U::ResolveOrRejectValue& aValue) {

View File

@@ -1050,7 +1050,8 @@ auto OrElseIf(Result<V, E>&& aResult, P&& aPred, F&& aFunc) -> Result<V, E> {
return Err(NS_FAILED(_status) ? (_status) : (_rv)) return Err(NS_FAILED(_status) ? (_status) : (_rv))
#else #else
# define RECORD_IN_NIGHTLY(_dummy, _status) \ # define RECORD_IN_NIGHTLY(_dummy, _status) \
{} { \
}
# define OK_IN_NIGHTLY_PROPAGATE_IN_OTHERS QM_PROPAGATE # define OK_IN_NIGHTLY_PROPAGATE_IN_OTHERS QM_PROPAGATE
@@ -1142,8 +1143,8 @@ auto ErrToDefaultOk(const nsresult aValue) -> Result<V, nsresult> {
} }
template <typename MozPromiseType, typename RejectValueT = nsresult> template <typename MozPromiseType, typename RejectValueT = nsresult>
auto CreateAndRejectMozPromise(StaticString aFunc, auto CreateAndRejectMozPromise(StaticString aFunc, const RejectValueT& aRv)
const RejectValueT& aRv) -> decltype(auto) { -> decltype(auto) {
if constexpr (std::is_same_v<RejectValueT, nsresult>) { if constexpr (std::is_same_v<RejectValueT, nsresult>) {
return MozPromiseType::CreateAndReject(aRv, aFunc); return MozPromiseType::CreateAndReject(aRv, aFunc);
} else if constexpr (std::is_same_v<RejectValueT, QMResult>) { } else if constexpr (std::is_same_v<RejectValueT, QMResult>) {
@@ -1235,8 +1236,8 @@ auto Reduce(Range&& aRange, T aInit, const BinaryOp& aBinaryOp) {
} }
template <typename Range, typename Body> template <typename Range, typename Body>
auto CollectEachInRange(Range&& aRange, auto CollectEachInRange(Range&& aRange, const Body& aBody)
const Body& aBody) -> Result<mozilla::Ok, nsresult> { -> Result<mozilla::Ok, nsresult> {
for (auto&& element : aRange) { for (auto&& element : aRange) {
MOZ_TRY(aBody(element)); MOZ_TRY(aBody(element));
} }

View File

@@ -1836,10 +1836,14 @@ TEST(QuotaCommon_ErrToDefaultOkOrErr, NsCOMPtr_Err)
} }
TEST(QuotaCommon_IsSpecificError, Match) TEST(QuotaCommon_IsSpecificError, Match)
{ EXPECT_TRUE(IsSpecificError<NS_ERROR_FAILURE>(NS_ERROR_FAILURE)); } {
EXPECT_TRUE(IsSpecificError<NS_ERROR_FAILURE>(NS_ERROR_FAILURE));
}
TEST(QuotaCommon_IsSpecificError, Mismatch) TEST(QuotaCommon_IsSpecificError, Mismatch)
{ EXPECT_FALSE(IsSpecificError<NS_ERROR_FAILURE>(NS_ERROR_UNEXPECTED)); } {
EXPECT_FALSE(IsSpecificError<NS_ERROR_FAILURE>(NS_ERROR_UNEXPECTED));
}
TEST(QuotaCommon_ErrToOk, Bool_True) TEST(QuotaCommon_ErrToOk, Bool_True)
{ {

View File

@@ -64,8 +64,7 @@ CSPViolationData::CSPViolationData(uint32_t aViolatedPolicyIndex,
BlockedContentSource::TrustedTypesPolicy) BlockedContentSource::TrustedTypesPolicy)
? nsString(aSample) ? nsString(aSample)
: MaybeTruncateSampleWithEllipsis(aSample)}, : MaybeTruncateSampleWithEllipsis(aSample)},
mHashSHA256{aHashSHA256} mHashSHA256{aHashSHA256} {}
{}
// Required for `mElement`, since its destructor requires a definition of // Required for `mElement`, since its destructor requires a definition of
// `Element`. // `Element`.

View File

@@ -47,7 +47,8 @@ struct CSPViolationData {
const CSPDirective aEffectiveDirective, const CSPDirective aEffectiveDirective,
const nsACString& aSourceFile, uint32_t aLineNumber, const nsACString& aSourceFile, uint32_t aLineNumber,
uint32_t aColumnNumber, Element* aElement, uint32_t aColumnNumber, Element* aElement,
const nsAString& aSample, const nsACString& aHashSHA256 = ""_ns); const nsAString& aSample,
const nsACString& aHashSHA256 = ""_ns);
~CSPViolationData(); ~CSPViolationData();

View File

@@ -17,11 +17,7 @@
#define REFERRERINFO_CONTRACTID "@mozilla.org/referrer-info;1" #define REFERRERINFO_CONTRACTID "@mozilla.org/referrer-info;1"
// 041a129f-10ce-4bda-a60d-e027a26d5ed0 // 041a129f-10ce-4bda-a60d-e027a26d5ed0
#define REFERRERINFO_CID \ #define REFERRERINFO_CID \
{ \ {0x041a129f, 0x10ce, 0x4bda, {0xa6, 0x0d, 0xe0, 0x27, 0xa2, 0x6d, 0x5e, 0xd0}}
0x041a129f, 0x10ce, 0x4bda, { \
0xa6, 0x0d, 0xe0, 0x27, 0xa2, 0x6d, 0x5e, 0xd0 \
} \
}
class nsIHttpChannel; class nsIHttpChannel;
class nsIURI; class nsIURI;

View File

@@ -597,7 +597,8 @@ void nsCSPContext::ReportInlineViolation(
nsAutoCString hashSHA256; nsAutoCString hashSHA256;
// We optionally include the hash to create more helpful error messages. // We optionally include the hash to create more helpful error messages.
nsCOMPtr<nsICryptoHash> hasher; nsCOMPtr<nsICryptoHash> hasher;
if (NS_SUCCEEDED(NS_NewCryptoHash(nsICryptoHash::SHA256, getter_AddRefs(hasher)))) { if (NS_SUCCEEDED(
NS_NewCryptoHash(nsICryptoHash::SHA256, getter_AddRefs(hasher)))) {
NS_ConvertUTF16toUTF8 source(aSourceCode); NS_ConvertUTF16toUTF8 source(aSourceCode);
if (NS_SUCCEEDED(hasher->Update( if (NS_SUCCEEDED(hasher->Update(
reinterpret_cast<const uint8_t*>(source.get()), source.Length()))) { reinterpret_cast<const uint8_t*>(source.get()), source.Length()))) {
@@ -1693,8 +1694,9 @@ class CSPReportSenderRunnable final : public Runnable {
: "CSPInlineScriptViolation2"; : "CSPInlineScriptViolation2";
} }
AutoTArray<nsString, 3> params = {mViolatedDirectiveNameAndValue, AutoTArray<nsString, 3> params = {
effectiveDirective, NS_ConvertUTF8toUTF16(mCSPViolationData.mHashSHA256)}; mViolatedDirectiveNameAndValue, effectiveDirective,
NS_ConvertUTF8toUTF16(mCSPViolationData.mHashSHA256)};
mCSPContext->logToConsole( mCSPContext->logToConsole(
errorName, params, mCSPViolationData.mSourceFile, errorName, params, mCSPViolationData.mSourceFile,
mCSPViolationData.mSample, mCSPViolationData.mLineNumber, mCSPViolationData.mSample, mCSPViolationData.mLineNumber,

View File

@@ -14,11 +14,7 @@
#define CSPSERVICE_CONTRACTID "@mozilla.org/cspservice;1" #define CSPSERVICE_CONTRACTID "@mozilla.org/cspservice;1"
#define CSPSERVICE_CID \ #define CSPSERVICE_CID \
{ \ {0x8d2f40b2, 0x4875, 0x4c95, {0x97, 0xd9, 0x3f, 0x7d, 0xca, 0x2c, 0xb4, 0x60}}
0x8d2f40b2, 0x4875, 0x4c95, { \
0x97, 0xd9, 0x3f, 0x7d, 0xca, 0x2c, 0xb4, 0x60 \
} \
}
class CSPService : public nsIContentPolicy, public nsIChannelEventSink { class CSPService : public nsIContentPolicy, public nsIChannelEventSink {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@@ -415,9 +415,9 @@ CSPDirective CSP_ContentTypeToDirective(nsContentPolicyType aType) {
return nsIContentSecurityPolicy::DEFAULT_SRC_DIRECTIVE; return nsIContentSecurityPolicy::DEFAULT_SRC_DIRECTIVE;
} }
already_AddRefed<nsIContentSecurityPolicy> CSP_CreateFromHeader(const nsAString& aHeaderValue, nsIURI* aSelfURI, already_AddRefed<nsIContentSecurityPolicy> CSP_CreateFromHeader(
nsIPrincipal* aLoadingPrincipal, const nsAString& aHeaderValue, nsIURI* aSelfURI,
ErrorResult& aRv) { nsIPrincipal* aLoadingPrincipal, ErrorResult& aRv) {
RefPtr<nsCSPContext> csp = new nsCSPContext(); RefPtr<nsCSPContext> csp = new nsCSPContext();
// Hard code some default values until we have a use case where we can provide // Hard code some default values until we have a use case where we can provide
// something else. // something else.

View File

@@ -194,9 +194,9 @@ nsresult CSP_AppendCSPFromHeader(nsIContentSecurityPolicy* aCsp,
/* =============== Helpers ================== */ /* =============== Helpers ================== */
already_AddRefed<nsIContentSecurityPolicy> CSP_CreateFromHeader(const nsAString& aHeaderValue, nsIURI* aSelfURI, already_AddRefed<nsIContentSecurityPolicy> CSP_CreateFromHeader(
nsIPrincipal* aLoadingPrincipal, const nsAString& aHeaderValue, nsIURI* aSelfURI,
mozilla::ErrorResult& aRv); nsIPrincipal* aLoadingPrincipal, mozilla::ErrorResult& aRv);
class nsCSPHostSrc; class nsCSPHostSrc;

View File

@@ -20,11 +20,7 @@ class nsIStreamListener;
"@mozilla.org/contentsecuritymanager;1" "@mozilla.org/contentsecuritymanager;1"
// cdcc1ab8-3cea-4e6c-a294-a651fa35227f // cdcc1ab8-3cea-4e6c-a294-a651fa35227f
#define NS_CONTENTSECURITYMANAGER_CID \ #define NS_CONTENTSECURITYMANAGER_CID \
{ \ {0xcdcc1ab8, 0x3cea, 0x4e6c, {0xa2, 0x94, 0xa6, 0x51, 0xfa, 0x35, 0x22, 0x7f}}
0xcdcc1ab8, 0x3cea, 0x4e6c, { \
0xa2, 0x94, 0xa6, 0x51, 0xfa, 0x35, 0x22, 0x7f \
} \
}
class nsContentSecurityManager : public nsIContentSecurityManager, class nsContentSecurityManager : public nsIContentSecurityManager,
public nsIChannelEventSink { public nsIChannelEventSink {

View File

@@ -10,11 +10,7 @@
#define NS_MIXEDCONTENTBLOCKER_CONTRACTID "@mozilla.org/mixedcontentblocker;1" #define NS_MIXEDCONTENTBLOCKER_CONTRACTID "@mozilla.org/mixedcontentblocker;1"
/* daf1461b-bf29-4f88-8d0e-4bcdf332c862 */ /* daf1461b-bf29-4f88-8d0e-4bcdf332c862 */
#define NS_MIXEDCONTENTBLOCKER_CID \ #define NS_MIXEDCONTENTBLOCKER_CID \
{ \ {0xdaf1461b, 0xbf29, 0x4f88, {0x8d, 0x0e, 0x4b, 0xcd, 0xf3, 0x32, 0xc8, 0x62}}
0xdaf1461b, 0xbf29, 0x4f88, { \
0x8d, 0x0e, 0x4b, 0xcd, 0xf3, 0x32, 0xc8, 0x62 \
} \
}
// This enum defines type of content that is detected when an // This enum defines type of content that is detected when an
// nsMixedContentEvent fires // nsMixedContentEvent fires

View File

@@ -775,8 +775,10 @@ void Sanitizer::SanitizeChildren(nsINode* aNode, bool aSafe) {
child = next) { child = next) {
next = child->GetNextSibling(); next = child->GetNextSibling();
// Step 1.1. Assert: child implements Text, Comment, Element, or DocumentType. // Step 1.1. Assert: child implements Text, Comment, Element, or
MOZ_ASSERT(child->IsText() || child->IsComment() || child->IsElement() || child->NodeType() == nsINode::DOCUMENT_TYPE_NODE); // DocumentType.
MOZ_ASSERT(child->IsText() || child->IsComment() || child->IsElement() ||
child->NodeType() == nsINode::DOCUMENT_TYPE_NODE);
// Step 1.2. If child implements DocumentType, then continue. // Step 1.2. If child implements DocumentType, then continue.
if (child->NodeType() == nsINode::DOCUMENT_TYPE_NODE) { if (child->NodeType() == nsINode::DOCUMENT_TYPE_NODE) {

View File

@@ -137,8 +137,8 @@ class ViewTransition final : public nsISupports, public nsWrapperCache {
void ClearActiveTransition(bool aIsDocumentHidden); void ClearActiveTransition(bool aIsDocumentHidden);
void Timeout(); void Timeout();
MOZ_CAN_RUN_SCRIPT void Setup(); MOZ_CAN_RUN_SCRIPT void Setup();
[[nodiscard]] MOZ_CAN_RUN_SCRIPT [[nodiscard]] MOZ_CAN_RUN_SCRIPT Maybe<SkipTransitionReason>
Maybe<SkipTransitionReason> CaptureOldState(); CaptureOldState();
[[nodiscard]] Maybe<SkipTransitionReason> CaptureNewState(); [[nodiscard]] Maybe<SkipTransitionReason> CaptureNewState();
void SetupTransitionPseudoElements(); void SetupTransitionPseudoElements();
[[nodiscard]] bool UpdatePseudoElementStyles(bool aNeedsInvalidation); [[nodiscard]] bool UpdatePseudoElementStyles(bool aNeedsInvalidation);

View File

@@ -203,7 +203,8 @@ struct FeatureImplementationStatus {
return implemented(WGPUWEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC); return implemented(WGPUWEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC);
case dom::GPUFeatureName::Texture_compression_astc_sliced_3d: case dom::GPUFeatureName::Texture_compression_astc_sliced_3d:
return implemented(WGPUWEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC_SLICED_3D); return implemented(
WGPUWEBGPU_FEATURE_TEXTURE_COMPRESSION_ASTC_SLICED_3D);
case dom::GPUFeatureName::Timestamp_query: case dom::GPUFeatureName::Timestamp_query:
return implemented(WGPUWEBGPU_FEATURE_TIMESTAMP_QUERY); return implemented(WGPUWEBGPU_FEATURE_TIMESTAMP_QUERY);

View File

@@ -31,10 +31,14 @@
/** Magic constants that should match the entries in constants.ts's kBit.f64 */ /** Magic constants that should match the entries in constants.ts's kBit.f64 */
constexpr double kF64NegativeMin = std::bit_cast<double>(0xFFEFFFFFFFFFFFFFull); constexpr double kF64NegativeMin = std::bit_cast<double>(0xFFEFFFFFFFFFFFFFull);
constexpr double kF64NegativeMax = std::bit_cast<double>(0x8010000000000000ull); constexpr double kF64NegativeMax = std::bit_cast<double>(0x8010000000000000ull);
constexpr double kF64NegativeSubnormalMin = std::bit_cast<double>(0x800FFFFFFFFFFFFFull); constexpr double kF64NegativeSubnormalMin =
constexpr double kF64NegativeSubnormalMax = std::bit_cast<double>(0x8000000000000001ull); std::bit_cast<double>(0x800FFFFFFFFFFFFFull);
constexpr double kF64PositiveSubnormalMin = std::bit_cast<double>(0x0000000000000001ull); constexpr double kF64NegativeSubnormalMax =
constexpr double kF64PositiveSubnormalMax = std::bit_cast<double>(0x000FFFFFFFFFFFFFull); std::bit_cast<double>(0x8000000000000001ull);
constexpr double kF64PositiveSubnormalMin =
std::bit_cast<double>(0x0000000000000001ull);
constexpr double kF64PositiveSubnormalMax =
std::bit_cast<double>(0x000FFFFFFFFFFFFFull);
constexpr double kF64PositiveMin = std::bit_cast<double>(0x0010000000000000ull); constexpr double kF64PositiveMin = std::bit_cast<double>(0x0010000000000000ull);
constexpr double kF64PositiveMax = std::bit_cast<double>(0x7FEFFFFFFFFFFFFFull); constexpr double kF64PositiveMax = std::bit_cast<double>(0x7FEFFFFFFFFFFFFFull);
@@ -57,8 +61,7 @@ const std::map<double, std::string> kInterestingF64s = {
{0.125, "0.125"}, {0.125, "0.125"},
{1.0, "1.0"}, {1.0, "1.0"},
{10.0, "10.0"}, {10.0, "10.0"},
{ kF64PositiveMax, "kValue.f64.positive.max"} {kF64PositiveMax, "kValue.f64.positive.max"}};
};
/** Additional values to use for testing 'fract' */ /** Additional values to use for testing 'fract' */
const std::map<double, std::string> kFractF64s = { const std::map<double, std::string> kFractF64s = {
@@ -69,8 +72,12 @@ const std::map<double, std::string> kFractF64s = {
{-1, "-1"}, // -1 -> 0 {-1, "-1"}, // -1 -> 0
{-2, "-2"}, // -2 -> 0 {-2, "-2"}, // -2 -> 0
{10.0000999999999997669, "10.0000999999999997669"}, // ~10.0001 -> ~0.0001 {10.0000999999999997669, "10.0000999999999997669"}, // ~10.0001 -> ~0.0001
{ -10.0000999999999997669, "-10.0000999999999997669" }, // -10.0001 -> ~0.9999 {-10.0000999999999997669,
{ 3937509.87755102012306, "3937509.87755102012306" }, // 3937509.87755102012306 -> ~0.877551..., not [0, 0.75], https://github.com/gpuweb/gpuweb/issues/4523 "-10.0000999999999997669"}, // -10.0001 -> ~0.9999
{3937509.87755102012306,
"3937509.87755102012306"}, // 3937509.87755102012306 -> ~0.877551..., not
// [0, 0.75],
// https://github.com/gpuweb/gpuweb/issues/4523
}; };
/** /**
@@ -88,7 +95,8 @@ std::string printAbstractFloat(const double val) {
assert("Generated a NaN"); assert("Generated a NaN");
} }
if (const auto iter = kInterestingF64s.find(val); iter != kInterestingF64s.end()) { if (const auto iter = kInterestingF64s.find(val);
iter != kInterestingF64s.end()) {
return iter->second; return iter->second;
} }
@@ -97,7 +105,9 @@ std::string printAbstractFloat(const double val) {
if (val == round(val) && fabs(val) < 100000) { if (val == round(val) && fabs(val) < 100000) {
ss << val; ss << val;
} else { } else {
ss << "reinterpretU64AsF64(0x" << std::hex << std::setfill('0') << std::setw(16) << std::bit_cast<uint64_t>(val) << "n) /* " << val << " */"; ss << "reinterpretU64AsF64(0x" << std::hex << std::setfill('0')
<< std::setw(16) << std::bit_cast<uint64_t>(val) << "n) /* " << val
<< " */";
} }
return ss.str(); return ss.str();
} }
@@ -136,7 +146,8 @@ std::tuple<double, double> quantizeToAbstractFloat(const long double val) {
* Generates a string for an unary operation result that can be copied into a * Generates a string for an unary operation result that can be copied into a
* CTS test file. * CTS test file.
*/ */
std::string printBinaryCase(const std::string &input, const std::vector<double> &result) { std::string printBinaryCase(const std::string& input,
const std::vector<double>& result) {
assert(!result.empty()); assert(!result.empty());
std::stringstream ss; std::stringstream ss;
ss << "{ input: "; ss << "{ input: ";
@@ -157,7 +168,8 @@ std::string printBinaryCase(const std::string &input, const std::vector<double>
* Generates a string for a binary operation result that can be copied into a * Generates a string for a binary operation result that can be copied into a
* CTS test file. * CTS test file.
*/ */
std::string printBinaryCase(const std::string &lhs, const std::string &rhs, const std::vector<double> &result) { std::string printBinaryCase(const std::string& lhs, const std::string& rhs,
const std::vector<double>& result) {
assert(!result.empty()); assert(!result.empty());
std::stringstream ss; std::stringstream ss;
ss << "{ lhs: "; ss << "{ lhs: ";
@@ -183,25 +195,26 @@ const BinaryOp kAdditionOp= [](const long double lhs, const long double rhs) {
return lhs + rhs; return lhs + rhs;
}; };
const BinaryOp kSubtractionOp= [](const long double lhs, const long double rhs) { const BinaryOp kSubtractionOp = [](const long double lhs,
return lhs - rhs; const long double rhs) { return lhs - rhs; };
};
const BinaryOp kMultiplicationOp= [](const long double lhs, const long double rhs) { const BinaryOp kMultiplicationOp =
return lhs * rhs; [](const long double lhs, const long double rhs) { return lhs * rhs; };
};
/** /**
* Calculates all of the possible results for a binary operation given the * Calculates all of the possible results for a binary operation given the
* provided inputs. This handles both quantization and flushing behaviours. * provided inputs. This handles both quantization and flushing behaviours.
*/ */
std::vector<double> calculateBinaryResults(const BinaryOp op, long double lhs, long double rhs) { std::vector<double> calculateBinaryResults(const BinaryOp op, long double lhs,
long double rhs) {
// CTS needs to consider that subnormals may be flushed to zero at // CTS needs to consider that subnormals may be flushed to zero at
// any point, so applying potential flushings to get additional // any point, so applying potential flushings to get additional
// results. // results.
std::set<double> results; std::set<double> results;
for (const auto l: couldBeFlushed(lhs) ? std::vector{0, lhs} : std::vector{lhs}) { for (const auto l :
for (const auto r: couldBeFlushed(rhs) ? std::vector{0, rhs} : std::vector{rhs}) { couldBeFlushed(lhs) ? std::vector{0, lhs} : std::vector{lhs}) {
for (const auto r :
couldBeFlushed(rhs) ? std::vector{0, rhs} : std::vector{rhs}) {
const auto [downward, upward] = quantizeToAbstractFloat(op(l, r)); const auto [downward, upward] = quantizeToAbstractFloat(op(l, r));
results.insert(downward); results.insert(downward);
results.insert(upward); results.insert(upward);
@@ -220,7 +233,9 @@ std::string printBinaryOpCases(const BinaryOp op, const std::string& name) {
ss << "BEGIN " << name << " CASES" << std::endl; ss << "BEGIN " << name << " CASES" << std::endl;
for (const auto& [lhs, lhs_str] : kInterestingF64s) { for (const auto& [lhs, lhs_str] : kInterestingF64s) {
for (const auto& [rhs, rhs_str] : kInterestingF64s) { for (const auto& [rhs, rhs_str] : kInterestingF64s) {
ss << printBinaryCase(lhs_str, rhs_str, calculateBinaryResults(op, lhs, rhs)) << "," << std::endl; ss << printBinaryCase(lhs_str, rhs_str,
calculateBinaryResults(op, lhs, rhs))
<< "," << std::endl;
} }
} }
ss << "END " << name << " CASES" << std::endl; ss << "END " << name << " CASES" << std::endl;
@@ -238,24 +253,31 @@ std::string printFractCases() {
// because floor of a double is guaranteed to be a double, and all of // because floor of a double is guaranteed to be a double, and all of
// the values in kInterestingF64s and kFractF64s are doubles. // the values in kInterestingF64s and kFractF64s are doubles.
for (const auto& [input, input_str] : kInterestingF64s) { for (const auto& [input, input_str] : kInterestingF64s) {
ss << printBinaryCase(input_str, calculateBinaryResults(kSubtractionOp, input, floor(input))) << "," << std::endl; ss << printBinaryCase(input_str, calculateBinaryResults(
kSubtractionOp, input, floor(input)))
<< "," << std::endl;
} }
for (const auto& [input, input_str] : kFractF64s) { for (const auto& [input, input_str] : kFractF64s) {
ss << printBinaryCase(input_str, calculateBinaryResults(kSubtractionOp, input, floor(input))) << "," << std::endl; ss << printBinaryCase(input_str, calculateBinaryResults(
kSubtractionOp, input, floor(input)))
<< "," << std::endl;
} }
ss << "END FRACT CASES" << std::endl; ss << "END FRACT CASES" << std::endl;
return ss.str(); return ss.str();
} }
int main() { int main() {
assert(sizeof(double) < sizeof(long double) && "Need higher precision long double"); assert(sizeof(double) < sizeof(long double) &&
assert(sizeof(long double) == 16 && "Code assume 'proper' quad support, not some other higher precision floating point implementation"); "Need higher precision long double");
assert(sizeof(long double) == 16 &&
"Code assume 'proper' quad support, not some other higher precision "
"floating point implementation");
{ {
// Confirms that calculating f64 imprecise results generates two possible // Confirms that calculating f64 imprecise results generates two possible
// roundings. // roundings.
const auto [begin, end] = const auto [begin, end] = quantizeToAbstractFloat(
quantizeToAbstractFloat(static_cast<long double>(0.1) * static_cast<long double>(0.1)); static_cast<long double>(0.1) * static_cast<long double>(0.1));
assert(std::bit_cast<uint64_t>(begin) == 0x3F847AE147AE147bull && assert(std::bit_cast<uint64_t>(begin) == 0x3F847AE147AE147bull &&
std::bit_cast<uint64_t>(end) == 0x3F847AE147AE147Cull && std::bit_cast<uint64_t>(end) == 0x3F847AE147AE147Cull &&
"0.1 * 0.1 returned unexpected values"); "0.1 * 0.1 returned unexpected values");
@@ -263,7 +285,8 @@ int main() {
std::cout << printBinaryOpCases(kAdditionOp, "ADDITION") << std::endl; std::cout << printBinaryOpCases(kAdditionOp, "ADDITION") << std::endl;
std::cout << printBinaryOpCases(kSubtractionOp, "SUBTRACTION") << std::endl; std::cout << printBinaryOpCases(kSubtractionOp, "SUBTRACTION") << std::endl;
std::cout << printBinaryOpCases(kMultiplicationOp, "MULTIPLICATION") << std::endl; std::cout << printBinaryOpCases(kMultiplicationOp, "MULTIPLICATION")
<< std::endl;
std::cout << printFractCases() << std::endl; std::cout << printFractCases() << std::endl;
return 0; return 0;

View File

@@ -726,8 +726,7 @@ bool txXSLTNumber::isAlphaNumeric(char16_t ch) {
{ 0xFF66, 0xFFBE }, { 0xFF66, 0xFFBE },
{ 0xFFC2, 0xFFC7 }, { 0xFFC2, 0xFFC7 },
{ 0xFFCA, 0xFFCF }, { 0xFFCA, 0xFFCF },
{ 0xFFD2, 0xFFD7 } { 0xFFD2, 0xFFD7 } // clang-format on
// clang-format on
}; };
CharRange search = {ch, ch}; CharRange search = {ch, ch};

View File

@@ -72,8 +72,7 @@ XULResizerElement::Direction XULResizerElement::GetDirection() {
{-1, -1}, {0, -1}, {1, -1}, {-1, -1}, {0, -1}, {1, -1},
{-1, 0}, {1, 0}, {-1, 0}, {1, 0},
{-1, 1}, {0, 1}, {1, 1}, {-1, 1}, {0, 1}, {1, 1},
{-1, 1}, {1, 1} {-1, 1}, {1, 1} // clang-format on
// clang-format on
}; };
const auto* frame = GetPrimaryFrame(); const auto* frame = GetPrimaryFrame();

View File

@@ -44,8 +44,7 @@ NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE_WITH_LAST_RELEASE(TransactionItem,
NS_IMPL_CYCLE_COLLECTION_CLASS(TransactionItem) NS_IMPL_CYCLE_COLLECTION_CLASS(TransactionItem)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TransactionItem) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TransactionItem) tmp->CleanUp();
tmp->CleanUp();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TransactionItem) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TransactionItem)

View File

@@ -81,11 +81,7 @@
#define MOZ_HUNSPELL_CONTRACTID "@mozilla.org/spellchecker/engine;1" #define MOZ_HUNSPELL_CONTRACTID "@mozilla.org/spellchecker/engine;1"
#define MOZ_HUNSPELL_CID \ #define MOZ_HUNSPELL_CID \
/* 56c778e4-1bee-45f3-a689-886692a97fe7 */ \ /* 56c778e4-1bee-45f3-a689-886692a97fe7 */ \
{ \ {0x56c778e4, 0x1bee, 0x45f3, {0xa6, 0x89, 0x88, 0x66, 0x92, 0xa9, 0x7f, 0xe7}}
0x56c778e4, 0x1bee, 0x45f3, { \
0xa6, 0x89, 0x88, 0x66, 0x92, 0xa9, 0x7f, 0xe7 \
} \
}
class mozHunspell final : public mozISpellCheckingEngine, class mozHunspell final : public mozISpellCheckingEngine,
public nsIObserver, public nsIObserver,

View File

@@ -21,10 +21,10 @@
"@mozilla.org/spellchecker/personaldictionary;1" "@mozilla.org/spellchecker/personaldictionary;1"
#define MOZ_PERSONALDICTIONARY_CID \ #define MOZ_PERSONALDICTIONARY_CID \
{/* 7EF52EAF-B7E1-462B-87E2-5D1DBACA9048 */ \ {/* 7EF52EAF-B7E1-462B-87E2-5D1DBACA9048 */ \
0X7EF52EAF, 0XB7E1, 0X462B, { \ 0X7EF52EAF, \
0X87, 0XE2, 0X5D, 0X1D, 0XBA, 0XCA, 0X90, 0X48 \ 0XB7E1, \
} \ 0X462B, \
} {0X87, 0XE2, 0X5D, 0X1D, 0XBA, 0XCA, 0X90, 0X48}}
class mozPersonalDictionaryLoader; class mozPersonalDictionaryLoader;
class mozPersonalDictionarySave; class mozPersonalDictionarySave;

View File

@@ -1957,7 +1957,6 @@ class DrawTarget : public external::AtomicRefCounted<DrawTarget> {
return CreateSimilarDrawTarget(aSize, aFormat); return CreateSimilarDrawTarget(aSize, aFormat);
} }
/** /**
* Get the BackendType of Paths/PathBuilders created from this DrawTarget. * Get the BackendType of Paths/PathBuilders created from this DrawTarget.
* This will usually just be the same as the DrawTarget's BackendType. * This will usually just be the same as the DrawTarget's BackendType.

View File

@@ -106,7 +106,9 @@ bool GLXLibrary::EnsureInitialized(Display* aDisplay) {
#define SYMBOL(X) \ #define SYMBOL(X) \
{ \ { \
(PRFuncPtr*)&mSymbols.f##X, { \ (PRFuncPtr*)&mSymbols.f##X, { \
{ "glX" #X } \ { \
"glX" #X \
} \
} \ } \
} }
#define END_OF_SYMBOLS \ #define END_OF_SYMBOLS \

View File

@@ -97,7 +97,9 @@ bool WGLLibrary::EnsureInitialized() {
#define SYMBOL(X) \ #define SYMBOL(X) \
{ \ { \
(PRFuncPtr*)&mSymbols.f##X, { \ (PRFuncPtr*)&mSymbols.f##X, { \
{ "wgl" #X } \ { \
"wgl" #X \
} \
} \ } \
} }
#define END_OF_SYMBOLS \ #define END_OF_SYMBOLS \

View File

@@ -150,8 +150,7 @@ static auto ForEachNode(Node aRoot, const PreAction& aPreAction,
* ForEachNode pre-order traversal, using TraversalFlag. * ForEachNode pre-order traversal, using TraversalFlag.
*/ */
template <typename Iterator, typename Node, typename PreAction> template <typename Iterator, typename Node, typename PreAction>
auto ForEachNode(Node aRoot, const PreAction& aPreAction) auto ForEachNode(Node aRoot, const PreAction& aPreAction) -> std::enable_if_t<
-> std::enable_if_t<
std::is_same_v<decltype(aPreAction(aRoot)), TraversalFlag>, bool> { std::is_same_v<decltype(aPreAction(aRoot)), TraversalFlag>, bool> {
return ForEachNode<Iterator>( return ForEachNode<Iterator>(
aRoot, aPreAction, [](Node aNode) { return TraversalFlag::Continue; }); aRoot, aPreAction, [](Node aNode) { return TraversalFlag::Continue; });

View File

@@ -37,7 +37,6 @@ namespace layers {
// //
class FenceD3D11 final : public Fence { class FenceD3D11 final : public Fence {
public: public:
static RefPtr<FenceD3D11> Create(ID3D11Device* aDevice); static RefPtr<FenceD3D11> Create(ID3D11Device* aDevice);
static RefPtr<FenceD3D11> CreateFromHandle( static RefPtr<FenceD3D11> CreateFromHandle(
RefPtr<gfx::FileHandleWrapper> aHandle, RefPtr<gfx::FileHandleWrapper> aHandle,

View File

@@ -8,24 +8,12 @@
#define nsGfxCIID_h__ #define nsGfxCIID_h__
#define NS_FONT_ENUMERATOR_CID \ #define NS_FONT_ENUMERATOR_CID \
{ \ {0xa6cf9115, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
0xa6cf9115, 0x15b3, 0x11d2, { \
0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 \
} \
}
#define NS_SCRIPTABLE_REGION_CID \ #define NS_SCRIPTABLE_REGION_CID \
{ \ {0xda5b130a, 0x1dd1, 0x11b2, {0xad, 0x47, 0xf4, 0x55, 0xb1, 0x81, 0x4a, 0x78}}
0xda5b130a, 0x1dd1, 0x11b2, { \
0xad, 0x47, 0xf4, 0x55, 0xb1, 0x81, 0x4a, 0x78 \
} \
}
#define NS_GFX_INITIALIZATION_CID \ #define NS_GFX_INITIALIZATION_CID \
{ \ {0x67c41576, 0x9664, 0x4ed5, {0x90, 0xc1, 0xf6, 0x68, 0x3f, 0xd5, 0x2c, 0x8f}}
0x67c41576, 0x9664, 0x4ed5, { \
0x90, 0xc1, 0xf6, 0x68, 0x3f, 0xd5, 0x2c, 0x8f \
} \
}
#endif #endif

View File

@@ -644,10 +644,14 @@ TEST(Gfx, gfxRect)
} }
TEST(Gfx, nsRectAbsolute) TEST(Gfx, nsRectAbsolute)
{ TestUnionEmptyRects<nsRectAbsolute>(); } {
TestUnionEmptyRects<nsRectAbsolute>();
}
TEST(Gfx, IntRectAbsolute) TEST(Gfx, IntRectAbsolute)
{ TestUnionEmptyRects<IntRectAbsolute>(); } {
TestUnionEmptyRects<IntRectAbsolute>();
}
static void TestMoveInsideAndClamp(IntRect aSrc, IntRect aTarget, static void TestMoveInsideAndClamp(IntRect aSrc, IntRect aTarget,
IntRect aExpected) { IntRect aExpected) {

View File

@@ -122,16 +122,24 @@ TEST(Gfx, RegionSingleRect)
} }
TEST(Gfx, RegionNonRectangular) TEST(Gfx, RegionNonRectangular)
{ TestLargestRegion::TestNonRectangular(); } {
TestLargestRegion::TestNonRectangular();
}
TEST(Gfx, RegionTwoRectTest) TEST(Gfx, RegionTwoRectTest)
{ TestLargestRegion::TwoRectTest(); } {
TestLargestRegion::TwoRectTest();
}
TEST(Gfx, RegionContainsSpecifiedRect) TEST(Gfx, RegionContainsSpecifiedRect)
{ TestLargestRegion::TestContainsSpecifiedRect(); } {
TestLargestRegion::TestContainsSpecifiedRect();
}
TEST(Gfx, RegionTestContainsSpecifiedOverflowingRect) TEST(Gfx, RegionTestContainsSpecifiedOverflowingRect)
{ TestLargestRegion::TestContainsSpecifiedOverflowingRect(); } {
TestLargestRegion::TestContainsSpecifiedOverflowingRect();
}
TEST(Gfx, RegionScaleToInside) TEST(Gfx, RegionScaleToInside)
{ {

View File

@@ -3317,7 +3317,8 @@ already_AddRefed<gfxFont> gfxFontGroup::FindFontForChar(
return true; return true;
} }
// Does the candidate font provide a color glyph for the current character? // Does the candidate font provide a color glyph for the current character?
bool hasColorGlyph = f->HasColorGlyphFor(aCh, aNextCh) || bool hasColorGlyph =
f->HasColorGlyphFor(aCh, aNextCh) ||
(!nextIsVarSelector && f->HasColorGlyphFor(aCh, kVariationSelector16)); (!nextIsVarSelector && f->HasColorGlyphFor(aCh, kVariationSelector16));
// If the provided glyph matches the preference, accept the font. // If the provided glyph matches the preference, accept the font.
if (hasColorGlyph == PrefersColor(presentation)) { if (hasColorGlyph == PrefersColor(presentation)) {

View File

@@ -15,8 +15,7 @@
#include "nsString.h" #include "nsString.h"
gfxWindowsSurface::gfxWindowsSurface(HDC dc, uint32_t flags) gfxWindowsSurface::gfxWindowsSurface(HDC dc, uint32_t flags) : mDC(dc) {
: mDC(dc) {
InitWithDC(flags); InitWithDC(flags);
} }

View File

@@ -11,11 +11,7 @@
// 5baca10a-4d53-4335-b24d-c69696640a9a // 5baca10a-4d53-4335-b24d-c69696640a9a
#define NS_FXRCOMMANDLINEHANDLER_CID \ #define NS_FXRCOMMANDLINEHANDLER_CID \
{ \ {0x5baca10a, 0x4d53, 0x4335, {0xb2, 0x4d, 0xc6, 0x96, 0x96, 0x64, 0x0a, 0x9a}}
0x5baca10a, 0x4d53, 0x4335, { \
0xb2, 0x4d, 0xc6, 0x96, 0x96, 0x64, 0x0a, 0x9a \
} \
}
// nsFxrCommandLineHandler is responsible for handling parameters used to // nsFxrCommandLineHandler is responsible for handling parameters used to
// bootstrap Firefox Reality running on desktop-class machines. // bootstrap Firefox Reality running on desktop-class machines.

View File

@@ -371,7 +371,8 @@ bool RenderDXGITextureHost::LockInternal() {
if (!mLocked) { if (!mLocked) {
if (mFencesHolderId.isSome()) { if (mFencesHolderId.isSome()) {
auto* fencesHolderMap = layers::CompositeProcessD3D11FencesHolderMap::Get(); auto* fencesHolderMap =
layers::CompositeProcessD3D11FencesHolderMap::Get();
if (!fencesHolderMap) { if (!fencesHolderMap) {
MOZ_ASSERT_UNREACHABLE("unexpected to be called"); MOZ_ASSERT_UNREACHABLE("unexpected to be called");
return false; return false;

View File

@@ -17,7 +17,8 @@ using namespace Microsoft::WRL;
// A basic composition layer backed by a swap-chain for DirectComposition // A basic composition layer backed by a swap-chain for DirectComposition
class Layer { class Layer {
public: public:
Layer(int width, int height, bool is_opaque, const ComPtr<IDXGIFactory2>& dxgiFactory, Layer(int width, int height, bool is_opaque,
const ComPtr<IDXGIFactory2>& dxgiFactory,
const ComPtr<ID3D11Device>& d3dDevice, const ComPtr<ID3D11Device>& d3dDevice,
const ComPtr<IDCompositionDesktopDevice>& dCompDevice) { const ComPtr<IDCompositionDesktopDevice>& dCompDevice) {
HRESULT hr; HRESULT hr;
@@ -33,7 +34,8 @@ class Layer {
// DXGI_SCALING_NONE caused swap chain creation failure. // DXGI_SCALING_NONE caused swap chain creation failure.
desc.Scaling = DXGI_SCALING_STRETCH; desc.Scaling = DXGI_SCALING_STRETCH;
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.AlphaMode = is_opaque ? DXGI_ALPHA_MODE_IGNORE : DXGI_ALPHA_MODE_PREMULTIPLIED; desc.AlphaMode =
is_opaque ? DXGI_ALPHA_MODE_IGNORE : DXGI_ALPHA_MODE_PREMULTIPLIED;
desc.Flags = 0; desc.Flags = 0;
// Create a swap-chain, visual, attach them and get the backbuffer texture // Create a swap-chain, visual, attach them and get the backbuffer texture
@@ -105,15 +107,13 @@ class Compositor {
// Construct a layer of given dimensions. // Construct a layer of given dimensions.
Layer* create_layer(int width, int height, bool is_opaque) { Layer* create_layer(int width, int height, bool is_opaque) {
Layer* layer = Layer* layer = new Layer(width, height, is_opaque, pIDXGIFactory,
new Layer(width, height, is_opaque, pIDXGIFactory, pD3DDevice, pDCompDevice); pD3DDevice, pDCompDevice);
return layer; return layer;
} }
void begin_frame() { void begin_frame() { pRootVisual->RemoveAllVisuals(); }
pRootVisual->RemoveAllVisuals();
}
void add_layer(Layer* layer) { void add_layer(Layer* layer) {
// TODO(gwc): Don't add the visual during creation. Once we support multiple // TODO(gwc): Don't add the visual during creation. Once we support multiple
@@ -148,7 +148,8 @@ Compositor* wrc_new(void* d3d11_device, void* hwnd) {
void wrc_delete(Compositor* compositor) { delete compositor; } void wrc_delete(Compositor* compositor) { delete compositor; }
Layer* wrc_create_layer(Compositor* compositor, int width, int height, bool is_opaque) { Layer* wrc_create_layer(Compositor* compositor, int width, int height,
bool is_opaque) {
return compositor->create_layer(width, height, is_opaque); return compositor->create_layer(width, height, is_opaque);
} }
@@ -171,7 +172,6 @@ void wrc_set_layer_position(Layer *layer, float x, float y) {
layer->mVisual->SetOffsetX(x); layer->mVisual->SetOffsetX(x);
layer->mVisual->SetOffsetY(y); layer->mVisual->SetOffsetY(y);
} }
} }
#endif #endif

View File

@@ -14,10 +14,10 @@ namespace image {
#define IMAGEBLOCKER_CONTRACTID "@mozilla.org/image-blocker-content-policy;1" #define IMAGEBLOCKER_CONTRACTID "@mozilla.org/image-blocker-content-policy;1"
#define IMAGEBLOCKER_CID \ #define IMAGEBLOCKER_CID \
{/* f6fcd651-164b-4416-b001-9c8c393fd93b */ \ {/* f6fcd651-164b-4416-b001-9c8c393fd93b */ \
0xf6fcd651, 0x164b, 0x4416, { \ 0xf6fcd651, \
0xb0, 0x01, 0x9c, 0x8c, 0x39, 0x3f, 0xd9, 0x3b \ 0x164b, \
} \ 0x4416, \
} {0xb0, 0x01, 0x9c, 0x8c, 0x39, 0x3f, 0xd9, 0x3b}}
class ImageBlocker final : public nsIContentPolicy { class ImageBlocker final : public nsIContentPolicy {
~ImageBlocker() = default; ~ImageBlocker() = default;

View File

@@ -49,10 +49,10 @@ class nsIRequest;
#define NS_RASTERIMAGE_CID \ #define NS_RASTERIMAGE_CID \
{/* 376ff2c1-9bf6-418a-b143-3340c00112f7 */ \ {/* 376ff2c1-9bf6-418a-b143-3340c00112f7 */ \
0x376ff2c1, 0x9bf6, 0x418a, { \ 0x376ff2c1, \
0xb1, 0x43, 0x33, 0x40, 0xc0, 0x01, 0x12, 0xf7 \ 0x9bf6, \
} \ 0x418a, \
} {0xb1, 0x43, 0x33, 0x40, 0xc0, 0x01, 0x12, 0xf7}}
/** /**
* Handles static and animated image containers. * Handles static and animated image containers.

View File

@@ -120,10 +120,10 @@ static GdkRGBA GetForegroundColor(nsIMozIconURI* aIconURI) {
} }
return dark ? mozilla::ColorScheme::Dark : mozilla::ColorScheme::Light; return dark ? mozilla::ColorScheme::Dark : mozilla::ColorScheme::Light;
}(); }();
auto color = mozilla::LookAndFeel::Color(mozilla::LookAndFeel::ColorID::Windowtext, scheme, mozilla::LookAndFeel::UseStandins::No); auto color = mozilla::LookAndFeel::Color(
auto ToGdk = [](uint8_t aGecko) { mozilla::LookAndFeel::ColorID::Windowtext, scheme,
return aGecko / 255.0; mozilla::LookAndFeel::UseStandins::No);
}; auto ToGdk = [](uint8_t aGecko) { return aGecko / 255.0; };
return GdkRGBA{ return GdkRGBA{
.red = ToGdk(NS_GET_R(color)), .red = ToGdk(NS_GET_R(color)),
.green = ToGdk(NS_GET_G(color)), .green = ToGdk(NS_GET_G(color)),
@@ -353,5 +353,4 @@ nsresult nsIconChannel::Init(nsIURI* aURI) {
return StreamToChannel(stream.forget(), aURI, getter_AddRefs(mRealChannel)); return StreamToChannel(stream.forget(), aURI, getter_AddRefs(mRealChannel));
} }
void nsIconChannel::Shutdown() { void nsIconChannel::Shutdown() {}
}

View File

@@ -94,7 +94,6 @@ nsMozIconURI::GetSpec(nsACString& aSpec) {
aSpec.Append(buf); aSpec.Append(buf);
} }
if (!mContentType.IsEmpty()) { if (!mContentType.IsEmpty()) {
aSpec += "&contentType="; aSpec += "&contentType=";
aSpec += mContentType.get(); aSpec += mContentType.get();

View File

@@ -16,10 +16,10 @@
#define NS_THIS_ICONURI_IMPLEMENTATION_CID \ #define NS_THIS_ICONURI_IMPLEMENTATION_CID \
{/* 0b9bb0c2-fee6-470b-b9b9-9fd9462b5e19 */ \ {/* 0b9bb0c2-fee6-470b-b9b9-9fd9462b5e19 */ \
0x5c3e417f, 0xb686, 0x4105, { \ 0x5c3e417f, \
0x86, 0xe7, 0xf9, 0x1b, 0xac, 0x97, 0x4d, 0x5c \ 0xb686, \
} \ 0x4105, \
} {0x86, 0xe7, 0xf9, 0x1b, 0xac, 0x97, 0x4d, 0x5c}}
namespace mozilla { namespace mozilla {
class Encoding; class Encoding;

View File

@@ -16,10 +16,10 @@
#define NS_BMPENCODER_CID \ #define NS_BMPENCODER_CID \
{/* 13a5320c-4c91-4FA4-bd16-b081a3ba8c0b */ \ {/* 13a5320c-4c91-4FA4-bd16-b081a3ba8c0b */ \
0x13a5320c, 0x4c91, 0x4fa4, { \ 0x13a5320c, \
0xbd, 0x16, 0xb0, 0x81, 0xa3, 0Xba, 0x8c, 0x0b \ 0x4c91, \
} \ 0x4fa4, \
} {0xbd, 0x16, 0xb0, 0x81, 0xa3, 0Xba, 0x8c, 0x0b}}
namespace mozilla { namespace mozilla {
namespace image { namespace image {

View File

@@ -15,10 +15,10 @@
#define NS_ICOENCODER_CID \ #define NS_ICOENCODER_CID \
{/*92AE3AB2-8968-41B1-8709-B6123BCEAF21 */ \ {/*92AE3AB2-8968-41B1-8709-B6123BCEAF21 */ \
0x92ae3ab2, 0x8968, 0x41b1, { \ 0x92ae3ab2, \
0x87, 0x09, 0xb6, 0x12, 0x3b, 0Xce, 0xaf, 0x21 \ 0x8968, \
} \ 0x41b1, \
} {0x87, 0x09, 0xb6, 0x12, 0x3b, 0Xce, 0xaf, 0x21}}
// Provides ICO encoding functionality. Use InitFromData() to do the // Provides ICO encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options. // encoding. See that function definition for encoding options.

View File

@@ -17,12 +17,11 @@ struct jpeg_compress_struct;
struct jpeg_common_struct; struct jpeg_common_struct;
#define NS_JPEGENCODER_CID \ #define NS_JPEGENCODER_CID \
{ \ {/* ac2bb8fe-eeeb-4572-b40f-be03932b56e0 */ \
/* ac2bb8fe-eeeb-4572-b40f-be03932b56e0 */ \ 0xac2bb8fe, \
0xac2bb8fe, 0xeeeb, 0x4572, { \ 0xeeeb, \
0xb4, 0x0f, 0xbe, 0x03, 0x93, 0x2b, 0x56, 0xe0 \ 0x4572, \
} \ {0xb4, 0x0f, 0xbe, 0x03, 0x93, 0x2b, 0x56, 0xe0}}
}
// Provides JPEG encoding functionality. Use InitFromData() to do the // Provides JPEG encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options. // encoding. See that function definition for encoding options.

View File

@@ -16,10 +16,10 @@
#define NS_PNGENCODER_CID \ #define NS_PNGENCODER_CID \
{/* 38d1592e-b81e-432b-86f8-471878bbfe07 */ \ {/* 38d1592e-b81e-432b-86f8-471878bbfe07 */ \
0x38d1592e, 0xb81e, 0x432b, { \ 0x38d1592e, \
0x86, 0xf8, 0x47, 0x18, 0x78, 0xbb, 0xfe, 0x07 \ 0xb81e, \
} \ 0x432b, \
} {0x86, 0xf8, 0x47, 0x18, 0x78, 0xbb, 0xfe, 0x07}}
// Provides PNG encoding functionality. Use InitFromData() to do the // Provides PNG encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options. // encoding. See that function definition for encoding options.

View File

@@ -16,10 +16,10 @@
#define NS_WEBPENCODER_CID \ #define NS_WEBPENCODER_CID \
{/* a8e5a8e5-bebf-4512-9f50-e41e4748ce28 */ \ {/* a8e5a8e5-bebf-4512-9f50-e41e4748ce28 */ \
0xa8e5a8e5, 0xbebf, 0x4512, { \ 0xa8e5a8e5, \
0x9f, 0x50, 0xe4, 0x1e, 0x47, 0x48, 0xce, 0x28 \ 0xbebf, \
} \ 0x4512, \
} {0x9f, 0x50, 0xe4, 0x1e, 0x47, 0x48, 0xce, 0x28}}
// Provides WEBP encoding functionality. Use InitFromData() to do the // Provides WEBP encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options. // encoding. See that function definition for encoding options.

View File

@@ -11,10 +11,10 @@
#define NS_IMGTOOLS_CID \ #define NS_IMGTOOLS_CID \
{/* 3d8fa16d-c9e1-4b50-bdef-2c7ae249967a */ \ {/* 3d8fa16d-c9e1-4b50-bdef-2c7ae249967a */ \
0x3d8fa16d, 0xc9e1, 0x4b50, { \ 0x3d8fa16d, \
0xbd, 0xef, 0x2c, 0x7a, 0xe2, 0x49, 0x96, 0x7a \ 0xc9e1, \
} \ 0x4b50, \
} {0xbd, 0xef, 0x2c, 0x7a, 0xe2, 0x49, 0x96, 0x7a}}
namespace mozilla { namespace mozilla {
namespace image { namespace image {

View File

@@ -431,37 +431,59 @@ void CheckADAM7InterpolatingWritePixels(const IntSize& aSize) {
} }
TEST(ImageADAM7InterpolatingFilter, WritePixels100_100) TEST(ImageADAM7InterpolatingFilter, WritePixels100_100)
{ CheckADAM7InterpolatingWritePixels(IntSize(100, 100)); } {
CheckADAM7InterpolatingWritePixels(IntSize(100, 100));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels99_99) TEST(ImageADAM7InterpolatingFilter, WritePixels99_99)
{ CheckADAM7InterpolatingWritePixels(IntSize(99, 99)); } {
CheckADAM7InterpolatingWritePixels(IntSize(99, 99));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels66_33) TEST(ImageADAM7InterpolatingFilter, WritePixels66_33)
{ CheckADAM7InterpolatingWritePixels(IntSize(66, 33)); } {
CheckADAM7InterpolatingWritePixels(IntSize(66, 33));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels33_66) TEST(ImageADAM7InterpolatingFilter, WritePixels33_66)
{ CheckADAM7InterpolatingWritePixels(IntSize(33, 66)); } {
CheckADAM7InterpolatingWritePixels(IntSize(33, 66));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels15_15) TEST(ImageADAM7InterpolatingFilter, WritePixels15_15)
{ CheckADAM7InterpolatingWritePixels(IntSize(15, 15)); } {
CheckADAM7InterpolatingWritePixels(IntSize(15, 15));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels9_9) TEST(ImageADAM7InterpolatingFilter, WritePixels9_9)
{ CheckADAM7InterpolatingWritePixels(IntSize(9, 9)); } {
CheckADAM7InterpolatingWritePixels(IntSize(9, 9));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels8_8) TEST(ImageADAM7InterpolatingFilter, WritePixels8_8)
{ CheckADAM7InterpolatingWritePixels(IntSize(8, 8)); } {
CheckADAM7InterpolatingWritePixels(IntSize(8, 8));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels7_7) TEST(ImageADAM7InterpolatingFilter, WritePixels7_7)
{ CheckADAM7InterpolatingWritePixels(IntSize(7, 7)); } {
CheckADAM7InterpolatingWritePixels(IntSize(7, 7));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels3_3) TEST(ImageADAM7InterpolatingFilter, WritePixels3_3)
{ CheckADAM7InterpolatingWritePixels(IntSize(3, 3)); } {
CheckADAM7InterpolatingWritePixels(IntSize(3, 3));
}
TEST(ImageADAM7InterpolatingFilter, WritePixels1_1) TEST(ImageADAM7InterpolatingFilter, WritePixels1_1)
{ CheckADAM7InterpolatingWritePixels(IntSize(1, 1)); } {
CheckADAM7InterpolatingWritePixels(IntSize(1, 1));
}
TEST(ImageADAM7InterpolatingFilter, TrivialInterpolation48_48) TEST(ImageADAM7InterpolatingFilter, TrivialInterpolation48_48)
{ CheckInterpolation(IntSize(48, 48), {BGRAColor::Green()}); } {
CheckInterpolation(IntSize(48, 48), {BGRAColor::Green()});
}
TEST(ImageADAM7InterpolatingFilter, InterpolationOutput33_17) TEST(ImageADAM7InterpolatingFilter, InterpolationOutput33_17)
{ {
@@ -580,7 +602,9 @@ TEST(ImageADAM7InterpolatingFilter, InterpolationOutput3_3)
} }
TEST(ImageADAM7InterpolatingFilter, InterpolationOutput1_1) TEST(ImageADAM7InterpolatingFilter, InterpolationOutput1_1)
{ CheckInterpolation(IntSize(1, 1), {BGRAColor::Blue()}); } {
CheckInterpolation(IntSize(1, 1), {BGRAColor::Blue()});
}
TEST(ImageADAM7InterpolatingFilter, ADAM7InterpolationFailsFor0_0) TEST(ImageADAM7InterpolatingFilter, ADAM7InterpolationFailsFor0_0)
{ {

View File

@@ -167,10 +167,14 @@ static void TestWithBlendAnimationFilterClear(BlendMethod aBlendMethod) {
} }
TEST(ImageBlendAnimationFilter, ClearWithOver) TEST(ImageBlendAnimationFilter, ClearWithOver)
{ TestWithBlendAnimationFilterClear(BlendMethod::OVER); } {
TestWithBlendAnimationFilterClear(BlendMethod::OVER);
}
TEST(ImageBlendAnimationFilter, ClearWithSource) TEST(ImageBlendAnimationFilter, ClearWithSource)
{ TestWithBlendAnimationFilterClear(BlendMethod::SOURCE); } {
TestWithBlendAnimationFilterClear(BlendMethod::SOURCE);
}
TEST(ImageBlendAnimationFilter, KeepWithSource) TEST(ImageBlendAnimationFilter, KeepWithSource)
{ {

View File

@@ -187,8 +187,7 @@ Result<Ok, ICUError> ApplyCalendarOverride(UDateFormat* aDateFormat) {
auto* gregorian = static_cast<const icu::GregorianCalendar*>(calendar); auto* gregorian = static_cast<const icu::GregorianCalendar*>(calendar);
MOZ_TRY( MOZ_TRY(
SetGregorianChangeDate(const_cast<icu::GregorianCalendar*>(gregorian))); SetGregorianChangeDate(const_cast<icu::GregorianCalendar*>(gregorian)));
} } else if (IsCalendarReplacementSupported(type)) {
else if (IsCalendarReplacementSupported(type)) {
auto replacement = CreateCalendarReplacement(calendar); auto replacement = CreateCalendarReplacement(calendar);
if (replacement.isErr()) { if (replacement.isErr()) {
return replacement.propagateErr(); return replacement.propagateErr();

Some files were not shown because too many files have changed in this diff Show More