summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg/RenderSVGRoot.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGRoot.h')
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGRoot.h76
1 files changed, 37 insertions, 39 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.h b/Source/WebCore/rendering/svg/RenderSVGRoot.h
index edebf1cf8..ecff184fa 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.h
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.h
@@ -20,23 +20,21 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef RenderSVGRoot_h
-#define RenderSVGRoot_h
+#pragma once
-#if ENABLE(SVG)
#include "FloatRect.h"
#include "RenderReplaced.h"
-
#include "SVGRenderSupport.h"
namespace WebCore {
class AffineTransform;
+class RenderSVGResourceContainer;
class SVGSVGElement;
class RenderSVGRoot final : public RenderReplaced {
public:
- RenderSVGRoot(SVGSVGElement&, PassRef<RenderStyle>);
+ RenderSVGRoot(SVGSVGElement&, RenderStyle&&);
virtual ~RenderSVGRoot();
SVGSVGElement& svgSVGElement() const;
@@ -44,19 +42,17 @@ public:
bool isEmbeddedThroughSVGImage() const;
bool isEmbeddedThroughFrameContainingSVGDocument() const;
- virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const override;
+ void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const override;
bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
- virtual void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransformUpdate = true; }
- virtual bool needsBoundariesUpdate() override { return m_needsBoundariesOrTransformUpdate; }
- virtual void setNeedsTransformUpdate() override { m_needsBoundariesOrTransformUpdate = true; }
+ void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransformUpdate = true; }
+ bool needsBoundariesUpdate() override { return m_needsBoundariesOrTransformUpdate; }
+ void setNeedsTransformUpdate() override { m_needsBoundariesOrTransformUpdate = true; }
IntSize containerSize() const { return m_containerSize; }
void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; }
- virtual bool hasRelativeDimensions() const override;
- virtual bool hasRelativeIntrinsicLogicalWidth() const override;
- virtual bool hasRelativeLogicalHeight() const override;
+ bool hasRelativeDimensions() const override;
// localToBorderBoxTransform maps local SVG viewport coordinates to local CSS box coordinates.
const AffineTransform& localToBorderBoxTransform() const { return m_localToBorderBoxTransform; }
@@ -71,40 +67,45 @@ public:
private:
void element() const = delete;
- virtual bool isSVGRoot() const override { return true; }
- virtual const char* renderName() const override { return "RenderSVGRoot"; }
+ bool isSVGRoot() const override { return true; }
+ const char* renderName() const override { return "RenderSVGRoot"; }
+
+ LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const override;
+ LayoutUnit computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth = std::nullopt) const override;
+ void layout() override;
+ void paintReplaced(PaintInfo&, const LayoutPoint&) override;
- virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const override;
- virtual LayoutUnit computeReplacedLogicalHeight() const override;
- virtual void layout() override;
- virtual void paintReplaced(PaintInfo&, const LayoutPoint&) override;
+ void willBeDestroyed() override;
- virtual void willBeDestroyed() override;
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
- virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
- virtual void removeChild(RenderObject&) override;
+ void insertedIntoTree() override;
+ void willBeRemovedFromTree() override;
- virtual const AffineTransform& localToParentTransform() const override;
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
+ void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
+ void removeChild(RenderObject&) override;
+
+ const AffineTransform& localToParentTransform() const override;
bool fillContains(const FloatPoint&) const;
bool strokeContains(const FloatPoint&) const;
- virtual FloatRect objectBoundingBox() const override { return m_objectBoundingBox; }
- virtual FloatRect strokeBoundingBox() const override { return m_strokeBoundingBox; }
- virtual FloatRect repaintRectInLocalCoordinates() const override { return m_repaintBoundingBox; }
- virtual FloatRect repaintRectInLocalCoordinatesExcludingSVGShadow() const { return m_repaintBoundingBoxExcludingShadow; }
+ FloatRect objectBoundingBox() const override { return m_objectBoundingBox; }
+ FloatRect strokeBoundingBox() const override { return m_strokeBoundingBox; }
+ FloatRect repaintRectInLocalCoordinates() const override { return m_repaintBoundingBox; }
+ FloatRect repaintRectInLocalCoordinatesExcludingSVGShadow() const { return m_repaintBoundingBoxExcludingShadow; }
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
+ bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
- virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
- virtual void computeFloatRectForRepaint(const RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed) const override;
+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
+ FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, bool fixed) const override;
- virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const override;
- virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
+ void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
+ const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
- virtual bool canBeSelectionLeaf() const override { return false; }
- virtual bool canHaveChildren() const override { return true; }
+ bool canBeSelectionLeaf() const override { return false; }
+ bool canHaveChildren() const override { return true; }
+ bool shouldApplyViewportClip() const;
void updateCachedBoundaries();
void buildLocalToBorderBoxTransform();
@@ -120,12 +121,9 @@ private:
bool m_isLayoutSizeChanged : 1;
bool m_needsBoundariesOrTransformUpdate : 1;
bool m_hasSVGShadow : 1;
+ bool m_hasBoxDecorations : 1;
};
-template<> inline bool isRendererOfType<const RenderSVGRoot>(const RenderObject& renderer) { return renderer.isSVGRoot(); }
-RENDER_OBJECT_TYPE_CASTS(RenderSVGRoot, isSVGRoot())
-
} // namespace WebCore
-#endif // ENABLE(SVG)
-#endif // RenderSVGRoot_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGRoot, isSVGRoot())