OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 ASSERT(client); | 45 ASSERT(client); |
46 m_gradientMap.erase(client); | 46 m_gradientMap.erase(client); |
47 markClientForInvalidation( | 47 markClientForInvalidation( |
48 client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation); | 48 client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation); |
49 } | 49 } |
50 | 50 |
51 SVGPaintServer LayoutSVGResourceGradient::preparePaintServer( | 51 SVGPaintServer LayoutSVGResourceGradient::preparePaintServer( |
52 const LayoutObject& object) { | 52 const LayoutObject& object) { |
53 clearInvalidationMask(); | 53 clearInvalidationMask(); |
54 | 54 |
55 // Be sure to synchronize all SVG properties on the gradientElement _before_ | |
pdr.
2017/03/13 18:36:31
Do we have a comment describing the current system
fs
2017/03/13 18:44:47
That's a good question, I suspect there is none...
fs
2017/03/13 19:54:45
Kept the new comment in the same place. Added a si
| |
56 // processing any further. Otherwhise the call to collectGradientAttributes() | |
57 // in createTileImage(), may cause the SVG DOM property synchronization to | |
58 // kick in, which causes removeAllClientsFromCache() to be called, which in | |
59 // turn deletes our GradientData object! Leaving out the line below will cause | |
60 // svg/dynamic-updates/SVG*GradientElement-svgdom* to crash. | |
61 SVGGradientElement* gradientElement = toSVGGradientElement(element()); | |
62 if (!gradientElement) | |
63 return SVGPaintServer::invalid(); | |
64 | |
65 if (m_shouldCollectGradientAttributes) { | 55 if (m_shouldCollectGradientAttributes) { |
66 gradientElement->synchronizeAnimatedSVGAttribute(anyQName()); | 56 if (!collectGradientAttributes()) |
67 if (!collectGradientAttributes(gradientElement)) | |
68 return SVGPaintServer::invalid(); | 57 return SVGPaintServer::invalid(); |
69 | |
70 m_shouldCollectGradientAttributes = false; | 58 m_shouldCollectGradientAttributes = false; |
71 } | 59 } |
72 | 60 |
73 // Spec: When the geometry of the applicable element has no width or height | 61 // Spec: When the geometry of the applicable element has no width or height |
74 // and objectBoundingBox is specified, then the given effect (e.g. a gradient | 62 // and objectBoundingBox is specified, then the given effect (e.g. a gradient |
75 // or a filter) will be ignored. | 63 // or a filter) will be ignored. |
76 FloatRect objectBoundingBox = object.objectBoundingBox(); | 64 FloatRect objectBoundingBox = object.objectBoundingBox(); |
77 if (gradientUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox && | 65 if (gradientUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox && |
78 objectBoundingBox.isEmpty()) | 66 objectBoundingBox.isEmpty()) |
79 return SVGPaintServer::invalid(); | 67 return SVGPaintServer::invalid(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 return SpreadMethodReflect; | 124 return SpreadMethodReflect; |
137 case SVGSpreadMethodRepeat: | 125 case SVGSpreadMethodRepeat: |
138 return SpreadMethodRepeat; | 126 return SpreadMethodRepeat; |
139 } | 127 } |
140 | 128 |
141 ASSERT_NOT_REACHED(); | 129 ASSERT_NOT_REACHED(); |
142 return SpreadMethodPad; | 130 return SpreadMethodPad; |
143 } | 131 } |
144 | 132 |
145 } // namespace blink | 133 } // namespace blink |
OLD | NEW |