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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 // will return the underlying SVGImage. | 85 // will return the underlying SVGImage. |
86 return !image->isSVGImage() || image != cachedImage.imageForRenderer(rendere r); | 86 return !image->isSVGImage() || image != cachedImage.imageForRenderer(rendere r); |
87 } | 87 } |
88 | 88 |
89 bool LayoutSVGImage::updateImageViewport() | 89 bool LayoutSVGImage::updateImageViewport() |
90 { | 90 { |
91 SVGImageElement* image = toSVGImageElement(element()); | 91 SVGImageElement* image = toSVGImageElement(element()); |
92 FloatRect oldBoundaries = m_objectBoundingBox; | 92 FloatRect oldBoundaries = m_objectBoundingBox; |
93 | 93 |
94 SVGLengthContext lengthContext(image); | 94 SVGLengthContext lengthContext(image); |
95 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)); | 95 const LayoutStyle& style = image->layoutObject()->styleRef(); |
fs
2015/03/12 14:28:48
image->layoutObject()->styleRef() => styleRef()
Erik Dahlström (inactive)
2015/03/12 16:14:56
Done.
| |
96 m_objectBoundingBox = FloatRect( | |
97 lengthContext.valueForLength(style.svgStyle().x(), style, SVGLengthMode: :Width), | |
98 lengthContext.valueForLength(style.svgStyle().y(), style, SVGLengthMode: :Height), | |
99 lengthContext.valueForLength(style.width(), style, SVGLengthMode::Width) , | |
100 lengthContext.valueForLength(style.height(), style, SVGLengthMode::Heigh t)); | |
fs
2015/03/12 14:28:48
Almost looks like
style.svgStyle().x(), style.svg
Erik Dahlström (inactive)
2015/03/12 16:14:56
np, I'll do that as a followup.
| |
96 bool boundsChanged = oldBoundaries != m_objectBoundingBox; | 101 bool boundsChanged = oldBoundaries != m_objectBoundingBox; |
97 | 102 |
98 bool updatedViewport = false; | 103 bool updatedViewport = false; |
99 ImageResource* cachedImage = m_imageResource->cachedImage(); | 104 ImageResource* cachedImage = m_imageResource->cachedImage(); |
100 if (cachedImage && cachedImage->usesImageContainerSize()) { | 105 if (cachedImage && cachedImage->usesImageContainerSize()) { |
101 FloatSize imageViewportSize = computeImageViewportSize(*cachedImage); | 106 FloatSize imageViewportSize = computeImageViewportSize(*cachedImage); |
102 if (LayoutSize(imageViewportSize) != m_imageResource->imageSize(style()- >effectiveZoom()) | 107 if (LayoutSize(imageViewportSize) != m_imageResource->imageSize(style.ef fectiveZoom()) |
103 || !containerSizeIsSetForRenderer(*cachedImage, this)) { | 108 || !containerSizeIsSetForRenderer(*cachedImage, this)) { |
104 m_imageResource->setContainerSizeForRenderer(roundedIntSize(imageVie wportSize)); | 109 m_imageResource->setContainerSizeForRenderer(roundedIntSize(imageVie wportSize)); |
105 updatedViewport = true; | 110 updatedViewport = true; |
106 } | 111 } |
107 } | 112 } |
108 | 113 |
109 m_needsBoundariesUpdate |= boundsChanged; | 114 m_needsBoundariesUpdate |= boundsChanged; |
110 return updatedViewport || boundsChanged; | 115 return updatedViewport || boundsChanged; |
111 } | 116 } |
112 | 117 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 | 198 |
194 void LayoutSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const | 199 void LayoutSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const |
195 { | 200 { |
196 // this is called from paint() after the localTransform has already been app lied | 201 // this is called from paint() after the localTransform has already been app lied |
197 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates( )); | 202 LayoutRect contentRect = LayoutRect(paintInvalidationRectInLocalCoordinates( )); |
198 if (!contentRect.isEmpty()) | 203 if (!contentRect.isEmpty()) |
199 rects.append(contentRect); | 204 rects.append(contentRect); |
200 } | 205 } |
201 | 206 |
202 } // namespace blink | 207 } // namespace blink |
OLD | NEW |