import changes from tenfourfox:

- #578: M1322864 M1585106 M1597043 (7758ebb12)
- #578: M1579060 M1586176 (f3f295615)
This commit is contained in:
2019-12-06 07:36:57 +08:00
parent a1b817dabc
commit 5a4e033f1e
5 changed files with 47 additions and 18 deletions
+9
View File
@@ -366,6 +366,15 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
if (FocusMgr()->HasDOMFocus(targetNode)) {
nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSel =
do_QueryInterface(targetNode);
if (!multiSel) {
// This shouldn't be possible. All XUL trees should have
// nsIDOMXULMultiSelectControlElement, and the tree is focused, so it
// shouldn't be dying. Nevertheless, this sometimes happens in the wild
// (bug 1597043).
MOZ_ASSERT_UNREACHABLE(
"XUL tree doesn't have nsIDOMXULMultiSelectControlElement");
return;
}
nsAutoString selType;
multiSel->GetSelType(selType);
if (selType.IsEmpty() || !selType.EqualsLiteral("single")) {
+8 -1
View File
@@ -3184,7 +3184,14 @@ nsContentUtils::GetImageFromContent(nsIImageLoadingContent* aContent,
}
if (aRequest) {
imgRequest.swap(*aRequest);
// If the consumer wants the request, verify it has actually loaded
// successfully.
uint32_t imgStatus;
imgRequest->GetImageStatus(&imgStatus);
if (imgStatus & imgIRequest::STATUS_FRAME_COMPLETE &&
!(imgStatus & imgIRequest::STATUS_ERROR)) {
imgRequest.swap(*aRequest);
}
}
return imgContainer.forget();
+12 -5
View File
@@ -265,7 +265,8 @@ public:
NS_DECL_THREADSAFE_ISUPPORTS
PACResolver()
: mStatus(NS_ERROR_FAILURE)
: mStatus(NS_ERROR_FAILURE),
mMutex("PACResolver::Mutex")
{
}
@@ -274,12 +275,17 @@ public:
nsIDNSRecord *record,
nsresult status) override
{
if (mTimer) {
mTimer->Cancel();
mTimer = nullptr;
nsCOMPtr<nsITimer> timer;
{
MutexAutoLock lock(mMutex);
timer.swap(mTimer);
mRequest = nullptr;
}
if (timer) {
timer->Cancel();
}
mRequest = nullptr;
mStatus = status;
mResponse = record;
return NS_OK;
@@ -298,6 +304,7 @@ public:
nsCOMPtr<nsICancelable> mRequest;
nsCOMPtr<nsIDNSRecord> mResponse;
nsCOMPtr<nsITimer> mTimer;
Mutex mMutex;
private:
~PACResolver() {}
+7 -12
View File
@@ -105,29 +105,24 @@ BackCert::Init()
return rv;
}
static const uint8_t CSC = der::CONTEXT_SPECIFIC | der::CONSTRUCTED;
// According to RFC 5280, all fields below this line are forbidden for
// certificate versions less than v3. However, for compatibility reasons,
// we parse v1/v2 certificates in the same way as v3 certificates. So if
// these fields appear in a v1 certificate, they will be used.
// Ignore issuerUniqueID if present.
if (tbsCertificate.Peek(CSC | 1)) {
rv = der::ExpectTagAndSkipValue(tbsCertificate, CSC | 1);
if (rv != Success) {
return rv;
}
rv = der::SkipOptionalImplicitPrimitiveTag(tbsCertificate, 1);
if (rv != Success) {
return rv;
}
// Ignore subjectUniqueID if present.
if (tbsCertificate.Peek(CSC | 2)) {
rv = der::ExpectTagAndSkipValue(tbsCertificate, CSC | 2);
if (rv != Success) {
return rv;
}
rv = der::SkipOptionalImplicitPrimitiveTag(tbsCertificate, 2);
if (rv != Success) {
return rv;
}
static const uint8_t CSC = der::CONTEXT_SPECIFIC | der::CONSTRUCTED;
rv = der::OptionalExtensions(
tbsCertificate, CSC | 3,
[this](Reader& extnID, const Input& extnValue, bool critical,
+11
View File
@@ -123,6 +123,17 @@ ExpectTagAndSkipValue(Reader& input, uint8_t tag)
return ExpectTagAndGetValue(input, tag, ignoredValue);
}
// This skips IMPLICIT OPTIONAL tags that are "primitive" (not constructed),
// given the number in the class of the tag (i.e. the number in the brackets in
// `issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL`).
inline Result SkipOptionalImplicitPrimitiveTag(Reader& input,
uint8_t numberInClass) {
if (input.Peek(CONTEXT_SPECIFIC | numberInClass)) {
return ExpectTagAndSkipValue(input, CONTEXT_SPECIFIC | numberInClass);
}
return Success;
}
// Like ExpectTagAndGetValue, except the output Input will contain the
// encoded tag and length along with the value.
inline Result