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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 ImageQualityController::remove(*this); | 59 ImageQualityController::remove(*this); |
60 m_imageResource->shutdown(); | 60 m_imageResource->shutdown(); |
61 LayoutSVGModelObject::willBeDestroyed(); | 61 LayoutSVGModelObject::willBeDestroyed(); |
62 } | 62 } |
63 | 63 |
64 void LayoutSVGImage::updateBoundingBox() | 64 void LayoutSVGImage::updateBoundingBox() |
65 { | 65 { |
66 FloatRect oldBoundaries = m_objectBoundingBox; | 66 FloatRect oldBoundaries = m_objectBoundingBox; |
67 | 67 |
68 SVGLengthContext lengthContext(element()); | 68 SVGLengthContext lengthContext(element()); |
69 SVGImageElement* image = toSVGImageElement(element()); | |
69 m_objectBoundingBox = FloatRect( | 70 m_objectBoundingBox = FloatRect( |
70 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width), | 71 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width), |
71 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height), | 72 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height), |
72 lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMo de::Width), | 73 styleRef().width().isAuto() ? image->width()->currentValue()->value(leng thContext) : lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLen gthMode::Width), |
fs
2016/08/10 18:01:34
No, this is not what should happen. To quote the r
Shanmuga Pandi
2016/08/11 05:54:20
Thank you fs@ for explaining in detail.
Done the c
| |
73 lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthM ode::Height)); | 74 styleRef().height().isAuto() ? image->height()->currentValue()->value(le ngthContext) : lengthContext.valueForLength(styleRef().height(), styleRef(), SVG LengthMode::Height)); |
74 m_needsBoundariesUpdate |= oldBoundaries != m_objectBoundingBox; | 75 m_needsBoundariesUpdate |= oldBoundaries != m_objectBoundingBox; |
75 } | 76 } |
76 | 77 |
77 void LayoutSVGImage::layout() | 78 void LayoutSVGImage::layout() |
78 { | 79 { |
79 ASSERT(needsLayout()); | 80 ASSERT(needsLayout()); |
80 LayoutAnalyzer::Scope analyzer(*this); | 81 LayoutAnalyzer::Scope analyzer(*this); |
81 | 82 |
82 // Invalidate all resources of this client if our layout changed. | 83 // Invalidate all resources of this client if our layout changed. |
83 if (everHadLayout() && selfNeedsLayout()) | 84 if (everHadLayout() && selfNeedsLayout()) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 setShouldDoFullPaintInvalidation(); | 150 setShouldDoFullPaintInvalidation(); |
150 } | 151 } |
151 | 152 |
152 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoin t&, IncludeBlockVisualOverflowOrNot) const | 153 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoin t&, IncludeBlockVisualOverflowOrNot) const |
153 { | 154 { |
154 // this is called from paint() after the localTransform has already been app lied | 155 // this is called from paint() after the localTransform has already been app lied |
155 rects.append(LayoutRect(paintInvalidationRectInLocalSVGCoordinates())); | 156 rects.append(LayoutRect(paintInvalidationRectInLocalSVGCoordinates())); |
156 } | 157 } |
157 | 158 |
158 } // namespace blink | 159 } // namespace blink |
OLD | NEW |