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