layout/style/ImportRule.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/ImportRule.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     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 +/* class for CSS @import rules */
    1.10 +
    1.11 +#ifndef mozilla_css_ImportRule_h__
    1.12 +#define mozilla_css_ImportRule_h__
    1.13 +
    1.14 +#include "mozilla/Attributes.h"
    1.15 +
    1.16 +#include "mozilla/MemoryReporting.h"
    1.17 +#include "mozilla/css/Rule.h"
    1.18 +#include "nsIDOMCSSImportRule.h"
    1.19 +#include "nsCSSRules.h"
    1.20 +
    1.21 +class nsMediaList;
    1.22 +class nsString;
    1.23 +
    1.24 +namespace mozilla {
    1.25 +namespace css {
    1.26 +
    1.27 +class ImportRule MOZ_FINAL : public Rule,
    1.28 +                             public nsIDOMCSSImportRule
    1.29 +{
    1.30 +public:
    1.31 +  ImportRule(nsMediaList* aMedia, const nsString& aURLSpec);
    1.32 +private:
    1.33 +  // for |Clone|
    1.34 +  ImportRule(const ImportRule& aCopy);
    1.35 +  ~ImportRule();
    1.36 +public:
    1.37 +  NS_DECL_ISUPPORTS
    1.38 +
    1.39 +  DECL_STYLE_RULE_INHERIT
    1.40 +
    1.41 +#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
    1.42 +  using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
    1.43 +#endif
    1.44 +
    1.45 +  // nsIStyleRule methods
    1.46 +#ifdef DEBUG
    1.47 +  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
    1.48 +#endif
    1.49 +
    1.50 +  // Rule methods
    1.51 +  virtual int32_t GetType() const;
    1.52 +  virtual already_AddRefed<Rule> Clone() const;
    1.53 +
    1.54 +  void SetSheet(nsCSSStyleSheet*);
    1.55 +
    1.56 +  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    1.57 +
    1.58 +  // nsIDOMCSSRule interface
    1.59 +  NS_DECL_NSIDOMCSSRULE
    1.60 +
    1.61 +  // nsIDOMCSSImportRule interface
    1.62 +  NS_DECL_NSIDOMCSSIMPORTRULE
    1.63 +
    1.64 +private:
    1.65 +  nsString  mURLSpec;
    1.66 +  nsRefPtr<nsMediaList> mMedia;
    1.67 +  nsRefPtr<nsCSSStyleSheet> mChildSheet;
    1.68 +};
    1.69 +
    1.70 +} // namespace css
    1.71 +} // namespace mozilla
    1.72 +
    1.73 +#endif /* mozilla_css_ImportRule_h__ */

mercurial