summaryrefslogtreecommitdiff
path: root/dom/base/nsAttrAndChildArray.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 05:07:41 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 05:07:41 -0400
commit77707d7bc61c1c0dedee41026f283d7575a45913 (patch)
treef67fd1bafe4c449fc6527e172deb59411bfbf85f /dom/base/nsAttrAndChildArray.cpp
parent90b01d7f69ba0990c3505a6c6794456ed9d0e71d (diff)
downloadaura-central-77707d7bc61c1c0dedee41026f283d7575a45913.tar.gz
Issue mcp-graveyard/UXP%1375 - Include content rules from HTMLTableCellElement::WalkContentStyleRules and move to the mapped attr functionality
* Bugs 1341647 and 1341648
Diffstat (limited to 'dom/base/nsAttrAndChildArray.cpp')
-rw-r--r--dom/base/nsAttrAndChildArray.cpp13
1 files changed, 11 insertions, 2 deletions
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<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