| 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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 m_cachedImage->removeClient(this); | 72 m_cachedImage->removeClient(this); |
| 73 m_cachedImage = 0; | 73 m_cachedImage = 0; |
| 74 } | 74 } |
| 75 | 75 |
| 76 ASSERT(document()); | 76 ASSERT(document()); |
| 77 document()->accessSVGExtensions()->removeAllTargetReferencesForElement(this)
; | 77 document()->accessSVGExtensions()->removeAllTargetReferencesForElement(this)
; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SVGFEImageElement::requestImageResource() | 80 void SVGFEImageElement::requestImageResource() |
| 81 { | 81 { |
| 82 CachedResourceRequest request(ResourceRequest(ownerDocument()->completeURL(h
ref())), localName()); | 82 CachedResourceRequest request(ResourceRequest(ownerDocument()->completeURL(h
refCurrentValue())), localName()); |
| 83 m_cachedImage = document()->cachedResourceLoader()->requestImage(request); | 83 m_cachedImage = document()->cachedResourceLoader()->requestImage(request); |
| 84 | 84 |
| 85 if (m_cachedImage) | 85 if (m_cachedImage) |
| 86 m_cachedImage->addClient(this); | 86 m_cachedImage->addClient(this); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void SVGFEImageElement::buildPendingResource() | 89 void SVGFEImageElement::buildPendingResource() |
| 90 { | 90 { |
| 91 clearResourceReferences(); | 91 clearResourceReferences(); |
| 92 if (!inDocument()) | 92 if (!inDocument()) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 String id; | 95 String id; |
| 96 Element* target = SVGURIReference::targetElementFromIRIString(href(), docume
nt(), &id); | 96 Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentVal
ue(), document(), &id); |
| 97 if (!target) { | 97 if (!target) { |
| 98 if (id.isEmpty()) | 98 if (id.isEmpty()) |
| 99 requestImageResource(); | 99 requestImageResource(); |
| 100 else { | 100 else { |
| 101 document()->accessSVGExtensions()->addPendingResource(id, this); | 101 document()->accessSVGExtensions()->addPendingResource(id, this); |
| 102 ASSERT(hasPendingResources()); | 102 ASSERT(hasPendingResources()); |
| 103 } | 103 } |
| 104 } else if (target->isSVGElement()) { | 104 } else if (target->isSVGElement()) { |
| 105 // Register us with the target in the dependencies map. Any change of hr
efElement | 105 // Register us with the target in the dependencies map. Any change of hr
efElement |
| 106 // that leads to relayout/repainting now informs us, so we can react to
it. | 106 // that leads to relayout/repainting now informs us, so we can react to
it. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 if (!parent->hasTagName(SVGNames::filterTag) || !parent->renderer()) | 193 if (!parent->hasTagName(SVGNames::filterTag) || !parent->renderer()) |
| 194 return; | 194 return; |
| 195 | 195 |
| 196 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer()); | 196 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* fil
ter) | 199 PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* fil
ter) |
| 200 { | 200 { |
| 201 if (m_cachedImage) | 201 if (m_cachedImage) |
| 202 return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(
renderer()), preserveAspectRatio()); | 202 return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(
renderer()), preserveAspectRatioCurrentValue()); |
| 203 return FEImage::createWithIRIReference(filter, document(), href(), preserveA
spectRatio()); | 203 return FEImage::createWithIRIReference(filter, document(), hrefCurrentValue(
), preserveAspectRatioCurrentValue()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) con
st | 206 void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) con
st |
| 207 { | 207 { |
| 208 SVGFilterPrimitiveStandardAttributes::addSubresourceAttributeURLs(urls); | 208 SVGFilterPrimitiveStandardAttributes::addSubresourceAttributeURLs(urls); |
| 209 | 209 |
| 210 addSubresourceURL(urls, document()->completeURL(href())); | 210 addSubresourceURL(urls, document()->completeURL(hrefCurrentValue())); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } | 213 } |
| OLD | NEW |