2015-05-03 19:32:37 +00: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 11:12:37 +00: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 22:36:46 +00:00
|
|
|
|
|
|
|
#include "nsMappedAttributeElement.h"
|
|
|
|
#include "nsIDocument.h"
|
|
|
|
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool
|
2017-10-02 22:05:19 +00:00
|
|
|
nsMappedAttributeElement::SetAndSwapMappedAttribute(nsAtom* aName,
|
2017-05-18 21:09:01 +00:00
|
|
|
nsAttrValue& aValue,
|
|
|
|
bool* aValueWasSet,
|
|
|
|
nsresult* aRetval)
|
2008-01-08 22:36:46 +00:00
|
|
|
{
|
2017-04-07 16:21:48 +00:00
|
|
|
nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
|
2017-05-18 21:09:01 +00:00
|
|
|
*aRetval = mAttrsAndChildren.SetAndSwapMappedAttr(aName, aValue,
|
|
|
|
this, sheet, aValueWasSet);
|
2011-10-17 14:59:28 +00:00
|
|
|
return true;
|
2008-01-08 22:36:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsMapRuleToAttributesFunc
|
|
|
|
nsMappedAttributeElement::GetAttributeMappingFunction() const
|
|
|
|
{
|
|
|
|
return &MapNoAttributesInto;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes,
|
2017-01-27 00:51:01 +00:00
|
|
|
mozilla::GenericSpecifiedValues* aGenericData)
|
2008-01-08 22:36:46 +00:00
|
|
|
{
|
|
|
|
}
|
2017-04-07 16:21:48 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
nsMappedAttributeElement::NodeInfoChanged(nsIDocument* aOldDoc)
|
|
|
|
{
|
|
|
|
nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
|
|
|
|
mAttrsAndChildren.SetMappedAttrStyleSheet(sheet);
|
|
|
|
nsMappedAttributeElementBase::NodeInfoChanged(aOldDoc);
|
|
|
|
}
|