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

This commit is contained in:
roytam1 2023-05-24 09:03:14 +08:00
commit 96e3781bd9
3 changed files with 22 additions and 8 deletions

View file

@ -2363,11 +2363,14 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
JS::Rooted<JSScript*> script(cx);
script = exec.GetScript();
// Create a ClassicScript object and associate it with the
// JSScript.
RefPtr<ClassicScript> classicScript = new ClassicScript(
aRequest->mFetchOptions, aRequest->mBaseURL);
classicScript->AssociateWithScript(script);
// With scripts disabled GetScript() will return nullptr
if (script) {
// Create a ClassicScript object and associate it with the
// JSScript.
RefPtr<ClassicScript> classicScript = new ClassicScript(
aRequest->mFetchOptions, aRequest->mBaseURL);
classicScript->AssociateWithScript(script);
}
rv = exec.ExecScript();
}

View file

@ -717,8 +717,9 @@ nsBindingManager::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
aData->mTreeMatchContext.mIsTopmostScope = (index == 0);
binding->WalkRules(aFunc, aData);
}
aData->mTreeMatchContext.mForAssignedSlot = false;
aData->mTreeMatchContext.mForAssignedSlot = false;
aData->mTreeMatchContext.mIsTopmostScope = false;
aData->mTreeMatchContext.mRestrictToSlottedPseudo = false;
}

View file

@ -680,7 +680,11 @@ void RuleHash::EnumerateAllRules(Element* aElement, ElementDependentRuleProcesso
aData->mTreeMatchContext.mAncestorFilter.HasFilter() ?
&aData->mTreeMatchContext.mAncestorFilter : nullptr;
#ifdef DEBUG
if (filter) {
bool isRestricted = (aData->mTreeMatchContext.mShadowHosts.Length() > 0 ||
aData->mTreeMatchContext.mRestrictToSlottedPseudo ||
aData->mTreeMatchContext.mOnlyMatchHostPseudo ||
aData->mTreeMatchContext.mForAssignedSlot);
if (filter && !isRestricted) {
filter->AssertHasAllAncestors(aElement);
}
#endif
@ -1732,7 +1736,13 @@ static bool SelectorMatches(Element* aElement,
Element* targetElement = aElement;
if (aTreeMatchContext.mForAssignedSlot) {
targetElement = aElement->GetAssignedSlot()->AsElement();
HTMLSlotElement* slot = aElement->GetAssignedSlot();
// We're likely testing the slottable's ancestors and it might
// not have an assigned slot, so return early.
if (!slot) {
return false;
}
targetElement = slot->AsElement();
}
// namespace/tag match