2009-12-31 07:56:32 -08: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/. */
|
2009-12-31 07:56:32 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* style sheet and style rule processor representing style attributes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsHTMLCSSStyleSheet_h_
|
|
|
|
#define nsHTMLCSSStyleSheet_h_
|
|
|
|
|
2011-12-16 11:42:07 -08:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-06-23 05:03:39 -07:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2011-12-16 11:42:07 -08:00
|
|
|
|
2013-03-21 17:05:20 -07:00
|
|
|
#include "nsDataHashtable.h"
|
2009-12-31 07:56:32 -08:00
|
|
|
#include "nsIStyleRuleProcessor.h"
|
|
|
|
|
2012-09-30 09:40:24 -07:00
|
|
|
struct MiscContainer;
|
|
|
|
|
2013-06-13 22:34:37 -07:00
|
|
|
class nsHTMLCSSStyleSheet MOZ_FINAL : public nsIStyleRuleProcessor
|
2013-05-05 00:03:20 -07:00
|
|
|
{
|
2009-12-31 07:56:32 -08:00
|
|
|
public:
|
2013-06-13 22:34:37 -07:00
|
|
|
nsHTMLCSSStyleSheet();
|
2012-09-30 09:40:24 -07:00
|
|
|
~nsHTMLCSSStyleSheet();
|
2009-12-31 07:56:32 -08:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2009-12-31 07:56:33 -08:00
|
|
|
// nsIStyleRuleProcessor
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE;
|
|
|
|
virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE;
|
|
|
|
virtual void RulesMatching(AnonBoxRuleProcessorData* aData) MOZ_OVERRIDE;
|
2009-12-31 07:56:32 -08:00
|
|
|
#ifdef MOZ_XUL
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE;
|
2009-12-31 07:56:32 -08:00
|
|
|
#endif
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2013-11-27 22:46:39 -08:00
|
|
|
virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2010-03-31 17:43:32 -07:00
|
|
|
virtual nsRestyleHint
|
2012-09-14 09:10:08 -07:00
|
|
|
HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE;
|
|
|
|
virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE;
|
2013-06-23 05:03:39 -07:00
|
|
|
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
2013-03-23 19:14:43 -07:00
|
|
|
const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
|
2013-06-23 05:03:39 -07:00
|
|
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
2013-03-23 19:14:43 -07:00
|
|
|
const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
|
2009-12-31 07:56:32 -08:00
|
|
|
|
2012-09-30 09:40:24 -07:00
|
|
|
void CacheStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
|
|
|
|
void EvictStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
|
|
|
|
MiscContainer* LookupStyleAttr(const nsAString& aSerialized);
|
|
|
|
|
2009-12-31 07:56:32 -08:00
|
|
|
private:
|
2011-12-16 11:42:07 -08:00
|
|
|
nsHTMLCSSStyleSheet(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
|
|
|
|
nsHTMLCSSStyleSheet& operator=(const nsHTMLCSSStyleSheet& aCopy) MOZ_DELETE;
|
2009-12-31 07:56:32 -08:00
|
|
|
|
|
|
|
protected:
|
2012-09-30 09:40:24 -07:00
|
|
|
nsDataHashtable<nsStringHashKey, MiscContainer*> mCachedStyleAttrs;
|
2009-12-31 07:56:32 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !defined(nsHTMLCSSStyleSheet_h_) */
|