mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Optimise WebExtension implementaion pt.1
This commit is contained in:
parent
fe26390483
commit
3be08bc94b
3 changed files with 22 additions and 19 deletions
|
|
@ -16,6 +16,8 @@
|
|||
#include "mozilla/dom/WebComponentsBinding.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
class nsDocument;
|
||||
|
|
@ -166,6 +168,9 @@ struct CustomElementDefinition
|
|||
// The list of attributes that this custom element observes.
|
||||
nsCOMArray<nsIAtom> mObservedAttributes;
|
||||
|
||||
// Hash set for O(1) lookup of observed attributes.
|
||||
nsTHashtable<nsISupportsHashKey> mObservedAttributesSet;
|
||||
|
||||
// The prototype to use for new custom elements of this type.
|
||||
JS::Heap<JSObject *> mPrototype;
|
||||
|
||||
|
|
@ -189,7 +194,7 @@ struct CustomElementDefinition
|
|||
return false;
|
||||
}
|
||||
|
||||
return mObservedAttributes.Contains(aName);
|
||||
return mObservedAttributesSet.Contains(aName);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue