Bug 1266851. Make <xmp> and <listing> use HTMLPreElement as their primary interface, per <https://github.com/whatwg/html/issues/1015>. r=peterv

This commit is contained in:
Boris Zbarsky
2016-04-26 12:50:30 -04:00
parent 066c99baa9
commit 951e58a762
6 changed files with 15 additions and 34 deletions

View File

@@ -64,6 +64,10 @@ HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
NS_IMETHODIMP_(bool)
HTMLPreElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
if (!mNodeInfo->Equals(nsGkAtoms::pre)) {
return nsGenericHTMLElement::IsAttributeMapped(aAttribute);
}
static const MappedAttributeEntry attributes[] = {
{ &nsGkAtoms::wrap },
{ nullptr },
@@ -80,6 +84,10 @@ HTMLPreElement::IsAttributeMapped(const nsIAtom* aAttribute) const
nsMapRuleToAttributesFunc
HTMLPreElement::GetAttributeMappingFunction() const
{
if (!mNodeInfo->Equals(nsGkAtoms::pre)) {
return nsGenericHTMLElement::GetAttributeMappingFunction();
}
return &MapAttributesIntoRule;
}