content/base/src/nsMappedAttributeElement.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/src/nsMappedAttributeElement.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +/**
    1.11 + * nsMappedAttributeElement is the base for elements supporting style mapped
    1.12 + * attributes via nsMappedAttributes (HTML and MathML).
    1.13 + */
    1.14 +
    1.15 +#ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
    1.16 +#define NS_MAPPEDATTRIBUTEELEMENT_H_
    1.17 +
    1.18 +#include "mozilla/Attributes.h"
    1.19 +#include "nsStyledElement.h"
    1.20 +
    1.21 +class nsMappedAttributes;
    1.22 +struct nsRuleData;
    1.23 +
    1.24 +typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes, 
    1.25 +                                          nsRuleData* aData);
    1.26 +
    1.27 +typedef nsStyledElement nsMappedAttributeElementBase;
    1.28 +
    1.29 +class nsMappedAttributeElement : public nsMappedAttributeElementBase
    1.30 +{
    1.31 +
    1.32 +protected:
    1.33 +
    1.34 +  nsMappedAttributeElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
    1.35 +    : nsMappedAttributeElementBase(aNodeInfo)
    1.36 +  {}
    1.37 +
    1.38 +public:
    1.39 +  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
    1.40 +
    1.41 +  static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, 
    1.42 +                                  nsRuleData* aRuleData);
    1.43 +
    1.44 +  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE;
    1.45 +  virtual bool SetMappedAttribute(nsIDocument* aDocument,
    1.46 +                                    nsIAtom* aName,
    1.47 +                                    nsAttrValue& aValue,
    1.48 +                                    nsresult* aRetval) MOZ_OVERRIDE;
    1.49 +};
    1.50 +
    1.51 +#endif // NS_MAPPEDATTRIBUTEELEMENT_H_

mercurial