2009-12-31 18:56:32 +03: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/. */
|
2009-12-31 18:56:32 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* style sheet and style rule processor representing style attributes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsHTMLCSSStyleSheet_h_
|
|
|
|
#define nsHTMLCSSStyleSheet_h_
|
|
|
|
|
2011-12-16 23:42:07 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
2009-12-31 18:56:33 +03:00
|
|
|
#include "nsIStyleSheet.h"
|
2009-12-31 18:56:32 +03:00
|
|
|
#include "nsIStyleRuleProcessor.h"
|
|
|
|
|
2012-06-19 07:26:34 +04:00
|
|
|
class nsHTMLCSSStyleSheet MOZ_FINAL : public nsIStyleSheet,
|
|
|
|
public nsIStyleRuleProcessor {
|
2009-12-31 18:56:32 +03:00
|
|
|
public:
|
|
|
|
nsHTMLCSSStyleSheet();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2009-12-31 18:56:33 +03:00
|
|
|
nsresult Init(nsIURI* aURL, nsIDocument* aDocument);
|
2010-05-18 08:00:39 +04:00
|
|
|
void Reset(nsIURI* aURL);
|
2009-12-31 18:56:33 +03:00
|
|
|
|
|
|
|
// nsIStyleSheet
|
2010-05-18 08:00:39 +04:00
|
|
|
virtual nsIURI* GetSheetURI() const;
|
|
|
|
virtual nsIURI* GetBaseURI() const;
|
2010-05-13 00:18:47 +04:00
|
|
|
virtual void GetTitle(nsString& aTitle) const;
|
|
|
|
virtual void GetType(nsString& aType) const;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool HasRules() const;
|
|
|
|
virtual bool IsApplicable() const;
|
|
|
|
virtual void SetEnabled(bool aEnabled);
|
|
|
|
virtual bool IsComplete() const;
|
2010-05-13 00:18:47 +04:00
|
|
|
virtual void SetComplete();
|
2010-05-18 08:00:39 +04:00
|
|
|
virtual nsIStyleSheet* GetParentSheet() const; // will be null
|
|
|
|
virtual nsIDocument* GetOwningDocument() const;
|
2010-05-13 00:18:47 +04:00
|
|
|
virtual void SetOwningDocument(nsIDocument* aDocument);
|
2009-12-31 18:56:33 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
|
|
|
#endif
|
2009-12-31 18:56:32 +03:00
|
|
|
|
2009-12-31 18:56:33 +03:00
|
|
|
// nsIStyleRuleProcessor
|
2010-07-19 01:20:40 +04:00
|
|
|
virtual void RulesMatching(ElementRuleProcessorData* aData);
|
|
|
|
virtual void RulesMatching(PseudoElementRuleProcessorData* aData);
|
|
|
|
virtual void RulesMatching(AnonBoxRuleProcessorData* aData);
|
2009-12-31 18:56:32 +03:00
|
|
|
#ifdef MOZ_XUL
|
2010-07-19 01:20:40 +04:00
|
|
|
virtual void RulesMatching(XULTreeRuleProcessorData* aData);
|
2009-12-31 18:56:32 +03:00
|
|
|
#endif
|
2010-04-01 04:43:32 +04:00
|
|
|
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData);
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
|
2010-04-01 04:43:32 +04:00
|
|
|
virtual nsRestyleHint
|
2009-12-31 18:56:32 +03:00
|
|
|
HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool MediumFeaturesChanged(nsPresContext* aPresContext);
|
2011-12-09 09:01:52 +04:00
|
|
|
virtual NS_MUST_OVERRIDE size_t
|
|
|
|
SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
|
|
|
virtual NS_MUST_OVERRIDE size_t
|
|
|
|
SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const MOZ_OVERRIDE;
|
2009-12-31 18:56:32 +03:00
|
|
|
|
|
|
|
private:
|
2011-12-16 23:42:07 +04:00
|
|
|
nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
|
|
|
|
nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
|
2009-12-31 18:56:32 +03:00
|
|
|
|
|
|
|
protected:
|
2010-05-18 08:00:39 +04:00
|
|
|
nsCOMPtr<nsIURI> mURL;
|
|
|
|
nsIDocument* mDocument;
|
2009-12-31 18:56:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !defined(nsHTMLCSSStyleSheet_h_) */
|