mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-06-10 18:29:43 +00:00
commit
305fea1eb1
|
@ -1275,6 +1275,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
|||
nsCOMPtr<nsIURI> referrer;
|
||||
nsCOMPtr<nsIURI> originalURI;
|
||||
bool loadReplace = false;
|
||||
bool isFromProcessingFrameAttributes = false;
|
||||
nsCOMPtr<nsIInputStream> postStream;
|
||||
nsCOMPtr<nsIInputStream> headersStream;
|
||||
nsCOMPtr<nsISupports> owner;
|
||||
|
@ -1303,6 +1304,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
|||
aLoadInfo->GetReferrer(getter_AddRefs(referrer));
|
||||
aLoadInfo->GetOriginalURI(getter_AddRefs(originalURI));
|
||||
aLoadInfo->GetLoadReplace(&loadReplace);
|
||||
aLoadInfo->GetIsFromProcessingFrameAttributes(&isFromProcessingFrameAttributes);
|
||||
nsDocShellInfoLoadType lt = nsIDocShellLoadInfo::loadNormal;
|
||||
aLoadInfo->GetLoadType(<);
|
||||
// Get the appropriate loadType from nsIDocShellLoadInfo type
|
||||
|
@ -1558,6 +1560,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
|||
return InternalLoad(aURI,
|
||||
originalURI,
|
||||
loadReplace,
|
||||
isFromProcessingFrameAttributes,
|
||||
referrer,
|
||||
referrerPolicy,
|
||||
owner,
|
||||
|
@ -5252,7 +5255,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
|
|||
rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return InternalLoad(errorPageURI, nullptr, false, nullptr,
|
||||
return InternalLoad(errorPageURI, nullptr, false, false, nullptr,
|
||||
mozilla::net::RP_Default,
|
||||
nullptr, INTERNAL_LOAD_FLAGS_INHERIT_OWNER, nullptr,
|
||||
nullptr, NullString(), nullptr, nullptr, LOAD_ERROR_PAGE,
|
||||
|
@ -5334,6 +5337,7 @@ nsDocShell::Reload(uint32_t aReloadFlags)
|
|||
rv = InternalLoad(currentURI,
|
||||
originalURI,
|
||||
loadReplace,
|
||||
false, // IsFromProcessingFrameAttributes
|
||||
referrerURI,
|
||||
referrerPolicy,
|
||||
principal,
|
||||
|
@ -9412,6 +9416,7 @@ class InternalLoadEvent : public nsRunnable
|
|||
public:
|
||||
InternalLoadEvent(nsDocShell* aDocShell, nsIURI* aURI,
|
||||
nsIURI* aOriginalURI, bool aLoadReplace,
|
||||
bool aIsFromProcessingFrameAttributes,
|
||||
nsIURI* aReferrer, uint32_t aReferrerPolicy,
|
||||
nsISupports* aOwner, uint32_t aFlags,
|
||||
const char* aTypeHint, nsIInputStream* aPostData,
|
||||
|
@ -9424,6 +9429,7 @@ public:
|
|||
, mURI(aURI)
|
||||
, mOriginalURI(aOriginalURI)
|
||||
, mLoadReplace(aLoadReplace)
|
||||
, mIsFromProcessingFrameAttributes(aIsFromProcessingFrameAttributes)
|
||||
, mReferrer(aReferrer)
|
||||
, mReferrerPolicy(aReferrerPolicy)
|
||||
, mOwner(aOwner)
|
||||
|
@ -9447,6 +9453,7 @@ public:
|
|||
{
|
||||
return mDocShell->InternalLoad(mURI, mOriginalURI,
|
||||
mLoadReplace,
|
||||
mIsFromProcessingFrameAttributes,
|
||||
mReferrer,
|
||||
mReferrerPolicy,
|
||||
mOwner, mFlags,
|
||||
|
@ -9467,6 +9474,7 @@ private:
|
|||
nsCOMPtr<nsIURI> mURI;
|
||||
nsCOMPtr<nsIURI> mOriginalURI;
|
||||
bool mLoadReplace;
|
||||
bool mIsFromProcessingFrameAttributes;
|
||||
nsCOMPtr<nsIURI> mReferrer;
|
||||
uint32_t mReferrerPolicy;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
|
@ -9513,6 +9521,7 @@ NS_IMETHODIMP
|
|||
nsDocShell::InternalLoad(nsIURI* aURI,
|
||||
nsIURI* aOriginalURI,
|
||||
bool aLoadReplace,
|
||||
bool aIsFromProcessingFrameAttributes,
|
||||
nsIURI* aReferrer,
|
||||
uint32_t aReferrerPolicy,
|
||||
nsISupports* aOwner,
|
||||
|
@ -9782,6 +9791,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
|||
INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER));
|
||||
loadInfo->SetOriginalURI(aOriginalURI);
|
||||
loadInfo->SetLoadReplace(aLoadReplace);
|
||||
loadInfo->SetIsFromProcessingFrameAttributes(aIsFromProcessingFrameAttributes);
|
||||
loadInfo->SetOwner(loadingPrincipal); // SetTriggeringPrincipal
|
||||
loadInfo->SetInheritOwner( /* SetInheritPrincipal _INHERIT_PRINCIPAL */
|
||||
!!(aFlags & INTERNAL_LOAD_FLAGS_INHERIT_OWNER));
|
||||
|
@ -9831,6 +9841,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
|||
rv = targetDocShell->InternalLoad(aURI,
|
||||
aOriginalURI,
|
||||
aLoadReplace,
|
||||
aIsFromProcessingFrameAttributes,
|
||||
aReferrer,
|
||||
aReferrerPolicy,
|
||||
owner,
|
||||
|
@ -9912,6 +9923,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
|||
// Do this asynchronously
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new InternalLoadEvent(this, aURI, aOriginalURI, aLoadReplace,
|
||||
aIsFromProcessingFrameAttributes,
|
||||
aReferrer, aReferrerPolicy, aOwner, aFlags,
|
||||
aTypeHint, aPostData, aHeadersData,
|
||||
aLoadType, aSHEntry, aFirstParty, aSrcdoc,
|
||||
|
@ -10392,7 +10404,9 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
|||
nsINetworkPredictor::PREDICT_LOAD, this, nullptr);
|
||||
|
||||
nsCOMPtr<nsIRequest> req;
|
||||
rv = DoURILoad(aURI, aOriginalURI, aLoadReplace, aReferrer,
|
||||
rv = DoURILoad(aURI, aOriginalURI, aLoadReplace,
|
||||
aIsFromProcessingFrameAttributes,
|
||||
aReferrer,
|
||||
!(aFlags & INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER),
|
||||
aReferrerPolicy,
|
||||
owner, aTypeHint, aFileName, aPostData, aHeadersData,
|
||||
|
@ -10471,6 +10485,7 @@ nsresult
|
|||
nsDocShell::DoURILoad(nsIURI* aURI,
|
||||
nsIURI* aOriginalURI,
|
||||
bool aLoadReplace,
|
||||
bool aIsFromProcessingFrameAttributes,
|
||||
nsIURI* aReferrerURI,
|
||||
bool aSendReferrer,
|
||||
uint32_t aReferrerPolicy,
|
||||
|
@ -10620,6 +10635,14 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
|||
securityFlags |= nsILoadInfo::SEC_SANDBOXED;
|
||||
}
|
||||
|
||||
#if(0)
|
||||
// XXX: bug 1487964 has this code, but we have no nsILoadInfo set up yet.
|
||||
// Do we need it?
|
||||
if (aIsFromProcessingFrameAttributes) {
|
||||
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!isSrcdoc) {
|
||||
rv = NS_NewChannelInternal(getter_AddRefs(channel),
|
||||
aURI,
|
||||
|
@ -12184,6 +12207,7 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
|
|||
rv = InternalLoad(uri,
|
||||
originalURI,
|
||||
loadReplace,
|
||||
false, // IsFromProcessingFrameAttributes
|
||||
referrerURI,
|
||||
referrerPolicy,
|
||||
owner,
|
||||
|
@ -13646,6 +13670,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
|||
nsresult rv = InternalLoad(clonedURI, // New URI
|
||||
nullptr, // Original URI
|
||||
false, // LoadReplace
|
||||
false, // IsFromProcessingFrameAttributes
|
||||
referer, // Referer URI
|
||||
refererPolicy, // Referer policy
|
||||
aContent->NodePrincipal(), // Owner is our node's
|
||||
|
|
|
@ -353,6 +353,7 @@ protected:
|
|||
nsresult DoURILoad(nsIURI* aURI,
|
||||
nsIURI* aOriginalURI,
|
||||
bool aLoadReplace,
|
||||
bool aIsFromProcessingFrameAttributes,
|
||||
nsIURI* aReferrer,
|
||||
bool aSendReferrer,
|
||||
uint32_t aReferrerPolicy,
|
||||
|
|
|
@ -19,6 +19,7 @@ nsDocShellLoadInfo::nsDocShellLoadInfo()
|
|||
, mReferrerPolicy(mozilla::net::RP_Default)
|
||||
, mLoadType(nsIDocShellLoadInfo::loadNormal)
|
||||
, mIsSrcdocLoad(false)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -298,3 +299,19 @@ nsDocShellLoadInfo::SetBaseURI(nsIURI* aBaseURI)
|
|||
mBaseURI = aBaseURI;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShellLoadInfo::GetIsFromProcessingFrameAttributes(bool* aIsFromProcessingFrameAttributes)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsFromProcessingFrameAttributes);
|
||||
|
||||
*aIsFromProcessingFrameAttributes = mIsFromProcessingFrameAttributes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShellLoadInfo::SetIsFromProcessingFrameAttributes(bool aIsFromProcessingFrameAttributes)
|
||||
{
|
||||
mIsFromProcessingFrameAttributes = aIsFromProcessingFrameAttributes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,10 @@ protected:
|
|||
nsString mSrcdocData;
|
||||
nsCOMPtr<nsIDocShell> mSourceDocShell;
|
||||
nsCOMPtr<nsIURI> mBaseURI;
|
||||
|
||||
// This will be true if this load is triggered by attribute changes.
|
||||
// See nsILoadInfo.isFromProcessingFrameAttributes
|
||||
bool mIsFromProcessingFrameAttributes;
|
||||
};
|
||||
|
||||
#endif /* nsDocShellLoadInfo_h__ */
|
||||
|
|
|
@ -126,6 +126,9 @@ interface nsIDocShell : nsIDocShellTreeItem
|
|||
* @param aLoadReplace - If set LOAD_REPLACE flag will be set on the
|
||||
* channel. aOriginalURI is null, this argument is
|
||||
* ignored.
|
||||
* @param aIsFromProcessingFrameAttributes
|
||||
* - If this is a load triggered by changing frame attributes.
|
||||
* See nsILoadInfo.isFromProcessingFrameAttributes
|
||||
* @param aReferrer - Referring URI
|
||||
* @param aReferrerPolicy - Referrer policy
|
||||
* @param aOwner - Owner (security principal)
|
||||
|
@ -154,6 +157,7 @@ interface nsIDocShell : nsIDocShellTreeItem
|
|||
[noscript]void internalLoad(in nsIURI aURI,
|
||||
in nsIURI aOriginalURI,
|
||||
in boolean aLoadReplace,
|
||||
in boolean aIsFromProcessingFrameAttributes,
|
||||
in nsIURI aReferrer,
|
||||
in unsigned long aReferrerPolicy,
|
||||
in nsISupports aOwner,
|
||||
|
|
|
@ -120,4 +120,10 @@ interface nsIDocShellLoadInfo : nsISupports
|
|||
* URI as this information isn't embedded in the load's URI.
|
||||
*/
|
||||
attribute nsIURI baseURI;
|
||||
|
||||
/**
|
||||
* This will be true if this load is triggered by attribute changes.
|
||||
* See nsILoadInfo.isFromProcessingFrameAttributes
|
||||
*/
|
||||
attribute boolean isFromProcessingFrameAttributes;
|
||||
};
|
||||
|
|
|
@ -427,6 +427,8 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
|||
nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
|
||||
}
|
||||
|
||||
loadInfo->SetIsFromProcessingFrameAttributes(true);
|
||||
|
||||
// Kick off the load...
|
||||
bool tmpState = mNeedsAsyncDestroy;
|
||||
mNeedsAsyncDestroy = true;
|
||||
|
|
|
@ -487,7 +487,7 @@ public:
|
|||
|
||||
mMechanism = CKM_AES_CBC_PAD;
|
||||
telemetryAlg = TA_AES_CBC;
|
||||
AesCbcParams params;
|
||||
RootedDictionary<AesCbcParams> params(aCx);
|
||||
nsresult rv = Coerce(aCx, params, aAlgorithm);
|
||||
if (NS_FAILED(rv)) {
|
||||
mEarlyRv = NS_ERROR_DOM_INVALID_ACCESS_ERR;
|
||||
|
@ -504,7 +504,7 @@ public:
|
|||
|
||||
mMechanism = CKM_AES_CTR;
|
||||
telemetryAlg = TA_AES_CTR;
|
||||
AesCtrParams params;
|
||||
RootedDictionary<AesCtrParams> params(aCx);
|
||||
nsresult rv = Coerce(aCx, params, aAlgorithm);
|
||||
if (NS_FAILED(rv)) {
|
||||
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
|
||||
|
@ -523,7 +523,7 @@ public:
|
|||
|
||||
mMechanism = CKM_AES_GCM;
|
||||
telemetryAlg = TA_AES_GCM;
|
||||
AesGcmParams params;
|
||||
RootedDictionary<AesGcmParams> params(aCx);
|
||||
nsresult rv = Coerce(aCx, params, aAlgorithm);
|
||||
if (NS_FAILED(rv)) {
|
||||
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
|
||||
|
|
|
@ -35,23 +35,8 @@ namespace mozilla {
|
|||
namespace dom {
|
||||
|
||||
HTMLOptionsCollection::HTMLOptionsCollection(HTMLSelectElement* aSelect)
|
||||
{
|
||||
// Do not maintain a reference counted reference. When
|
||||
// the select goes away, it will let us know.
|
||||
mSelect = aSelect;
|
||||
}
|
||||
|
||||
HTMLOptionsCollection::~HTMLOptionsCollection()
|
||||
{
|
||||
DropReference();
|
||||
}
|
||||
|
||||
void
|
||||
HTMLOptionsCollection::DropReference()
|
||||
{
|
||||
// Drop our (non ref-counted) reference
|
||||
mSelect = nullptr;
|
||||
}
|
||||
: mSelect(aSelect)
|
||||
{}
|
||||
|
||||
nsresult
|
||||
HTMLOptionsCollection::GetOptionIndex(Element* aOption,
|
||||
|
@ -88,7 +73,9 @@ HTMLOptionsCollection::GetOptionIndex(Element* aOption,
|
|||
}
|
||||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(HTMLOptionsCollection, mElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(HTMLOptionsCollection,
|
||||
mElements,
|
||||
mSelect)
|
||||
|
||||
// nsISupports
|
||||
|
||||
|
@ -124,10 +111,6 @@ HTMLOptionsCollection::GetLength(uint32_t* aLength)
|
|||
NS_IMETHODIMP
|
||||
HTMLOptionsCollection::SetLength(uint32_t aLength)
|
||||
{
|
||||
if (!mSelect) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return mSelect->SetLength(aLength);
|
||||
}
|
||||
|
||||
|
@ -135,10 +118,6 @@ NS_IMETHODIMP
|
|||
HTMLOptionsCollection::SetOption(uint32_t aIndex,
|
||||
nsIDOMHTMLOptionElement* aOption)
|
||||
{
|
||||
if (!mSelect) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// if the new option is null, just remove this option. Note that it's safe
|
||||
// to pass a too-large aIndex in here.
|
||||
if (!aOption) {
|
||||
|
@ -187,11 +166,6 @@ HTMLOptionsCollection::SetOption(uint32_t aIndex,
|
|||
int32_t
|
||||
HTMLOptionsCollection::GetSelectedIndex(ErrorResult& aError)
|
||||
{
|
||||
if (!mSelect) {
|
||||
aError.Throw(NS_ERROR_UNEXPECTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t selectedIndex;
|
||||
aError = mSelect->GetSelectedIndex(&selectedIndex);
|
||||
return selectedIndex;
|
||||
|
@ -209,11 +183,6 @@ void
|
|||
HTMLOptionsCollection::SetSelectedIndex(int32_t aSelectedIndex,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
if (!mSelect) {
|
||||
aError.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
aError = mSelect->SetSelectedIndex(aSelectedIndex);
|
||||
}
|
||||
|
||||
|
@ -331,10 +300,6 @@ HTMLOptionsCollection::Add(nsIDOMHTMLOptionElement* aOption,
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (!mSelect) {
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLElement> elem = do_QueryInterface(aOption);
|
||||
return mSelect->Add(elem, aBefore);
|
||||
}
|
||||
|
@ -344,22 +309,12 @@ HTMLOptionsCollection::Add(const HTMLOptionOrOptGroupElement& aElement,
|
|||
const Nullable<HTMLElementOrLong>& aBefore,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
if (!mSelect) {
|
||||
aError.Throw(NS_ERROR_NOT_INITIALIZED);
|
||||
return;
|
||||
}
|
||||
|
||||
mSelect->Add(aElement, aBefore, aError);
|
||||
}
|
||||
|
||||
void
|
||||
HTMLOptionsCollection::Remove(int32_t aIndex, ErrorResult& aError)
|
||||
{
|
||||
if (!mSelect) {
|
||||
aError.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t len = 0;
|
||||
mSelect->GetLength(&len);
|
||||
if (aIndex < 0 || (uint32_t)aIndex >= len)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
using nsWrapperCache::GetWrapper;
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
protected:
|
||||
virtual ~HTMLOptionsCollection();
|
||||
virtual ~HTMLOptionsCollection() = default;
|
||||
|
||||
virtual JSObject* GetWrapperPreserveColorInternal() override
|
||||
{
|
||||
|
@ -112,11 +112,6 @@ public:
|
|||
mElements.AppendElement(aOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop the reference to the select. Called during select destruction.
|
||||
*/
|
||||
void DropReference();
|
||||
|
||||
/**
|
||||
* Finds the index of a given option element.
|
||||
* If the option isn't part of the collection, return NS_ERROR_FAILURE
|
||||
|
@ -162,7 +157,7 @@ private:
|
|||
* various members such as InsertOptionAt are also infallible. */
|
||||
nsTArray<RefPtr<mozilla::dom::HTMLOptionElement> > mElements;
|
||||
/** The select element that contains this array */
|
||||
HTMLSelectElement* mSelect;
|
||||
RefPtr<HTMLSelectElement> mSelect;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -130,11 +130,6 @@ HTMLSelectElement::HTMLSelectElement(already_AddRefed<mozilla::dom::NodeInfo>& a
|
|||
NS_EVENT_STATE_VALID);
|
||||
}
|
||||
|
||||
HTMLSelectElement::~HTMLSelectElement()
|
||||
{
|
||||
mOptions->DropReference();
|
||||
}
|
||||
|
||||
// ISupports
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLSelectElement)
|
||||
|
|
|
@ -431,7 +431,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
virtual ~HTMLSelectElement();
|
||||
virtual ~HTMLSelectElement() = default;
|
||||
|
||||
friend class SafeOptionListMutation;
|
||||
|
||||
|
|
|
@ -1251,20 +1251,22 @@ IDBObjectStore::GetAddInfo(JSContext* aCx,
|
|||
}
|
||||
|
||||
// Figure out indexes and the index values to update here.
|
||||
const nsTArray<IndexMetadata>& indexes = mSpec->indexes();
|
||||
{
|
||||
const nsTArray<IndexMetadata>& indexes = mSpec->indexes();
|
||||
uint32_t idxCount = indexes.Length();
|
||||
|
||||
const uint32_t idxCount = indexes.Length();
|
||||
aUpdateInfoArray.SetCapacity(idxCount); // Pretty good estimate
|
||||
aUpdateInfoArray.SetCapacity(idxCount); // Pretty good estimate
|
||||
|
||||
for (uint32_t idxIndex = 0; idxIndex < idxCount; idxIndex++) {
|
||||
const IndexMetadata& metadata = indexes[idxIndex];
|
||||
for (uint32_t idxIndex = 0; idxIndex < idxCount; idxIndex++) {
|
||||
const IndexMetadata& metadata = indexes[idxIndex];
|
||||
|
||||
rv = AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(),
|
||||
metadata.unique(), metadata.multiEntry(),
|
||||
metadata.locale(), aCx, aValue,
|
||||
aUpdateInfoArray);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
rv = AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(),
|
||||
metadata.unique(), metadata.multiEntry(),
|
||||
metadata.locale(), aCx, aValue,
|
||||
aUpdateInfoArray);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1322,6 +1324,11 @@ IDBObjectStore::AddOrPut(JSContext* aCx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mTransaction->IsOpen()) {
|
||||
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FallibleTArray<uint8_t> cloneData;
|
||||
if (NS_WARN_IF(!cloneData.SetLength(cloneWriteInfo.mCloneBuffer.nbytes(),
|
||||
fallible))) {
|
||||
|
|
|
@ -164,6 +164,8 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
|
|||
// Create the formatter and fix up its formatting as necessary:
|
||||
CFDateFormatterRef formatter =
|
||||
CFDateFormatterCreate(nullptr, formatterLocale, dateStyle, timeStyle);
|
||||
if (MOZ_UNLIKELY(!formatter))
|
||||
return NS_ERROR_FAILURE; // don't continue
|
||||
|
||||
CFRelease(formatterLocale);
|
||||
|
||||
|
|
|
@ -255,7 +255,9 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
|
|||
redirectChain,
|
||||
aLoadInfo->CorsUnsafeHeaders(),
|
||||
aLoadInfo->GetForcePreflight(),
|
||||
aLoadInfo->GetIsPreflight());
|
||||
aLoadInfo->GetIsPreflight(),
|
||||
aLoadInfo->GetIsFromProcessingFrameAttributes()
|
||||
);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -296,7 +298,7 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
|
|||
redirectChain.AppendElement(redirectedPrincipal.forget());
|
||||
}
|
||||
|
||||
nsCOMPtr<nsILoadInfo> loadInfo =
|
||||
RefPtr<mozilla::LoadInfo> loadInfo =
|
||||
new mozilla::LoadInfo(requestingPrincipal,
|
||||
triggeringPrincipal,
|
||||
loadInfoArgs.securityFlags(),
|
||||
|
@ -316,6 +318,10 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
|
|||
loadInfoArgs.forcePreflight(),
|
||||
loadInfoArgs.isPreflight());
|
||||
|
||||
if (loadInfoArgs.isFromProcessingFrameAttributes()) {
|
||||
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||
}
|
||||
|
||||
loadInfo.forget(outLoadInfo);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1925,6 +1925,7 @@ var currencyDigits = {
|
|||
TND: 3,
|
||||
UGX: 0,
|
||||
UYI: 0,
|
||||
UYW: 4,
|
||||
VND: 0,
|
||||
VUV: 0,
|
||||
XAF: 0,
|
||||
|
|
|
@ -425,6 +425,19 @@ class JSFunction : public js::NativeObject
|
|||
return nonLazyScript();
|
||||
}
|
||||
|
||||
// If this is a scripted function, returns its canonical function (the
|
||||
// original function allocated by the frontend). Note that lazy self-hosted
|
||||
// builtins don't have a lazy script so in that case we also return nullptr.
|
||||
JSFunction* maybeCanonicalFunction() const {
|
||||
if (hasScript()) {
|
||||
return nonLazyScript()->functionNonDelazifying();
|
||||
}
|
||||
if (isInterpretedLazy() && !isSelfHostedBuiltin()) {
|
||||
return lazyScript()->functionNonDelazifying();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// The state of a JSFunction whose script errored out during bytecode
|
||||
// compilation. Such JSFunctions are only reachable via GC iteration and
|
||||
// not from script.
|
||||
|
|
|
@ -6172,6 +6172,8 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea
|
|||
/* fall through */
|
||||
|
||||
case SWEEP:
|
||||
AutoGCRooter::traceAllWrappers(&marker);
|
||||
|
||||
if (sweepPhase(budget) == NotFinished)
|
||||
break;
|
||||
|
||||
|
|
|
@ -484,13 +484,7 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp,
|
|||
if (associated->is<JSFunction>()) {
|
||||
|
||||
// Canonicalize new functions to use the original one associated with its script.
|
||||
JSFunction* fun = &associated->as<JSFunction>();
|
||||
if (fun->hasScript())
|
||||
associated = fun->nonLazyScript()->functionNonDelazifying();
|
||||
else if (fun->isInterpretedLazy() && !fun->isSelfHostedBuiltin())
|
||||
associated = fun->lazyScript()->functionNonDelazifying();
|
||||
else
|
||||
associated = nullptr;
|
||||
associated = associated->as<JSFunction>().maybeCanonicalFunction();
|
||||
|
||||
// If we have previously cleared the 'new' script information for this
|
||||
// function, don't try to construct another one.
|
||||
|
|
|
@ -3526,6 +3526,10 @@ TypeNewScript::make(JSContext* cx, ObjectGroup* group, JSFunction* fun)
|
|||
MOZ_ASSERT(!group->newScript());
|
||||
MOZ_ASSERT(!group->maybeUnboxedLayout());
|
||||
|
||||
// rollbackPartiallyInitializedObjects expects function_ to be
|
||||
// canonicalized.
|
||||
MOZ_ASSERT(fun->maybeCanonicalFunction() == fun);
|
||||
|
||||
if (group->unknownProperties())
|
||||
return true;
|
||||
|
||||
|
@ -3883,8 +3887,15 @@ TypeNewScript::rollbackPartiallyInitializedObjects(JSContext* cx, ObjectGroup* g
|
|||
oomUnsafe.crash("rollbackPartiallyInitializedObjects");
|
||||
}
|
||||
|
||||
if (!iter.isConstructing() || !iter.matchCallee(cx, function))
|
||||
if (!iter.isConstructing()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(iter.calleeTemplate()->maybeCanonicalFunction());
|
||||
|
||||
if (iter.calleeTemplate()->maybeCanonicalFunction() != function) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Derived class constructors initialize their this-binding later and
|
||||
// we shouldn't run the definite properties analysis on them.
|
||||
|
|
|
@ -1035,6 +1035,10 @@ nsComboboxControlFrame::HandleRedisplayTextEvent()
|
|||
mRedisplayTextEvent.Forget();
|
||||
|
||||
ActuallyDisplayText(true);
|
||||
if (!weakThis.IsAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// XXXbz This should perhaps be eResize. Check.
|
||||
PresContext()->PresShell()->FrameNeedsReflow(mDisplayFrame,
|
||||
nsIPresShell::eStyleChange,
|
||||
|
@ -1046,13 +1050,14 @@ nsComboboxControlFrame::HandleRedisplayTextEvent()
|
|||
void
|
||||
nsComboboxControlFrame::ActuallyDisplayText(bool aNotify)
|
||||
{
|
||||
nsCOMPtr<nsIContent> displayContent = mDisplayContent;
|
||||
if (mDisplayedOptionText.IsEmpty()) {
|
||||
// Have to use a non-breaking space for line-block-size calculations
|
||||
// to be right
|
||||
static const char16_t space = 0xA0;
|
||||
mDisplayContent->SetText(&space, 1, aNotify);
|
||||
displayContent->SetText(&space, 1, aNotify);
|
||||
} else {
|
||||
mDisplayContent->SetText(mDisplayedOptionText, aNotify);
|
||||
displayContent->SetText(mDisplayedOptionText, aNotify);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|||
, mIsThirdPartyContext(false)
|
||||
, mForcePreflight(false)
|
||||
, mIsPreflight(false)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
MOZ_ASSERT(mLoadingPrincipal);
|
||||
MOZ_ASSERT(mTriggeringPrincipal);
|
||||
|
@ -134,6 +135,7 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
|
|||
, mCorsUnsafeHeaders(rhs.mCorsUnsafeHeaders)
|
||||
, mForcePreflight(rhs.mForcePreflight)
|
||||
, mIsPreflight(rhs.mIsPreflight)
|
||||
, mIsFromProcessingFrameAttributes(rhs.mIsFromProcessingFrameAttributes)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -171,6 +173,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|||
, mCorsUnsafeHeaders(aCorsUnsafeHeaders)
|
||||
, mForcePreflight(aForcePreflight)
|
||||
, mIsPreflight(aIsPreflight)
|
||||
, mIsFromProcessingFrameAttributes(false)
|
||||
{
|
||||
MOZ_ASSERT(mLoadingPrincipal);
|
||||
MOZ_ASSERT(mTriggeringPrincipal);
|
||||
|
@ -587,4 +590,18 @@ LoadInfo::MaybeIncreaseTainting(uint32_t aTainting)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
LoadInfo::SetIsFromProcessingFrameAttributes()
|
||||
{
|
||||
mIsFromProcessingFrameAttributes = true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LoadInfo::GetIsFromProcessingFrameAttributes(bool *aIsFromProcessingFrameAttributes)
|
||||
{
|
||||
MOZ_ASSERT(aIsFromProcessingFrameAttributes);
|
||||
*aIsFromProcessingFrameAttributes = mIsFromProcessingFrameAttributes;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
|
||||
void SetIsPreflight();
|
||||
|
||||
void SetIsFromProcessingFrameAttributes();
|
||||
|
||||
private:
|
||||
// private constructor that is only allowed to be called from within
|
||||
// HttpChannelParent and FTPChannelParent declared as friends undeneath.
|
||||
|
@ -128,6 +130,11 @@ private:
|
|||
nsTArray<nsCString> mCorsUnsafeHeaders;
|
||||
bool mForcePreflight;
|
||||
bool mIsPreflight;
|
||||
|
||||
// Is true if this load was triggered by processing the attributes of the
|
||||
// browsing context container.
|
||||
// See nsILoadInfo.isFromProcessingFrameAttributes
|
||||
bool mIsFromProcessingFrameAttributes;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -528,4 +528,11 @@ interface nsILoadInfo : nsISupports
|
|||
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(MaybeIncreaseTainting(tainting)));
|
||||
}
|
||||
%}
|
||||
|
||||
/**
|
||||
* This attribute will be true if this is a load triggered by
|
||||
* https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
|
||||
* or https://html.spec.whatwg.org/multipage/obsolete.html#process-the-frame-attributes
|
||||
*/
|
||||
[infallible] readonly attribute boolean isFromProcessingFrameAttributes;
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,7 @@ struct LoadInfoArgs
|
|||
nsCString[] corsUnsafeHeaders;
|
||||
bool forcePreflight;
|
||||
bool isPreflight;
|
||||
bool isFromProcessingFrameAttributes;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -3072,14 +3072,17 @@ HttpBaseChannel::GetPerformance()
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// We only add to the document's performance object if it has the same
|
||||
// principal as the one triggering the load. This is to prevent navigations
|
||||
// triggered _by_ the iframe from showing up in the parent document's
|
||||
// performance entries if they have different origins.
|
||||
if (!mLoadInfo->TriggeringPrincipal()->Equals(loadingDocument->NodePrincipal())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_SUBDOCUMENT &&
|
||||
!mLoadInfo->GetIsFromProcessingFrameAttributes()) {
|
||||
// We only report loads caused by processing the attributes of the
|
||||
// browsing context container.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> innerWindow = loadingDocument->GetInnerWindow();
|
||||
if (!innerWindow) {
|
||||
return nullptr;
|
||||
|
|
|
@ -1170,4 +1170,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
|
|||
|
||||
static const int32_t kUnknownId = -1;
|
||||
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1548072521544000);
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1551960637095000);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user