layout/style/nsDOMCSSAttrDeclaration.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/nsDOMCSSAttrDeclaration.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/* DOM object for element.style */
    1.10 +
    1.11 +#ifndef nsDOMCSSAttributeDeclaration_h
    1.12 +#define nsDOMCSSAttributeDeclaration_h
    1.13 +
    1.14 +#include "mozilla/Attributes.h"
    1.15 +#include "nsDOMCSSDeclaration.h"
    1.16 +
    1.17 +#include "nsAutoPtr.h"
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace dom {
    1.21 +class Element;
    1.22 +}
    1.23 +}
    1.24 +
    1.25 +class nsDOMCSSAttributeDeclaration MOZ_FINAL : public nsDOMCSSDeclaration
    1.26 +{
    1.27 +public:
    1.28 +  typedef mozilla::dom::Element Element;
    1.29 +  nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride);
    1.30 +  ~nsDOMCSSAttributeDeclaration();
    1.31 +
    1.32 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.33 +  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMCSSAttributeDeclaration,
    1.34 +                                                                   nsICSSDeclaration)
    1.35 +
    1.36 +  // If GetCSSDeclaration returns non-null, then the decl it returns
    1.37 +  // is owned by our current style rule.
    1.38 +  virtual mozilla::css::Declaration* GetCSSDeclaration(bool aAllocate);
    1.39 +  virtual void GetCSSParsingEnvironment(CSSParsingEnvironment& aCSSParseEnv) MOZ_OVERRIDE;
    1.40 +  NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) MOZ_OVERRIDE;
    1.41 +
    1.42 +  virtual nsINode* GetParentObject() MOZ_OVERRIDE;
    1.43 +
    1.44 +  NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,
    1.45 +                              const nsAString& aValue) MOZ_OVERRIDE;
    1.46 +
    1.47 +protected:
    1.48 +  virtual nsresult SetCSSDeclaration(mozilla::css::Declaration* aDecl) MOZ_OVERRIDE;
    1.49 +  virtual nsIDocument* DocToUpdate() MOZ_OVERRIDE;
    1.50 +
    1.51 +  nsRefPtr<Element> mElement;
    1.52 +
    1.53 +  /* If true, this indicates that this nsDOMCSSAttributeDeclaration
    1.54 +   * should interact with mContent's SMIL override style rule (rather
    1.55 +   * than the inline style rule).
    1.56 +   */
    1.57 +  const bool mIsSMILOverride;
    1.58 +};
    1.59 +
    1.60 +#endif /* nsDOMCSSAttributeDeclaration_h */

mercurial