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"
|
2019-01-02 13:05:23 +00:00
|
|
|
#include "mozilla/dom/Document.h"
|
2008-01-08 22:36:46 +00:00
|
|
|
|
2017-10-02 22:05:19 +00:00
|
|
|
bool nsMappedAttributeElement::SetAndSwapMappedAttribute(nsAtom* aName,
|
2017-05-18 21:09:01 +00:00
|
|
|
nsAttrValue& aValue,
|
|
|
|
bool* aValueWasSet,
|
|
|
|
nsresult* aRetval) {
|
2017-04-07 16:21:48 +00:00
|
|
|
nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
|
2018-08-07 19:07:26 +00:00
|
|
|
*aRetval =
|
|
|
|
mAttrs.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;
|
|
|
|
}
|
|
|
|
|
2018-06-22 16:48:42 +00:00
|
|
|
void nsMappedAttributeElement::MapNoAttributesInto(
|
|
|
|
const nsMappedAttributes*, mozilla::MappedDeclarations&) {}
|
2017-04-07 16:21:48 +00:00
|
|
|
|
2019-01-02 13:05:23 +00:00
|
|
|
void nsMappedAttributeElement::NodeInfoChanged(Document* aOldDoc) {
|
2017-04-07 16:21:48 +00:00
|
|
|
nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
|
2018-08-07 19:07:26 +00:00
|
|
|
mAttrs.SetMappedAttrStyleSheet(sheet);
|
2017-04-07 16:21:48 +00:00
|
|
|
nsMappedAttributeElementBase::NodeInfoChanged(aOldDoc);
|
|
|
|
}
|