| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 #include "core/svg/graphics/SVGImageCache.h" | 22 #include "core/svg/graphics/SVGImageCache.h" |
| 23 | 23 |
| 24 #include "core/fetch/ImageResource.h" | 24 #include "core/fetch/ImageResource.h" |
| 25 #include "core/frame/FrameView.h" | 25 #include "core/frame/FrameView.h" |
| 26 #include "core/html/HTMLImageElement.h" |
| 26 #include "core/page/Page.h" | 27 #include "core/page/Page.h" |
| 27 #include "core/rendering/svg/RenderSVGRoot.h" | 28 #include "core/rendering/svg/RenderSVGRoot.h" |
| 28 #include "core/svg/graphics/SVGImage.h" | 29 #include "core/svg/graphics/SVGImage.h" |
| 29 #include "core/svg/graphics/SVGImageForContainer.h" | 30 #include "core/svg/graphics/SVGImageForContainer.h" |
| 30 #include "platform/graphics/GraphicsContext.h" | 31 #include "platform/graphics/GraphicsContext.h" |
| 31 #include "platform/graphics/ImageBuffer.h" | 32 #include "platform/graphics/ImageBuffer.h" |
| 32 | 33 |
| 33 namespace WebCore { | 34 namespace WebCore { |
| 34 | 35 |
| 35 SVGImageCache::SVGImageCache(SVGImage* svgImage) | 36 SVGImageCache::SVGImageCache(SVGImage* svgImage) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 { | 83 { |
| 83 if (!renderer) | 84 if (!renderer) |
| 84 return Image::nullImage(); | 85 return Image::nullImage(); |
| 85 | 86 |
| 86 ImageForContainerMap::iterator it = m_imageForContainerMap.find(renderer); | 87 ImageForContainerMap::iterator it = m_imageForContainerMap.find(renderer); |
| 87 if (it == m_imageForContainerMap.end()) | 88 if (it == m_imageForContainerMap.end()) |
| 88 return Image::nullImage(); | 89 return Image::nullImage(); |
| 89 | 90 |
| 90 RefPtr<SVGImageForContainer> imageForContainer = it->value; | 91 RefPtr<SVGImageForContainer> imageForContainer = it->value; |
| 91 ASSERT(!imageForContainer->size().isEmpty()); | 92 ASSERT(!imageForContainer->size().isEmpty()); |
| 93 |
| 94 Node* node = renderer->node(); |
| 95 if (node && isHTMLImageElement(node)) { |
| 96 const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL
(); |
| 97 KURL url = node->document().completeURL(urlString); |
| 98 imageForContainer->setURL(url); |
| 99 } |
| 100 |
| 92 return imageForContainer.get(); | 101 return imageForContainer.get(); |
| 93 } | 102 } |
| 94 | 103 |
| 95 } // namespace WebCore | 104 } // namespace WebCore |
| OLD | NEW |