1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/src/nsMappedAttributeElement.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsMappedAttributeElement.h" 1.11 +#include "nsIDocument.h" 1.12 + 1.13 +nsresult 1.14 +nsMappedAttributeElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) 1.15 +{ 1.16 + mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker); 1.17 + return NS_OK; 1.18 +} 1.19 + 1.20 +bool 1.21 +nsMappedAttributeElement::SetMappedAttribute(nsIDocument* aDocument, 1.22 + nsIAtom* aName, 1.23 + nsAttrValue& aValue, 1.24 + nsresult* aRetval) 1.25 +{ 1.26 + NS_PRECONDITION(aDocument == GetCurrentDoc(), "Unexpected document"); 1.27 + nsHTMLStyleSheet* sheet = aDocument ? 1.28 + aDocument->GetAttributeStyleSheet() : nullptr; 1.29 + 1.30 + *aRetval = mAttrsAndChildren.SetAndTakeMappedAttr(aName, aValue, 1.31 + this, sheet); 1.32 + return true; 1.33 +} 1.34 + 1.35 +nsMapRuleToAttributesFunc 1.36 +nsMappedAttributeElement::GetAttributeMappingFunction() const 1.37 +{ 1.38 + return &MapNoAttributesInto; 1.39 +} 1.40 + 1.41 +void 1.42 +nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes, 1.43 + nsRuleData* aData) 1.44 +{ 1.45 +}