| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/layout/svg/LayoutSVGModelObject.h" | 31 #include "core/layout/svg/LayoutSVGModelObject.h" |
| 32 | 32 |
| 33 #include "core/layout/LayoutView.h" | 33 #include "core/layout/LayoutView.h" |
| 34 #include "core/layout/svg/LayoutSVGContainer.h" | 34 #include "core/layout/svg/LayoutSVGContainer.h" |
| 35 #include "core/layout/svg/LayoutSVGRoot.h" | 35 #include "core/layout/svg/LayoutSVGRoot.h" |
| 36 #include "core/layout/svg/SVGLayoutSupport.h" | 36 #include "core/layout/svg/SVGLayoutSupport.h" |
| 37 #include "core/layout/svg/SVGResourcesCache.h" | 37 #include "core/layout/svg/SVGResourcesCache.h" |
| 38 #include "core/paint/PaintLayer.h" | 38 #include "core/paint/PaintLayer.h" |
| 39 #include "core/paint/SVGModelObjectPaintInvalidator.h" | |
| 40 #include "core/svg/SVGGraphicsElement.h" | 39 #include "core/svg/SVGGraphicsElement.h" |
| 41 | 40 |
| 42 namespace blink { | 41 namespace blink { |
| 43 | 42 |
| 44 LayoutSVGModelObject::LayoutSVGModelObject(SVGElement* node) | 43 LayoutSVGModelObject::LayoutSVGModelObject(SVGElement* node) |
| 45 : LayoutObject(node) {} | 44 : LayoutObject(node) {} |
| 46 | 45 |
| 47 bool LayoutSVGModelObject::isChildAllowed(LayoutObject* child, | 46 bool LayoutSVGModelObject::isChildAllowed(LayoutObject* child, |
| 48 const ComputedStyle&) const { | 47 const ComputedStyle&) const { |
| 49 return child->isSVG() && | 48 return child->isSVG() && |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 90 |
| 92 FloatRect LayoutSVGModelObject::localBoundingBoxRectForAccessibility() const { | 91 FloatRect LayoutSVGModelObject::localBoundingBoxRectForAccessibility() const { |
| 93 return strokeBoundingBox(); | 92 return strokeBoundingBox(); |
| 94 } | 93 } |
| 95 | 94 |
| 96 void LayoutSVGModelObject::willBeDestroyed() { | 95 void LayoutSVGModelObject::willBeDestroyed() { |
| 97 SVGResourcesCache::clientDestroyed(this); | 96 SVGResourcesCache::clientDestroyed(this); |
| 98 LayoutObject::willBeDestroyed(); | 97 LayoutObject::willBeDestroyed(); |
| 99 } | 98 } |
| 100 | 99 |
| 101 PaintInvalidationReason LayoutSVGModelObject::invalidatePaintIfNeeded( | |
| 102 const PaintInvalidatorContext& context) const { | |
| 103 return SVGModelObjectPaintInvalidator(*this, context) | |
| 104 .invalidatePaintIfNeeded(); | |
| 105 } | |
| 106 | |
| 107 void LayoutSVGModelObject::computeLayerHitTestRects( | 100 void LayoutSVGModelObject::computeLayerHitTestRects( |
| 108 LayerHitTestRects& rects) const { | 101 LayerHitTestRects& rects) const { |
| 109 // Using just the rect for the SVGRoot is good enough for now. | 102 // Using just the rect for the SVGRoot is good enough for now. |
| 110 SVGLayoutSupport::findTreeRootObject(this)->computeLayerHitTestRects(rects); | 103 SVGLayoutSupport::findTreeRootObject(this)->computeLayerHitTestRects(rects); |
| 111 } | 104 } |
| 112 | 105 |
| 113 void LayoutSVGModelObject::addLayerHitTestRects( | 106 void LayoutSVGModelObject::addLayerHitTestRects( |
| 114 LayerHitTestRects&, | 107 LayerHitTestRects&, |
| 115 const PaintLayer* currentLayer, | 108 const PaintLayer* currentLayer, |
| 116 const LayoutPoint& layerOffset, | 109 const LayoutPoint& layerOffset, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // The SVG addOutlineRects() method adds rects in local coordinates so the | 143 // The SVG addOutlineRects() method adds rects in local coordinates so the |
| 151 // default absoluteElementBoundingBoxRect() returns incorrect values for SVG | 144 // default absoluteElementBoundingBoxRect() returns incorrect values for SVG |
| 152 // objects. Overriding this method provides access to the absolute bounds. | 145 // objects. Overriding this method provides access to the absolute bounds. |
| 153 IntRect LayoutSVGModelObject::absoluteElementBoundingBoxRect() const { | 146 IntRect LayoutSVGModelObject::absoluteElementBoundingBoxRect() const { |
| 154 return localToAbsoluteQuad( | 147 return localToAbsoluteQuad( |
| 155 FloatQuad(paintInvalidationRectInLocalSVGCoordinates())) | 148 FloatQuad(paintInvalidationRectInLocalSVGCoordinates())) |
| 156 .enclosingBoundingBox(); | 149 .enclosingBoundingBox(); |
| 157 } | 150 } |
| 158 | 151 |
| 159 } // namespace blink | 152 } // namespace blink |
| OLD | NEW |