2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer 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 LayoutSVGInline_h
22 #define LayoutSVGInline_h
24 #include "core/layout/LayoutInline.h"
28 class LayoutSVGInline
: public LayoutInline
{
30 explicit LayoutSVGInline(Element
*);
32 const char* name() const override
{ return "LayoutSVGInline"; }
33 DeprecatedPaintLayerType
layerTypeRequired() const final
{ return NoDeprecatedPaintLayer
; }
34 bool isOfType(LayoutObjectType type
) const override
{ return type
== LayoutObjectSVG
|| type
== LayoutObjectSVGInline
|| LayoutInline::isOfType(type
); }
36 bool isChildAllowed(LayoutObject
*, const ComputedStyle
&) const override
;
38 // Chapter 10.4 of the SVG Specification say that we should use the
39 // object bounding box of the parent text element.
40 // We search for the root text element and take its bounding box.
41 // It is also necessary to take the stroke and paint invalidation rect of
42 // this element, since we need it for filters.
43 FloatRect
objectBoundingBox() const final
;
44 FloatRect
strokeBoundingBox() const final
;
45 FloatRect
paintInvalidationRectInLocalCoordinates() const final
;
47 LayoutRect
clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject
* paintInvalidationContainer
, const PaintInvalidationState
* = nullptr) const final
;
48 void mapLocalToContainer(const LayoutBoxModelObject
* paintInvalidationContainer
, TransformState
&, MapCoordinatesFlags
= ApplyContainerFlip
, bool* wasFixed
= nullptr, const PaintInvalidationState
* = nullptr) const final
;
49 const LayoutObject
* pushMappingToContainer(const LayoutBoxModelObject
* ancestorToStopAt
, LayoutGeometryMap
&) const final
;
50 void absoluteQuads(Vector
<FloatQuad
>&, bool* wasFixed
) const final
;
53 InlineFlowBox
* createInlineFlowBox() final
;
55 void invalidateTreeIfNeeded(PaintInvalidationState
&) final
;
57 void willBeDestroyed() final
;
58 void styleDidChange(StyleDifference
, const ComputedStyle
* oldStyle
) final
;
60 void addChild(LayoutObject
* child
, LayoutObject
* beforeChild
= nullptr) final
;
61 void removeChild(LayoutObject
*) final
;
64 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInline
, isSVGInline());
68 #endif // LayoutSVGInline_H