1 | /* |
2 | * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
3 | * Copyright (C) 2006 Apple Inc. |
4 | * |
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. |
9 | * |
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. |
14 | * |
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. |
19 | */ |
20 | |
21 | #pragma once |
22 | |
23 | #include "InlineFlowBox.h" |
24 | #include "RenderSVGInline.h" |
25 | |
26 | namespace WebCore { |
27 | |
28 | class RenderSVGInlineText; |
29 | |
30 | class SVGInlineFlowBox final : public InlineFlowBox { |
31 | WTF_MAKE_ISO_ALLOCATED(SVGInlineFlowBox); |
32 | public: |
33 | SVGInlineFlowBox(RenderSVGInline& renderer) |
34 | : InlineFlowBox(renderer) |
35 | , m_logicalHeight(0) |
36 | { |
37 | } |
38 | |
39 | RenderSVGInline& renderer() { return static_cast<RenderSVGInline&>(InlineFlowBox::renderer()); } |
40 | |
41 | FloatRect calculateBoundaries() const override; |
42 | |
43 | void setLogicalHeight(float h) { m_logicalHeight = h; } |
44 | void paintSelectionBackground(PaintInfo&); |
45 | |
46 | private: |
47 | bool isSVGInlineFlowBox() const override { return true; } |
48 | float virtualLogicalHeight() const override { return m_logicalHeight; } |
49 | void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override; |
50 | |
51 | float m_logicalHeight; |
52 | }; |
53 | |
54 | } // namespace WebCore |
55 | |
56 | SPECIALIZE_TYPE_TRAITS_INLINE_BOX(SVGInlineFlowBox, isSVGInlineFlowBox()) |
57 | |