2008-01-08 14:36:46 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-01-08 14:36:46 -08:00
|
|
|
|
|
|
|
#include "nsMappedAttributeElement.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsMappedAttributeElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
|
|
|
{
|
|
|
|
mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2008-01-08 14:36:46 -08:00
|
|
|
nsMappedAttributeElement::SetMappedAttribute(nsIDocument* aDocument,
|
|
|
|
nsIAtom* aName,
|
|
|
|
nsAttrValue& aValue,
|
|
|
|
nsresult* aRetval)
|
|
|
|
{
|
2014-10-02 11:45:44 -07:00
|
|
|
NS_PRECONDITION(aDocument == GetComposedDoc(), "Unexpected document");
|
2008-01-08 14:36:46 -08:00
|
|
|
nsHTMLStyleSheet* sheet = aDocument ?
|
2012-07-30 07:20:58 -07:00
|
|
|
aDocument->GetAttributeStyleSheet() : nullptr;
|
2008-01-08 14:36:46 -08:00
|
|
|
|
|
|
|
*aRetval = mAttrsAndChildren.SetAndTakeMappedAttr(aName, aValue,
|
|
|
|
this, sheet);
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2008-01-08 14:36:46 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
nsMapRuleToAttributesFunc
|
|
|
|
nsMappedAttributeElement::GetAttributeMappingFunction() const
|
|
|
|
{
|
|
|
|
return &MapNoAttributesInto;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData)
|
|
|
|
{
|
|
|
|
}
|