Issue #1375 - Include content rules from HTMLTableCellElement::WalkContentStyleRules and move to the mapped attr functionality

* Bugs 1341647 and 1341648
This commit is contained in:
Matt A. Tobin 2020-04-17 05:07:41 -04:00 committed by Roy Tam
commit 6b48075b57
16 changed files with 158 additions and 259 deletions

View file

@ -714,10 +714,19 @@ nsAttrAndChildArray::MappedAttrCount() const
return mImpl && mImpl->mMappedAttrs ? (uint32_t)mImpl->mMappedAttrs->Count() : 0;
}
nsresult
nsAttrAndChildArray::ForceMapped(nsMappedAttributeElement* aContent, nsIDocument* aDocument)
{
nsHTMLStyleSheet* sheet = aDocument->GetAttributeStyleSheet();
RefPtr<nsMappedAttributes> mapped = GetModifiableMapped(aContent, sheet, false, 0);
return MakeMappedUnique(mapped);
}
nsMappedAttributes*
nsAttrAndChildArray::GetModifiableMapped(nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet,
bool aWillAddAttr)
bool aWillAddAttr,
int32_t aAttrCount)
{
if (mImpl && mImpl->mMappedAttrs) {
return mImpl->mMappedAttrs->Clone(aWillAddAttr);
@ -727,7 +736,7 @@ nsAttrAndChildArray::GetModifiableMapped(nsMappedAttributeElement* aContent,
nsMapRuleToAttributesFunc mapRuleFunc =
aContent->GetAttributeMappingFunction();
return new nsMappedAttributes(aSheet, mapRuleFunc);
return new (aAttrCount) nsMappedAttributes(aSheet, mapRuleFunc);
}
nsresult