| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
| 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/rendering/HitTestResult.h" | 33 #include "core/rendering/HitTestResult.h" |
| 34 #include "core/rendering/LayoutRepainter.h" | 34 #include "core/rendering/LayoutRepainter.h" |
| 35 #include "core/rendering/RenderPart.h" | 35 #include "core/rendering/RenderPart.h" |
| 36 #include "core/rendering/RenderView.h" | 36 #include "core/rendering/RenderView.h" |
| 37 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 37 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
| 38 #include "core/rendering/svg/SVGRenderingContext.h" | 38 #include "core/rendering/svg/SVGRenderingContext.h" |
| 39 #include "core/rendering/svg/SVGResources.h" | 39 #include "core/rendering/svg/SVGResources.h" |
| 40 #include "core/rendering/svg/SVGResourcesCache.h" | 40 #include "core/rendering/svg/SVGResourcesCache.h" |
| 41 #include "core/svg/SVGElement.h" | 41 #include "core/svg/SVGElement.h" |
| 42 #include "core/svg/SVGSVGElement.h" | 42 #include "core/svg/SVGSVGElement.h" |
| 43 #include "core/svg/graphics/SVGImage.h" |
| 43 | 44 |
| 44 using namespace std; | 45 using namespace std; |
| 45 | 46 |
| 46 namespace WebCore { | 47 namespace WebCore { |
| 47 | 48 |
| 48 RenderSVGRoot::RenderSVGRoot(SVGElement* node) | 49 RenderSVGRoot::RenderSVGRoot(SVGElement* node) |
| 49 : RenderReplaced(node) | 50 : RenderReplaced(node) |
| 50 , m_objectBoundingBoxValid(false) | 51 , m_objectBoundingBoxValid(false) |
| 51 , m_isLayoutSizeChanged(false) | 52 , m_isLayoutSizeChanged(false) |
| 52 , m_needsBoundariesOrTransformUpdate(true) | 53 , m_needsBoundariesOrTransformUpdate(true) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // If our intrinsic size is in percentage units, return those to the caller
through the intrinsicSize. Notify the caller | 104 // If our intrinsic size is in percentage units, return those to the caller
through the intrinsicSize. Notify the caller |
| 104 // about the special situation, by setting isPercentageIntrinsicSize=true, s
o it knows how to interpret the return values. | 105 // about the special situation, by setting isPercentageIntrinsicSize=true, s
o it knows how to interpret the return values. |
| 105 if (intrinsicWidthAttribute.isPercent() && intrinsicHeightAttribute.isPercen
t()) { | 106 if (intrinsicWidthAttribute.isPercent() && intrinsicHeightAttribute.isPercen
t()) { |
| 106 isPercentageIntrinsicSize = true; | 107 isPercentageIntrinsicSize = true; |
| 107 intrinsicSize = FloatSize(intrinsicWidthAttribute.percent(), intrinsicHe
ightAttribute.percent()); | 108 intrinsicSize = FloatSize(intrinsicWidthAttribute.percent(), intrinsicHe
ightAttribute.percent()); |
| 108 } | 109 } |
| 109 } | 110 } |
| 110 | 111 |
| 111 bool RenderSVGRoot::isEmbeddedThroughSVGImage() const | 112 bool RenderSVGRoot::isEmbeddedThroughSVGImage() const |
| 112 { | 113 { |
| 113 if (!node()) | 114 return SVGImage::isInSVGImage(toSVGSVGElement(node())); |
| 114 return false; | |
| 115 | |
| 116 Frame* frame = node()->document()->frame(); | |
| 117 if (!frame) | |
| 118 return false; | |
| 119 | |
| 120 // Test whether we're embedded through an img. | |
| 121 if (!frame->page()) | |
| 122 return false; | |
| 123 | |
| 124 ChromeClient* chromeClient = frame->page()->chrome().client(); | |
| 125 if (!chromeClient || !chromeClient->isSVGImageChromeClient()) | |
| 126 return false; | |
| 127 | |
| 128 return true; | |
| 129 } | 115 } |
| 130 | 116 |
| 131 bool RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const | 117 bool RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const |
| 132 { | 118 { |
| 133 if (!node()) | 119 if (!node()) |
| 134 return false; | 120 return false; |
| 135 | 121 |
| 136 Frame* frame = node()->document()->frame(); | 122 Frame* frame = node()->document()->frame(); |
| 137 if (!frame) | 123 if (!frame) |
| 138 return false; | 124 return false; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 { | 468 { |
| 483 RenderObject* svgRoot = resource->parent(); | 469 RenderObject* svgRoot = resource->parent(); |
| 484 while (svgRoot && !svgRoot->isSVGRoot()) | 470 while (svgRoot && !svgRoot->isSVGRoot()) |
| 485 svgRoot = svgRoot->parent(); | 471 svgRoot = svgRoot->parent(); |
| 486 if (!svgRoot) | 472 if (!svgRoot) |
| 487 return; | 473 return; |
| 488 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); | 474 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); |
| 489 } | 475 } |
| 490 | 476 |
| 491 } | 477 } |
| OLD | NEW |