| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2009, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef RenderSVGModelObject_h | 31 #ifndef RenderSVGModelObject_h |
| 32 #define RenderSVGModelObject_h | 32 #define RenderSVGModelObject_h |
| 33 | 33 |
| 34 #include "core/rendering/RenderObject.h" | 34 #include "core/layout/LayoutObject.h" |
| 35 #include "core/svg/SVGElement.h" | 35 #include "core/svg/SVGElement.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 // Most renderers in the SVG rendering tree will inherit from this class | 39 // Most renderers in the SVG rendering tree will inherit from this class |
| 40 // but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock) thus methods | 40 // but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock) thus methods |
| 41 // required by SVG renders need to be declared on RenderObject, but shared | 41 // required by SVG renders need to be declared on LayoutObject, but shared |
| 42 // logic can go in this class or in SVGRenderSupport. | 42 // logic can go in this class or in SVGRenderSupport. |
| 43 | 43 |
| 44 class RenderSVGModelObject : public RenderObject { | 44 class RenderSVGModelObject : public LayoutObject { |
| 45 public: | 45 public: |
| 46 explicit RenderSVGModelObject(SVGElement*); | 46 explicit RenderSVGModelObject(SVGElement*); |
| 47 | 47 |
| 48 virtual bool isChildAllowed(RenderObject*, const RenderStyle&) const overrid
e; | 48 virtual bool isChildAllowed(LayoutObject*, const RenderStyle&) const overrid
e; |
| 49 | 49 |
| 50 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t override; | 50 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t override; |
| 51 | 51 |
| 52 virtual FloatRect paintInvalidationRectInLocalCoordinates() const override f
inal { return m_paintInvalidationBoundingBox; } | 52 virtual FloatRect paintInvalidationRectInLocalCoordinates() const override f
inal { return m_paintInvalidationBoundingBox; } |
| 53 | 53 |
| 54 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override final; | 54 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override final; |
| 55 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; | 55 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; |
| 56 | 56 |
| 57 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const override final; | 57 virtual void mapLocalToContainer(const LayoutLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const PaintInvalidationState* = 0) const override final; |
| 58 virtual const RenderObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const override final; | 58 virtual const LayoutObject* pushMappingToContainer(const LayoutLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const override final; |
| 59 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; | 59 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
| 60 | 60 |
| 61 virtual void computeLayerHitTestRects(LayerHitTestRects&) const override fin
al; | 61 virtual void computeLayerHitTestRects(LayerHitTestRects&) const override fin
al; |
| 62 | 62 |
| 63 SVGElement* element() const { return toSVGElement(RenderObject::node()); } | 63 SVGElement* element() const { return toSVGElement(LayoutObject::node()); } |
| 64 | 64 |
| 65 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectSVG || RenderObject::isOfType(type); } | 65 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectSVG || LayoutObject::isOfType(type); } |
| 66 | 66 |
| 67 protected: | 67 protected: |
| 68 virtual void addLayerHitTestRects(LayerHitTestRects&, const Layer* currentCo
mpositedLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect)
const override final; | 68 virtual void addLayerHitTestRects(LayerHitTestRects&, const Layer* currentCo
mpositedLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect)
const override final; |
| 69 virtual void willBeDestroyed() override; | 69 virtual void willBeDestroyed() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // RenderSVGModelObject subclasses should use element() instead. | 72 // RenderSVGModelObject subclasses should use element() instead. |
| 73 void node() const = delete; | 73 void node() const = delete; |
| 74 | 74 |
| 75 // This method should never be called, SVG uses a different nodeAtPoint meth
od | 75 // This method should never be called, SVG uses a different nodeAtPoint meth
od |
| 76 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; | 76 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; |
| 77 virtual IntRect absoluteFocusRingBoundingBoxRect() const override final; | 77 virtual IntRect absoluteFocusRingBoundingBoxRect() const override final; |
| 78 | 78 |
| 79 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override
final; | 79 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override
final; |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 FloatRect m_paintInvalidationBoundingBox; | 82 FloatRect m_paintInvalidationBoundingBox; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } | 85 } |
| 86 | 86 |
| 87 #endif | 87 #endif |
| OLD | NEW |