2 * Copyright (C) 2006 Apple Inc.
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 RenderSVGForeignObject_h
22 #define RenderSVGForeignObject_h
24 #include "AffineTransform.h"
25 #include "FloatPoint.h"
26 #include "FloatRect.h"
27 #include "RenderSVGBlock.h"
31 class SVGForeignObjectElement;
33 class RenderSVGForeignObject final : public RenderSVGBlock {
35 RenderSVGForeignObject(SVGForeignObjectElement&, RenderStyle&&);
36 virtual ~RenderSVGForeignObject();
38 SVGForeignObjectElement& foreignObjectElement() const;
40 void paint(PaintInfo&, const LayoutPoint&) override;
42 LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
43 FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, bool fixed = false) const override;
44 LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, RepaintContext = { }) const override;
46 bool requiresLayer() const override { return false; }
47 void layout() override;
49 FloatRect objectBoundingBox() const override { return FloatRect(FloatPoint(), m_viewport.size()); }
50 FloatRect strokeBoundingBox() const override { return FloatRect(FloatPoint(), m_viewport.size()); }
51 FloatRect repaintRectInLocalCoordinates() const override { return FloatRect(FloatPoint(), m_viewport.size()); }
53 bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) override;
54 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
56 void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
57 const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
58 void setNeedsTransformUpdate() override { m_needsTransformUpdate = true; }
61 bool isSVGForeignObject() const override { return true; }
62 void graphicsElement() const = delete;
63 const char* renderName() const override { return "RenderSVGForeignObject"; }
65 void updateLogicalWidth() override;
66 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const override;
68 const AffineTransform& localToParentTransform() const override;
69 AffineTransform localTransform() const override { return m_localTransform; }
71 bool m_needsTransformUpdate : 1;
73 AffineTransform m_localTransform;
74 mutable AffineTransform m_localToParentTransform;