Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-02-20 12:02:40 +08:00
commit 16926c542d
10 changed files with 107 additions and 17 deletions

View file

@ -148,6 +148,11 @@ ModuleLoadRequest::LoadFailed()
// We failed to load the source text or an error occurred unrelated to the
// content of the module (e.g. OOM).
if (IsCanceled()) {
return;
}
MOZ_ASSERT(!IsReadyToRun());
MOZ_ASSERT(!mModuleScript);
Cancel();

View file

@ -238,6 +238,8 @@ EditorEventListener::Disconnect()
void
EditorEventListener::UninstallFromEditor()
{
CleanupDragDropCaret();
nsCOMPtr<EventTarget> piTarget = mEditorBase->GetDOMEventTarget();
if (!piTarget) {
return;

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
input, input:active { border: none; }
</style>
</head>
<body>
<input id="input1">
<div id=div1 style="height: 100px;">
<textarea id="textarea1" style="display: none;"></textarea>
</div>
<script>
SimpleTest.waitForFocus(() => {
let input1 = document.getElementById('input1');
input1.focus();
synthesizeKey("A");
document.documentElement.removeAttribute("class");
});
</script>
</body>
</html>

View file

@ -0,0 +1,37 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
input, input:active { border: none; }
</style>
</head>
<body>
<input id="input1" value="aaaaaaaaaaaaaaaaaaaa">
<div id=div1 style="height: 100px;">
<textarea id="textarea1"></textarea>
</div>
<script>
SimpleTest.waitForFocus(() => {
let div1 = document.getElementById('div1');
let textarea1 = document.getElementById('textarea1');
div1.addEventListener("drop", e => {
e.preventDefault();
textarea1.style = "display: none;";
SimpleTest.executeSoon(() => {
synthesizeKey("A");
document.documentElement.removeAttribute("class");
});
});
let input1 = document.getElementById('input1');
input1.focus();
input1.setSelectionRange(0, input1.value.length);
synthesizeDrop(input1, textarea1, [[{type: "text/plain", data: "foo"}]]);
});
</script>
</body>
</html>

View file

@ -179,6 +179,8 @@ support-files =
bug1263357-4-ref.html
bug1263357-5.html
bug1263357-5-ref.html
bug1496118.html
bug1496118-ref.html
input-maxlength-valid-before-change.html
input-maxlength-valid-change.html
input-maxlength-invalid-change.html

View file

@ -186,6 +186,7 @@ var tests = [
[ 'bug1263357-3.html' , 'bug1263357-3-ref.html'] ,
[ 'bug1263357-4.html' , 'bug1263357-4-ref.html'] ,
[ 'bug1263357-5.html' , 'bug1263357-5-ref.html'] ,
[ 'bug1496118.html' , 'bug1496118-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled']]}, nextTest);} ,
];

View file

@ -341,27 +341,38 @@ sec_pkcs12_decoder_safe_bag_update(void *arg, const char *data,
* and that there are no errors. If so, just return rather
* than continuing to process.
*/
if (!safeContentsCtx || !safeContentsCtx->p12dcx ||
safeContentsCtx->p12dcx->error || safeContentsCtx->skipCurrentSafeBag) {
if (!safeContentsCtx || !safeContentsCtx->p12dcx || safeContentsCtx->skipCurrentSafeBag) {
return;
}
p12dcx = safeContentsCtx->p12dcx;
/* make sure that there are no errors and we are not skipping the current safeBag */
if (p12dcx->error || safeContentsCtx->skipCurrentSafeBag) {
goto loser;
}
rv = SEC_ASN1DecoderUpdate(safeContentsCtx->currentSafeBagA1Dcx, data, len);
if (rv != SECSuccess) {
p12dcx->errorValue = PORT_GetError();
p12dcx->error = PR_TRUE;
goto loser;
}
/* The update may have set safeContentsCtx->skipCurrentSafeBag, and we
* may not get another opportunity to clean up the decoder context.
*/
if (safeContentsCtx->skipCurrentSafeBag) {
goto loser;
}
return;
loser:
/* set the error, and finish the decoder context. because there
/* Finish the decoder context. Because there
* is not a way of returning an error message, it may be worth
* while to do a check higher up and finish any decoding contexts
* that are still open.
*/
p12dcx->error = PR_TRUE;
SEC_ASN1DecoderFinish(safeContentsCtx->currentSafeBagA1Dcx);
safeContentsCtx->currentSafeBagA1Dcx = NULL;
return;

View file

@ -73,6 +73,7 @@ struct sec_PKCS12SafeBagStr {
sec_PKCS12CRLBag *crlBag;
sec_PKCS12SecretBag *secretBag;
sec_PKCS12SafeContents *safeContents;
SECItem *unknownBag;
} safeBagContent;
sec_PKCS12Attribute **attribs;

View file

@ -30,12 +30,12 @@ sec_pkcs12_choose_safe_bag_type(void *src_or_dest, PRBool encoding)
oiddata = SECOID_FindOID(&safeBag->safeBagType);
if (oiddata == NULL) {
return SEC_ASN1_GET(SEC_AnyTemplate);
return SEC_ASN1_GET(SEC_PointerToAnyTemplate);
}
switch (oiddata->offset) {
default:
theTemplate = SEC_ASN1_GET(SEC_AnyTemplate);
theTemplate = SEC_ASN1_GET(SEC_PointerToAnyTemplate);
break;
case SEC_OID_PKCS12_V1_KEY_BAG_ID:
theTemplate = SEC_ASN1_GET(SECKEY_PointerToPrivateKeyInfoTemplate);

View file

@ -355,32 +355,38 @@ TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) {
}
RefPtr<gfxWindowsSurface> target = new gfxWindowsSurface(source->GetSize(),
gfx::SurfaceFormat::A8R8G8B8_UINT32);
if (!target) {
if (target->CairoStatus() != CAIRO_STATUS_SUCCESS) {
return NS_ERROR_FAILURE;
}
RefPtr<gfx::DataSourceSurface> srcSurface = source->GetDataSurface();
using DataSrcSurf = gfx::DataSourceSurface;
RefPtr<DataSrcSurf> srcSurface = source->GetDataSurface();
RefPtr<gfxImageSurface> imageSurface = target->GetAsImageSurface();
if (!srcSurface || !imageSurface) {
return NS_ERROR_FAILURE;
}
gfx::DataSourceSurface::MappedSurface sourceMap;
srcSurface->Map(gfx::DataSourceSurface::READ, &sourceMap);
mozilla::gfx::CopySurfaceDataToPackedArray(sourceMap.mData,
imageSurface->Data(),
srcSurface->GetSize(),
sourceMap.mStride,
BytesPerPixel(srcSurface->GetFormat()));
srcSurface->Unmap();
DataSrcSurf::ScopedMap const sourceMap(srcSurface, DataSrcSurf::READ);
if (sourceMap.IsMapped()) {
mozilla::gfx::CopySurfaceDataToPackedArray(sourceMap.GetData(),
imageSurface->Data(),
srcSurface->GetSize(),
sourceMap.GetStride(),
BytesPerPixel(srcSurface->GetFormat()));
} else if (source->GetSize().IsEmpty()) {
// A zero-size source-surface probably shouldn't happen, but is harmless
// here. Fall through.
} else {
return NS_ERROR_FAILURE;
}
HDC hDC = target->GetDC();
HBITMAP hBitmap = (HBITMAP)GetCurrentObject(hDC, OBJ_BITMAP);
DWORD flags = aDrawBorder ? DWM_SIT_DISPLAYFRAME : 0;
POINT pptClient = { 0, 0 };
HRESULT hr;
if (!mIsThumbnail) {
POINT pptClient = { 0, 0 };
hr = WinUtils::dwmSetIconicLivePreviewBitmapPtr(mPreview->PreviewWindow(),
hBitmap, &pptClient, flags);
} else {
@ -388,6 +394,7 @@ TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) {
hBitmap, flags);
}
MOZ_ASSERT(SUCCEEDED(hr));
mozilla::Unused << hr;
return NS_OK;
}