2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2009 Google, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef LayoutSVGGradientStop_h
22 #define LayoutSVGGradientStop_h
24 #include "core/layout/LayoutObject.h"
28 class SVGGradientElement
;
31 // This class exists mostly so we can hear about gradient stop style changes
32 class LayoutSVGGradientStop final
: public LayoutObject
{
34 explicit LayoutSVGGradientStop(SVGStopElement
*);
35 ~LayoutSVGGradientStop() override
;
37 const char* name() const override
{ return "LayoutSVGGradientStop"; }
38 bool isOfType(LayoutObjectType type
) const override
{ return type
== LayoutObjectSVG
|| type
== LayoutObjectSVGGradientStop
|| LayoutObject::isOfType(type
); }
40 void layout() override
;
42 // This overrides are needed to prevent ASSERTs on <svg><stop /></svg>
43 // LayoutObject's default implementations ASSERT_NOT_REACHED()
44 // https://bugs.webkit.org/show_bug.cgi?id=20400
45 LayoutRect
clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject
*, const PaintInvalidationState
* = nullptr) const override
{ return LayoutRect(); }
46 FloatRect
objectBoundingBox() const override
{ return FloatRect(); }
47 FloatRect
strokeBoundingBox() const override
{ return FloatRect(); }
48 FloatRect
paintInvalidationRectInLocalCoordinates() const override
{ return FloatRect(); }
51 void styleDidChange(StyleDifference
, const ComputedStyle
* oldStyle
) override
;
54 SVGGradientElement
* gradientElement() const;
57 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGGradientStop
, isSVGGradientStop());
61 #endif // LayoutSVGGradientStop_h