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"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2011-12-16 23:42:07 +04:00
|
|
|
|
2013-03-22 04:05:20 +04:00
|
|
|
#include "nsDataHashtable.h"
|
2009-12-31 18:56:32 +03:00
|
|
|
#include "nsIStyleRuleProcessor.h"
|
|
|
|
|
2012-09-30 20:40:24 +04:00
|
|
|
struct MiscContainer;
|
|
|
|
|
2013-06-14 09:34:37 +04:00
|
|
|
class nsHTMLCSSStyleSheet MOZ_FINAL : public nsIStyleRuleProcessor
|
2013-05-05 11:03:20 +04:00
|
|
|
{
|
2009-12-31 18:56:32 +03:00
|
|
|
public:
|
2013-06-14 09:34:37 +04:00
|
|
|
nsHTMLCSSStyleSheet();
|
2012-09-30 20:40:24 +04:00
|
|
|
~nsHTMLCSSStyleSheet();
|
2009-12-31 18:56:32 +03:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2009-12-31 18:56:33 +03:00
|
|
|
// nsIStyleRuleProcessor
|
2012-09-14 20:10:08 +04: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 18:56:32 +03:00
|
|
|
#ifdef MOZ_XUL
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual void RulesMatching(XULTreeRuleProcessorData* aData) MOZ_OVERRIDE;
|
2009-12-31 18:56:32 +03:00
|
|
|
#endif
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2013-11-28 10:46:39 +04:00
|
|
|
virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2012-09-14 20:10:08 +04:00
|
|
|
virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) MOZ_OVERRIDE;
|
2010-04-01 04:43:32 +04:00
|
|
|
virtual nsRestyleHint
|
2012-09-14 20:10:08 +04:00
|
|
|
HasAttributeDependentStyle(AttributeRuleProcessorData* aData) MOZ_OVERRIDE;
|
|
|
|
virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE;
|
2013-06-23 16:03:39 +04:00
|
|
|
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
2013-03-24 06:14:43 +04:00
|
|
|
const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
|
2013-06-23 16:03:39 +04:00
|
|
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
2013-03-24 06:14:43 +04:00
|
|
|
const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
|
2009-12-31 18:56:32 +03:00
|
|
|
|
2012-09-30 20:40:24 +04:00
|
|
|
void CacheStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
|
|
|
|
void EvictStyleAttr(const nsAString& aSerialized, MiscContainer* aValue);
|
|
|
|
MiscContainer* LookupStyleAttr(const nsAString& aSerialized);
|
|
|
|
|
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:
|
2012-09-30 20:40:24 +04:00
|
|
|
nsDataHashtable<nsStringHashKey, MiscContainer*> mCachedStyleAttrs;
|
2009-12-31 18:56:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !defined(nsHTMLCSSStyleSheet_h_) */
|