From 5f297c5f57583b0f9d27d714beb285919f42d655 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 05:07:41 -0400 Subject: Issue #1375 - Include content rules from HTMLTableCellElement::WalkContentStyleRules and move to the mapped attr functionality * Bugs 1341647 and 1341648 --- dom/base/nsAttrAndChildArray.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'dom/base/nsAttrAndChildArray.cpp') diff --git a/dom/base/nsAttrAndChildArray.cpp b/dom/base/nsAttrAndChildArray.cpp index 9fd27262b..4daac498b 100644 --- a/dom/base/nsAttrAndChildArray.cpp +++ b/dom/base/nsAttrAndChildArray.cpp @@ -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 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 -- cgit v1.2.3