2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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-09 01:36:46 +03:00
|
|
|
|
|
|
|
#include "nsMappedAttributeElement.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsMappedAttributeElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
|
|
|
|
{
|
|
|
|
mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2008-01-09 01:36:46 +03:00
|
|
|
nsMappedAttributeElement::SetMappedAttribute(nsIDocument* aDocument,
|
|
|
|
nsIAtom* aName,
|
|
|
|
nsAttrValue& aValue,
|
|
|
|
nsresult* aRetval)
|
|
|
|
{
|
2014-10-02 22:45:44 +04:00
|
|
|
NS_PRECONDITION(aDocument == GetComposedDoc(), "Unexpected document");
|
2008-01-09 01:36:46 +03:00
|
|
|
nsHTMLStyleSheet* sheet = aDocument ?
|
2012-07-30 18:20:58 +04:00
|
|
|
aDocument->GetAttributeStyleSheet() : nullptr;
|
2008-01-09 01:36:46 +03:00
|
|
|
|
|
|
|
*aRetval = mAttrsAndChildren.SetAndTakeMappedAttr(aName, aValue,
|
|
|
|
this, sheet);
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2008-01-09 01:36:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsMapRuleToAttributesFunc
|
|
|
|
nsMappedAttributeElement::GetAttributeMappingFunction() const
|
|
|
|
{
|
|
|
|
return &MapNoAttributesInto;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData)
|
|
|
|
{
|
|
|
|
}
|