2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
/* class for CSS @import rules */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
#ifndef mozilla_css_ImportRule_h__
|
|
|
|
#define mozilla_css_ImportRule_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-11-20 22:21:16 -08:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2013-06-23 05:03:39 -07:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2011-04-07 18:23:46 -07:00
|
|
|
#include "mozilla/css/Rule.h"
|
2011-03-17 10:41:52 -07:00
|
|
|
#include "nsIDOMCSSImportRule.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsMediaList;
|
2010-05-19 19:28:00 -07:00
|
|
|
class nsString;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
namespace mozilla {
|
2014-06-20 03:32:49 -07:00
|
|
|
|
|
|
|
class CSSStyleSheet;
|
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
namespace css {
|
2010-05-19 19:28:00 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class ImportRule final : public Rule,
|
2015-03-27 11:52:19 -07:00
|
|
|
public nsIDOMCSSImportRule
|
2011-03-17 10:41:52 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-07-14 15:57:54 -07:00
|
|
|
ImportRule(nsMediaList* aMedia, const nsString& aURLSpec,
|
|
|
|
uint32_t aLineNumber, uint32_t aColumnNumber);
|
2011-03-17 10:41:52 -07:00
|
|
|
private:
|
|
|
|
// for |Clone|
|
|
|
|
ImportRule(const ImportRule& aCopy);
|
|
|
|
~ImportRule();
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2015-11-05 00:44:10 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(ImportRule, mozilla::css::Rule)
|
2014-09-18 18:12:31 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2011-03-17 10:41:52 -07:00
|
|
|
|
|
|
|
DECL_STYLE_RULE_INHERIT
|
|
|
|
|
2010-08-07 22:30:57 -07:00
|
|
|
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
|
2011-03-06 19:59:03 -08:00
|
|
|
using Rule::GetStyleSheet; // unhide since nsIDOMCSSImportRule has its own GetStyleSheet
|
2010-08-07 22:30:57 -07:00
|
|
|
#endif
|
|
|
|
|
2015-11-05 00:44:10 -08:00
|
|
|
// Rule methods
|
2011-03-17 10:41:52 -07:00
|
|
|
#ifdef DEBUG
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
|
2011-03-17 10:41:52 -07:00
|
|
|
#endif
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual int32_t GetType() const override;
|
|
|
|
virtual already_AddRefed<Rule> Clone() const override;
|
2011-03-17 10:41:52 -07:00
|
|
|
|
2014-06-20 03:32:49 -07:00
|
|
|
void SetSheet(CSSStyleSheet*);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
|
2012-01-02 18:19:14 -08:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
// nsIDOMCSSRule interface
|
|
|
|
NS_DECL_NSIDOMCSSRULE
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
// nsIDOMCSSImportRule interface
|
|
|
|
NS_DECL_NSIDOMCSSIMPORTRULE
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
private:
|
|
|
|
nsString mURLSpec;
|
2015-10-17 22:24:48 -07:00
|
|
|
RefPtr<nsMediaList> mMedia;
|
|
|
|
RefPtr<CSSStyleSheet> mChildSheet;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
} // namespace css
|
|
|
|
} // namespace mozilla
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-03-17 10:41:52 -07:00
|
|
|
#endif /* mozilla_css_ImportRule_h__ */
|