OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 m_imageResource->shutdown(); | 57 m_imageResource->shutdown(); |
58 } | 58 } |
59 | 59 |
60 bool RenderSVGImage::updateImageViewport() | 60 bool RenderSVGImage::updateImageViewport() |
61 { | 61 { |
62 SVGImageElement* image = toSVGImageElement(element()); | 62 SVGImageElement* image = toSVGImageElement(element()); |
63 FloatRect oldBoundaries = m_objectBoundingBox; | 63 FloatRect oldBoundaries = m_objectBoundingBox; |
64 bool updatedViewport = false; | 64 bool updatedViewport = false; |
65 | 65 |
66 SVGLengthContext lengthContext(image); | 66 SVGLengthContext lengthContext(image); |
67 m_objectBoundingBox = FloatRect(image->xCurrentValue().value(lengthContext),
image->yCurrentValue().value(lengthContext), image->widthCurrentValue().value(l
engthContext), image->heightCurrentValue().value(lengthContext)); | 67 m_objectBoundingBox = FloatRect(image->x()->currentValue()->value(lengthCont
ext), image->y()->currentValue()->value(lengthContext), image->width()->currentV
alue()->value(lengthContext), image->height()->currentValue()->value(lengthConte
xt)); |
68 | 68 |
69 // Images with preserveAspectRatio=none should force non-uniform scaling. Th
is can be achieved | 69 // Images with preserveAspectRatio=none should force non-uniform scaling. Th
is can be achieved |
70 // by setting the image's container size to its intrinsic size. | 70 // by setting the image's container size to its intrinsic size. |
71 // See: http://www.w3.org/TR/SVG/single-page.html, 7.8 The ‘preserveAspectRa
tio’ attribute. | 71 // See: http://www.w3.org/TR/SVG/single-page.html, 7.8 The ‘preserveAspectRa
tio’ attribute. |
72 if (image->preserveAspectRatioCurrentValue().align() == SVGPreserveAspectRat
io::SVG_PRESERVEASPECTRATIO_NONE) { | 72 if (image->preserveAspectRatioCurrentValue().align() == SVGPreserveAspectRat
io::SVG_PRESERVEASPECTRATIO_NONE) { |
73 if (ImageResource* cachedImage = m_imageResource->cachedImage()) { | 73 if (ImageResource* cachedImage = m_imageResource->cachedImage()) { |
74 LayoutSize intrinsicSize = cachedImage->imageSizeForRenderer(0, styl
e()->effectiveZoom()); | 74 LayoutSize intrinsicSize = cachedImage->imageSizeForRenderer(0, styl
e()->effectiveZoom()); |
75 if (intrinsicSize != m_imageResource->imageSize(style()->effectiveZo
om())) { | 75 if (intrinsicSize != m_imageResource->imageSize(style()->effectiveZo
om())) { |
76 m_imageResource->setContainerSizeForRenderer(roundedIntSize(intr
insicSize)); | 76 m_imageResource->setContainerSizeForRenderer(roundedIntSize(intr
insicSize)); |
77 updatedViewport = true; | 77 updatedViewport = true; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&, const RenderLayerModelObject*) | 224 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint
&, const RenderLayerModelObject*) |
225 { | 225 { |
226 // this is called from paint() after the localTransform has already been app
lied | 226 // this is called from paint() after the localTransform has already been app
lied |
227 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); | 227 IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates()); |
228 if (!contentRect.isEmpty()) | 228 if (!contentRect.isEmpty()) |
229 rects.append(contentRect); | 229 rects.append(contentRect); |
230 } | 230 } |
231 | 231 |
232 } // namespace WebCore | 232 } // namespace WebCore |
OLD | NEW |