本文整理汇总了C++中nsRefPtrHashtable类的典型用法代码示例。如果您正苦于以下问题:C++ nsRefPtrHashtable类的具体用法?C++ nsRefPtrHashtable怎么用?C++ nsRefPtrHashtable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了nsRefPtrHashtable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ResolveStyleByAddingRules
nsStyleContext*
ResolvedStyleCache::Get(nsPresContext *aPresContext,
nsStyleContext *aParentStyleContext,
Declaration* aKeyframeDeclaration)
{
// FIXME (spec): The css3-animations spec isn't very clear about how
// properties are resolved when they have values that depend on other
// properties (e.g., values in 'em'). I presume that they're resolved
// relative to the other styles of the element. The question is
// whether they are resolved relative to other animations: I assume
// that they're not, since that would prevent us from caching a lot of
// data that we'd really like to cache (in particular, the
// StyleAnimationValue values in AnimationPropertySegment).
nsStyleContext *result = mCache.GetWeak(aKeyframeDeclaration);
if (!result) {
aKeyframeDeclaration->SetImmutable();
// The spec says that !important declarations should just be ignored
MOZ_ASSERT(!aKeyframeDeclaration->HasImportantData(),
"Keyframe rule has !important data");
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(aKeyframeDeclaration);
RefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->
ResolveStyleByAddingRules(aParentStyleContext, rules);
mCache.Put(aKeyframeDeclaration, resultStrong);
result = resultStrong;
}
return result;
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:29,代码来源:nsAnimationManager.cpp
示例2: ResolveStyleByAddingRules
nsStyleContext*
ResolvedStyleCache::Get(nsPresContext *aPresContext,
nsStyleContext *aParentStyleContext,
nsCSSKeyframeRule *aKeyframe)
{
// FIXME (spec): The css3-animations spec isn't very clear about how
// properties are resolved when they have values that depend on other
// properties (e.g., values in 'em'). I presume that they're resolved
// relative to the other styles of the element. The question is
// whether they are resolved relative to other animations: I assume
// that they're not, since that would prevent us from caching a lot of
// data that we'd really like to cache (in particular, the
// nsStyleAnimation::Value values in AnimationPropertySegment).
nsStyleContext *result = mCache.GetWeak(aKeyframe);
if (!result) {
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(aKeyframe);
nsRefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->
ResolveStyleByAddingRules(aParentStyleContext, rules);
mCache.Put(aKeyframe, resultStrong);
result = resultStrong;
}
return result;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:24,代码来源:nsAnimationManager.cpp
注:本文中的nsRefPtrHashtable类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论