diff options
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGGradientStop.h')
-rw-r--r-- | Source/WebCore/rendering/svg/RenderSVGGradientStop.h | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h index 9428bb85a..46ba3d33d 100644 --- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h +++ b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2007 Eric Seidel <eric@webkit.org> * Copyright (C) 2009 Google, Inc. + * Copyright (C) 2014 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -18,50 +19,46 @@ * Boston, MA 02110-1301, USA. */ -#ifndef RenderSVGGradientStop_h -#define RenderSVGGradientStop_h +#pragma once -#if ENABLE(SVG) #include "RenderElement.h" +#include "SVGStopElement.h" namespace WebCore { class SVGGradientElement; -class SVGStopElement; // This class exists mostly so we can hear about gradient stop style changes class RenderSVGGradientStop final : public RenderElement { public: - RenderSVGGradientStop(SVGStopElement&, PassRef<RenderStyle>); + RenderSVGGradientStop(SVGStopElement&, RenderStyle&&); virtual ~RenderSVGGradientStop(); - virtual bool isSVGGradientStop() const { return true; } - virtual const char* renderName() const { return "RenderSVGGradientStop"; } + SVGStopElement& element() const { return downcast<SVGStopElement>(RenderObject::nodeForNonAnonymous()); } - virtual void layout(); +private: + void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; + + void layout() override; - // This overrides are needed to prevent ASSERTs on <svg><stop /></svg> + // These overrides are needed to prevent ASSERTs on <svg><stop /></svg> // RenderObject's default implementations ASSERT_NOT_REACHED() // https://bugs.webkit.org/show_bug.cgi?id=20400 - virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); } - virtual FloatRect objectBoundingBox() const { return FloatRect(); } - virtual FloatRect strokeBoundingBox() const { return FloatRect(); } - virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); } - virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&, HitTestAction) override { return false; } + LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); } + FloatRect objectBoundingBox() const override { return FloatRect(); } + FloatRect strokeBoundingBox() const override { return FloatRect(); } + FloatRect repaintRectInLocalCoordinates() const override { return FloatRect(); } + bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&, HitTestAction) override { return false; } -protected: - virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); + bool isSVGGradientStop() const override { return true; } + const char* renderName() const override { return "RenderSVGGradientStop"; } -private: - virtual bool canHaveChildren() const override { return false; } - virtual void paint(PaintInfo&, const LayoutPoint&) override final { } + bool canHaveChildren() const override { return false; } + void paint(PaintInfo&, const LayoutPoint&) override { } - SVGGradientElement* gradientElement() const; + SVGGradientElement* gradientElement(); }; -RENDER_OBJECT_TYPE_CASTS(RenderSVGGradientStop, isSVGGradientStop()) - -} +} // namespace WebCore -#endif // ENABLE(SVG) -#endif // RenderSVGGradientStop_h +SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGGradientStop, isSVGGradientStop()) |