author Dylan Roeh <>
Tue, 28 Aug 2018 11:35:46 -0500
changeset 481113 31683bdf39d7bcacf8d9bf265fc2365024473fbe
parent 465329 8e5206684eea8da76d938de3c02c3e8c240e7c9b
child 481269 5ba328c141b7b84bb0b6b836740b22d1d84b5380
permissions -rw-r--r--
Bug 1485178 - Only migrate sharedprefs when in Fennec. r=snorp a=ritu

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 */

 * nsMappedAttributeElement is the base for elements supporting style mapped
 * attributes via nsMappedAttributes (HTML and MathML).


#include "mozilla/Attributes.h"
#include "mozilla/GenericSpecifiedValues.h"
#include "nsStyledElement.h"

class nsMappedAttributes;
struct nsRuleData;

typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes,
                                          mozilla::GenericSpecifiedValues* aData);

typedef nsStyledElement nsMappedAttributeElementBase;

class nsMappedAttributeElement : public nsMappedAttributeElementBase


  explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsMappedAttributeElementBase(aNodeInfo)

  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;

  static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
                                  mozilla::GenericSpecifiedValues* aGenericData);

  virtual bool SetAndSwapMappedAttribute(nsAtom* aName,
                                         nsAttrValue& aValue,
                                         bool* aValueWasSet,
                                         nsresult* aRetval) override;

  virtual void NodeInfoChanged(nsIDocument* aOldDoc) override;