зеркало из https://github.com/mozilla/pjs.git
Allow null media query cache key in some places. (Bug 542058, patch 2) r=bzbarsky
This commit is contained in:
Родитель
e96d9c92da
Коммит
ffc5ced2fc
|
@ -888,7 +888,7 @@ MediaRule::UseForPresentation(nsPresContext* aPresContext,
|
|||
nsMediaQueryResultCacheKey& aKey)
|
||||
{
|
||||
if (mMedia) {
|
||||
return mMedia->Matches(aPresContext, aKey);
|
||||
return mMedia->Matches(aPresContext, &aKey);
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ nsMediaQuery::Clone() const
|
|||
|
||||
PRBool
|
||||
nsMediaQuery::Matches(nsPresContext* aPresContext,
|
||||
nsMediaQueryResultCacheKey& aKey) const
|
||||
nsMediaQueryResultCacheKey* aKey) const
|
||||
{
|
||||
if (mHadUnknownExpression)
|
||||
return PR_FALSE;
|
||||
|
@ -520,7 +520,9 @@ nsMediaQuery::Matches(nsPresContext* aPresContext,
|
|||
NS_ENSURE_SUCCESS(rv, PR_FALSE); // any better ideas?
|
||||
|
||||
match = expr.Matches(aPresContext, actual);
|
||||
aKey.AddExpression(&expr, match);
|
||||
if (aKey) {
|
||||
aKey->AddExpression(&expr, match);
|
||||
}
|
||||
}
|
||||
|
||||
return match == !mNegated;
|
||||
|
@ -591,7 +593,7 @@ nsMediaList::SetText(const nsAString& aMediaText)
|
|||
|
||||
PRBool
|
||||
nsMediaList::Matches(nsPresContext* aPresContext,
|
||||
nsMediaQueryResultCacheKey& aKey)
|
||||
nsMediaQueryResultCacheKey* aKey)
|
||||
{
|
||||
for (PRInt32 i = 0, i_end = mArray.Length(); i < i_end; ++i) {
|
||||
if (mArray[i]->Matches(aPresContext, aKey)) {
|
||||
|
@ -1163,7 +1165,7 @@ nsCSSStyleSheet::UseForPresentation(nsPresContext* aPresContext,
|
|||
nsMediaQueryResultCacheKey& aKey) const
|
||||
{
|
||||
if (mMedia) {
|
||||
return mMedia->Matches(aPresContext, aKey);
|
||||
return mMedia->Matches(aPresContext, &aKey);
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -162,8 +162,9 @@ public:
|
|||
nsMediaQuery* Clone() const;
|
||||
|
||||
// Does this query apply to the presentation?
|
||||
// If |aKey| is non-null, add cache information to it.
|
||||
PRBool Matches(nsPresContext* aPresContext,
|
||||
nsMediaQueryResultCacheKey& aKey) const;
|
||||
nsMediaQueryResultCacheKey* aKey) const;
|
||||
|
||||
private:
|
||||
PRPackedBool mNegated;
|
||||
|
@ -184,8 +185,12 @@ public:
|
|||
|
||||
nsresult GetText(nsAString& aMediaText);
|
||||
nsresult SetText(const nsAString& aMediaText);
|
||||
|
||||
// Does this query apply to the presentation?
|
||||
// If |aKey| is non-null, add cache information to it.
|
||||
PRBool Matches(nsPresContext* aPresContext,
|
||||
nsMediaQueryResultCacheKey& aKey);
|
||||
nsMediaQueryResultCacheKey* aKey);
|
||||
|
||||
nsresult SetStyleSheet(nsCSSStyleSheet* aSheet);
|
||||
nsresult AppendQuery(nsAutoPtr<nsMediaQuery>& aQuery) {
|
||||
// Takes ownership of aQuery (if it succeeds)
|
||||
|
|
Загрузка…
Ссылка в новой задаче