michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsMappedAttributeElement.h" michael@0: #include "nsIDocument.h" michael@0: michael@0: nsresult michael@0: nsMappedAttributeElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) michael@0: { michael@0: mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker); michael@0: return NS_OK; michael@0: } michael@0: michael@0: bool michael@0: nsMappedAttributeElement::SetMappedAttribute(nsIDocument* aDocument, michael@0: nsIAtom* aName, michael@0: nsAttrValue& aValue, michael@0: nsresult* aRetval) michael@0: { michael@0: NS_PRECONDITION(aDocument == GetCurrentDoc(), "Unexpected document"); michael@0: nsHTMLStyleSheet* sheet = aDocument ? michael@0: aDocument->GetAttributeStyleSheet() : nullptr; michael@0: michael@0: *aRetval = mAttrsAndChildren.SetAndTakeMappedAttr(aName, aValue, michael@0: this, sheet); michael@0: return true; michael@0: } michael@0: michael@0: nsMapRuleToAttributesFunc michael@0: nsMappedAttributeElement::GetAttributeMappingFunction() const michael@0: { michael@0: return &MapNoAttributesInto; michael@0: } michael@0: michael@0: void michael@0: nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes, michael@0: nsRuleData* aData) michael@0: { michael@0: }