mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
add main thread only cache for nsIAtoms to speed up atomization dom/base
add main thread only cache for nsIAtoms to speed up atomization
This commit is contained in:
parent
4ab1401ee6
commit
c4af2549b2
3 changed files with 18 additions and 16 deletions
|
|
@ -1283,7 +1283,7 @@ Element::ToggleAttribute(const nsAString& aName,
|
|||
if (aForce.WasPassed() && !aForce.Value()) {
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<nsIAtom> nameAtom = NS_Atomize(nameToUse);
|
||||
nsCOMPtr<nsIAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
|
||||
if (!nameAtom) {
|
||||
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return false;
|
||||
|
|
@ -1398,7 +1398,7 @@ Element::GetAttributeNS(const nsAString& aNamespaceURI,
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
|
||||
nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
|
||||
bool hasAttr = GetAttr(nsid, name, aReturn);
|
||||
if (!hasAttr) {
|
||||
SetDOMStringToNull(aReturn);
|
||||
|
|
@ -1430,7 +1430,7 @@ Element::RemoveAttributeNS(const nsAString& aNamespaceURI,
|
|||
const nsAString& aLocalName,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
|
||||
nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
|
||||
int32_t nsid =
|
||||
nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI,
|
||||
nsContentUtils::IsChromeDoc(OwnerDoc()));
|
||||
|
|
@ -1518,7 +1518,7 @@ Element::HasAttributeNS(const nsAString& aNamespaceURI,
|
|||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
|
||||
nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
|
||||
return HasAttr(nsid, name);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue