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

This commit is contained in:
roytam1 2024-06-13 11:32:08 +08:00
commit d835b252d7
5 changed files with 33 additions and 9 deletions

View file

@ -210,13 +210,25 @@ public:
, mDisplay(aOther.mDisplay) , mDisplay(aOther.mDisplay)
, mStereoMode(aOther.mStereoMode) , mStereoMode(aOther.mStereoMode)
, mImage(aOther.mImage) , mImage(aOther.mImage)
, mCodecSpecificConfig(aOther.mCodecSpecificConfig) , mCodecSpecificConfig(nullptr)
, mExtraData(aOther.mExtraData) , mExtraData(nullptr)
, mRotation(aOther.mRotation) , mRotation(aOther.mRotation)
, mBitDepth(aOther.mBitDepth) , mBitDepth(aOther.mBitDepth)
, mImageRect(aOther.mImageRect) , mImageRect(aOther.mImageRect)
, mAlphaPresent(aOther.mAlphaPresent) , mAlphaPresent(aOther.mAlphaPresent)
{ {
if (aOther.mCodecSpecificConfig) {
mCodecSpecificConfig = new MediaByteBuffer();
mCodecSpecificConfig->AppendElements(
reinterpret_cast<uint8_t*>(aOther.mCodecSpecificConfig->Elements()),
aOther.mCodecSpecificConfig->Length());
}
if (aOther.mExtraData) {
mExtraData = new MediaByteBuffer();
mExtraData->AppendElements(
reinterpret_cast<uint8_t*>(aOther.mExtraData->Elements()),
aOther.mExtraData->Length());
}
} }
bool IsValid() const override bool IsValid() const override

View file

@ -1505,6 +1505,10 @@ JSObject::swap(JSContext* cx, HandleObject a, HandleObject b)
if (!JSObject::getGroup(cx, b)) if (!JSObject::getGroup(cx, b))
oomUnsafe.crash("JSObject::swap"); oomUnsafe.crash("JSObject::swap");
// Don't allow a GC which may observe intermediate states or run before we
// execute all necessary barriers.
AutoSuppressGC suppress(cx);
/* /*
* Neither object may be in the nursery, but ensure we update any embedded * Neither object may be in the nursery, but ensure we update any embedded
* nursery pointers in either object. * nursery pointers in either object.
@ -1545,10 +1549,6 @@ JSObject::swap(JSContext* cx, HandleObject a, HandleObject b)
a->fixDictionaryShapeAfterSwap(); a->fixDictionaryShapeAfterSwap();
b->fixDictionaryShapeAfterSwap(); b->fixDictionaryShapeAfterSwap();
} else { } else {
// Avoid GC in here to avoid confusing the tracing code with our
// intermediate state.
AutoSuppressGC suppress(cx);
// When the objects have different sizes, they will have different // When the objects have different sizes, they will have different
// numbers of fixed slots before and after the swap, so the slots for // numbers of fixed slots before and after the swap, so the slots for
// native objects will need to be rearranged. // native objects will need to be rearranged.

View file

@ -401,8 +401,10 @@ nsLineLayout::NewPerSpanData()
psd->mFrame = nullptr; psd->mFrame = nullptr;
psd->mFirstFrame = nullptr; psd->mFirstFrame = nullptr;
psd->mLastFrame = nullptr; psd->mLastFrame = nullptr;
psd->mReflowInput = nullptr;
psd->mContainsFloat = false; psd->mContainsFloat = false;
psd->mHasNonemptyContent = false; psd->mHasNonemptyContent = false;
psd->mBaseline = nullptr;
#ifdef DEBUG #ifdef DEBUG
outerLineLayout->mSpansAllocated++; outerLineLayout->mSpansAllocated++;

View file

@ -919,6 +919,11 @@ nsFormFillController::HandleEvent(nsIDOMEvent* aEvent)
mFocusedPopup->ClosePopup(); mFocusedPopup->ClosePopup();
return NS_OK; return NS_OK;
} }
if (type.EqualsLiteral("resize")) {
if (mFocusedPopup)
mFocusedPopup->ClosePopup();
return NS_OK;
}
if (type.EqualsLiteral("pagehide")) { if (type.EqualsLiteral("pagehide")) {
nsCOMPtr<nsIDocument> doc = do_QueryInterface( nsCOMPtr<nsIDocument> doc = do_QueryInterface(
@ -1213,6 +1218,8 @@ nsFormFillController::AddWindowListeners(nsPIDOMWindowOuter* aWindow)
TrustedEventsAtCapture()); TrustedEventsAtCapture());
elm->AddEventListenerByType(this, NS_LITERAL_STRING("contextmenu"), elm->AddEventListenerByType(this, NS_LITERAL_STRING("contextmenu"),
TrustedEventsAtCapture()); TrustedEventsAtCapture());
elm->AddEventListenerByType(this, NS_LITERAL_STRING("resize"),
TrustedEventsAtCapture());
// Note that any additional listeners added should ensure that they ignore // Note that any additional listeners added should ensure that they ignore
// untrusted events, which might be sent by content that's up to no good. // untrusted events, which might be sent by content that's up to no good.
@ -1257,6 +1264,8 @@ nsFormFillController::RemoveWindowListeners(nsPIDOMWindowOuter* aWindow)
TrustedEventsAtCapture()); TrustedEventsAtCapture());
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("contextmenu"), elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("contextmenu"),
TrustedEventsAtCapture()); TrustedEventsAtCapture());
elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("resize"),
TrustedEventsAtCapture());
} }
void void

View file

@ -1202,10 +1202,11 @@ nsExternalAppHandler::nsExternalAppHandler(nsIMIMEInfo * aMIMEInfo,
// Replace platform specific path separator and illegal characters to avoid any confusion // Replace platform specific path separator and illegal characters to avoid any confusion
mSuggestedFileName.ReplaceChar(KNOWN_PATH_SEPARATORS, '_'); mSuggestedFileName.ReplaceChar(KNOWN_PATH_SEPARATORS, '_');
mSuggestedFileName.ReplaceChar(FILE_ILLEGAL_CHARACTERS, ' '); mSuggestedFileName.ReplaceChar(FILE_ILLEGAL_CHARACTERS, '_');
mSuggestedFileName.ReplaceChar(char16_t(0), '_'); mSuggestedFileName.ReplaceChar("%", '_');
mSuggestedFileName.StripChar(char16_t(0));
mTempFileExtension.ReplaceChar(KNOWN_PATH_SEPARATORS, '_'); mTempFileExtension.ReplaceChar(KNOWN_PATH_SEPARATORS, '_');
mTempFileExtension.ReplaceChar(FILE_ILLEGAL_CHARACTERS, ' '); mTempFileExtension.ReplaceChar(FILE_ILLEGAL_CHARACTERS, '_');
// Remove unsafe bidi characters which might have spoofing implications (bug 511521). // Remove unsafe bidi characters which might have spoofing implications (bug 511521).
const char16_t unsafeBidiCharacters[] = { const char16_t unsafeBidiCharacters[] = {