1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #include "nsMappedAttributeElement.h"
8 #include "nsIDocument.h"
9 
10 #ifdef MOZ_OLD_STYLE
WalkContentStyleRules(nsRuleWalker * aRuleWalker)11 nsresult nsMappedAttributeElement::WalkContentStyleRules(
12     nsRuleWalker* aRuleWalker) {
13   mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker);
14   return NS_OK;
15 }
16 #endif
17 
SetAndSwapMappedAttribute(nsAtom * aName,nsAttrValue & aValue,bool * aValueWasSet,nsresult * aRetval)18 bool nsMappedAttributeElement::SetAndSwapMappedAttribute(nsAtom* aName,
19                                                          nsAttrValue& aValue,
20                                                          bool* aValueWasSet,
21                                                          nsresult* aRetval) {
22   nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
23   *aRetval = mAttrsAndChildren.SetAndSwapMappedAttr(aName, aValue, this, sheet,
24                                                     aValueWasSet);
25   return true;
26 }
27 
28 nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const29 nsMappedAttributeElement::GetAttributeMappingFunction() const {
30   return &MapNoAttributesInto;
31 }
32 
MapNoAttributesInto(const nsMappedAttributes * aAttributes,mozilla::GenericSpecifiedValues * aGenericData)33 void nsMappedAttributeElement::MapNoAttributesInto(
34     const nsMappedAttributes* aAttributes,
35     mozilla::GenericSpecifiedValues* aGenericData) {}
36 
NodeInfoChanged(nsIDocument * aOldDoc)37 void nsMappedAttributeElement::NodeInfoChanged(nsIDocument* aOldDoc) {
38   nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
39   mAttrsAndChildren.SetMappedAttrStyleSheet(sheet);
40   nsMappedAttributeElementBase::NodeInfoChanged(aOldDoc);
41 }
42