This source file includes following definitions.
- styleDidChange
- layout
- gradientElement
#include "config.h"
#include "core/rendering/svg/RenderSVGGradientStop.h"
#include "SVGNames.h"
#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "core/svg/SVGGradientElement.h"
#include "core/svg/SVGStopElement.h"
namespace WebCore {
using namespace SVGNames;
RenderSVGGradientStop::RenderSVGGradientStop(SVGStopElement* element)
: RenderObject(element)
{
}
RenderSVGGradientStop::~RenderSVGGradientStop()
{
}
void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderObject::styleDidChange(diff, oldStyle);
if (diff == StyleDifferenceEqual)
return;
SVGGradientElement* gradient = gradientElement();
if (!gradient)
return;
RenderObject* renderer = gradient->renderer();
if (!renderer)
return;
RenderSVGResourceContainer* container = toRenderSVGResourceContainer(renderer);
container->removeAllClientsFromCache();
}
void RenderSVGGradientStop::layout()
{
clearNeedsLayout();
}
SVGGradientElement* RenderSVGGradientStop::gradientElement() const
{
ContainerNode* parentNode = node()->parentNode();
ASSERT(parentNode);
return isSVGGradientElement(*parentNode) ? toSVGGradientElement(parentNode) : 0;
}
}