OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> |
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 frame()->view()->setPaintBehavior(oldBehavior); | 227 frame()->view()->setPaintBehavior(oldBehavior); |
228 return false; | 228 return false; |
229 } | 229 } |
230 RenderStyle* style = renderer->style(); | 230 RenderStyle* style = renderer->style(); |
231 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 231 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
232 continue; | 232 continue; |
233 | 233 |
234 WindRule newClipRule = style->svgStyle()->clipRule(); | 234 WindRule newClipRule = style->svgStyle()->clipRule(); |
235 bool isUseElement = childNode->hasTagName(SVGNames::useTag); | 235 bool isUseElement = childNode->hasTagName(SVGNames::useTag); |
236 if (isUseElement) { | 236 if (isUseElement) { |
237 SVGUseElement* useElement = static_cast<SVGUseElement*>(childNode); | 237 SVGUseElement* useElement = toSVGUseElement(childNode); |
238 renderer = useElement->rendererClipChild(); | 238 renderer = useElement->rendererClipChild(); |
239 if (!renderer) | 239 if (!renderer) |
240 continue; | 240 continue; |
241 if (!useElement->hasAttribute(SVGNames::clip_ruleAttr)) | 241 if (!useElement->hasAttribute(SVGNames::clip_ruleAttr)) |
242 newClipRule = renderer->style()->svgStyle()->clipRule(); | 242 newClipRule = renderer->style()->svgStyle()->clipRule(); |
243 } | 243 } |
244 | 244 |
245 // Only shapes, paths and texts are allowed for clipping. | 245 // Only shapes, paths and texts are allowed for clipping. |
246 if (!renderer->isSVGShape() && !renderer->isSVGText()) | 246 if (!renderer->isSVGShape() && !renderer->isSVGText()) |
247 continue; | 247 continue; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 AffineTransform transform; | 320 AffineTransform transform; |
321 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 321 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
322 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 322 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
323 return transform.mapRect(m_clipBoundaries); | 323 return transform.mapRect(m_clipBoundaries); |
324 } | 324 } |
325 | 325 |
326 return m_clipBoundaries; | 326 return m_clipBoundaries; |
327 } | 327 } |
328 | 328 |
329 } | 329 } |
OLD | NEW |