本文整理汇总了C++中StyleDifference::hasDifference方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleDifference::hasDifference方法的具体用法?C++ StyleDifference::hasDifference怎么用?C++ StyleDifference::hasDifference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleDifference
的用法示例。
在下文中一共展示了StyleDifference::hasDifference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: styleDidChange
void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderObject::styleDidChange(diff, oldStyle);
if (!diff.hasDifference())
return;
// <stop> elements should only be allowed to make renderers under gradient elements
// but I can imagine a few cases we might not be catching, so let's not crash if our parent isn't a gradient.
SVGGradientElement* gradient = gradientElement();
if (!gradient)
return;
RenderObject* renderer = gradient->renderer();
if (!renderer)
return;
RenderSVGResourceContainer* container = toRenderSVGResourceContainer(renderer);
container->removeAllClientsFromCache();
}
示例2: clientStyleChanged
void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, StyleDifference diff, const ComputedStyle& newStyle)
{
ASSERT(layoutObject);
ASSERT(layoutObject->node());
ASSERT(layoutObject->node()->isSVGElement());
if (!diff.hasDifference() || !layoutObject->parent())
return;
// In this case the proper SVGFE*Element will decide whether the modified CSS properties require a relayout or paintInvalidation.
if (layoutObject->isSVGResourceFilterPrimitive() && !diff.needsLayout())
return;
// Dynamic changes of CSS properties like 'clip-path' may require us to recompute the associated resources for a layoutObject.
// FIXME: Avoid passing in a useless StyleDifference, but instead compare oldStyle/newStyle to see which resources changed
// to be able to selectively rebuild individual resources, instead of all of them.
if (layoutObjectCanHaveResources(layoutObject)) {
SVGResourcesCache* cache = resourcesCacheFromLayoutObject(layoutObject);
cache->removeResourcesFromLayoutObject(layoutObject);
cache->addResourcesFromLayoutObject(layoutObject, newStyle);
}
LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(layoutObject, false);
}