mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1089417 patch 5 - Add method to save the current media query result cache key from a rule processor. r=heycam
This is needed for patch 7.
This commit is contained in:
parent
cc6a4c1bb2
commit
fccbbb258f
@ -2925,6 +2925,17 @@ nsCSSRuleProcessor::MediumFeaturesChanged(nsPresContext* aPresContext)
|
||||
return (old != mRuleCascades);
|
||||
}
|
||||
|
||||
UniquePtr<nsMediaQueryResultCacheKey>
|
||||
nsCSSRuleProcessor::CloneMQCacheKey()
|
||||
{
|
||||
RuleCascadeData* c = mRuleCascades;
|
||||
if (!c || !c->mCacheKey.HasFeatureConditions()) {
|
||||
return UniquePtr<nsMediaQueryResultCacheKey>();
|
||||
}
|
||||
|
||||
return MakeUnique<nsMediaQueryResultCacheKey>(c->mCacheKey);
|
||||
}
|
||||
|
||||
/* virtual */ size_t
|
||||
nsCSSRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
struct CascadeEnumData;
|
||||
struct nsCSSSelector;
|
||||
@ -120,6 +121,12 @@ public:
|
||||
|
||||
virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* If this rule processor currently has a substantive media query
|
||||
* result cache key, return a copy of it.
|
||||
*/
|
||||
mozilla::UniquePtr<nsMediaQueryResultCacheKey> CloneMQCacheKey();
|
||||
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf)
|
||||
const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
|
||||
|
@ -82,6 +82,9 @@ public:
|
||||
void AddExpression(const nsMediaExpression* aExpression,
|
||||
bool aExpressionMatches);
|
||||
bool Matches(nsPresContext* aPresContext) const;
|
||||
bool HasFeatureConditions() const {
|
||||
return !mFeatureCache.IsEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* An operator== that implements list equality, which isn't quite as
|
||||
|
Loading…
Reference in New Issue
Block a user