Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-19 22:59:16 -05:00 committed by Roy Tam
commit db3b6b5884
8 changed files with 34 additions and 112 deletions

View file

@ -479,7 +479,7 @@ Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
if (data) {
// If this is a registered custom element then fix the prototype.
nsContentUtils::GetCustomPrototype(OwnerDoc(), NodeInfo()->NamespaceID(),
data->mType, &customProto);
data->GetCustomElementType(), &customProto);
if (customProto &&
NodePrincipal()->SubsumesConsideringDomain(nsContentUtils::ObjectPrincipal(customProto))) {
// Just go ahead and create with the right proto up front. Set
@ -2590,7 +2590,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
if (CustomElementData* data = GetCustomElementData()) {
if (CustomElementDefinition* definition =
nsContentUtils::GetElementDefinitionIfObservingAttr(this,
data->mType,
data->GetCustomElementType(),
aName)) {
MOZ_ASSERT(data->mState == CustomElementData::State::eCustom,
"AttributeChanged callback should fire only if "
@ -2860,7 +2860,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
if (CustomElementData* data = GetCustomElementData()) {
if (CustomElementDefinition* definition =
nsContentUtils::GetElementDefinitionIfObservingAttr(this,
data->mType,
data->GetCustomElementType(),
aName)) {
MOZ_ASSERT(data->mState == CustomElementData::State::eCustom,
"AttributeChanged callback should fire only if "