| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if (!url.isEmpty()) | 128 if (!url.isEmpty()) |
| 129 completedURL = document()->completeURL(url); | 129 completedURL = document()->completeURL(url); |
| 130 | 130 |
| 131 FrameLoader* frameLoader = document()->frame()->loader(); | 131 FrameLoader* frameLoader = document()->frame()->loader(); |
| 132 ASSERT(frameLoader); | 132 ASSERT(frameLoader); |
| 133 if (frameLoader->client()->objectContentType(completedURL, serviceType, shou
ldPreferPlugInsForImages()) == ObjectContentNetscapePlugin) | 133 if (frameLoader->client()->objectContentType(completedURL, serviceType, shou
ldPreferPlugInsForImages()) == ObjectContentNetscapePlugin) |
| 134 return true; | 134 return true; |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 RenderObject* HTMLPlugInImageElement::createRenderer(RenderArena* arena, RenderS
tyle* style) | 138 RenderObject* HTMLPlugInImageElement::createRenderer(RenderStyle* style) |
| 139 { | 139 { |
| 140 // Fallback content breaks the DOM->Renderer class relationship of this | 140 // Fallback content breaks the DOM->Renderer class relationship of this |
| 141 // class and all superclasses because createObject won't necessarily | 141 // class and all superclasses because createObject won't necessarily |
| 142 // return a RenderEmbeddedObject, RenderPart or even RenderWidget. | 142 // return a RenderEmbeddedObject, RenderPart or even RenderWidget. |
| 143 if (useFallbackContent()) | 143 if (useFallbackContent()) |
| 144 return RenderObject::createObject(this, style); | 144 return RenderObject::createObject(this, style); |
| 145 | 145 |
| 146 if (isImageType()) { | 146 if (isImageType()) { |
| 147 RenderImage* image = new (arena) RenderImage(this); | 147 RenderImage* image = new RenderImage(this); |
| 148 image->setImageResource(RenderImageResource::create()); | 148 image->setImageResource(RenderImageResource::create()); |
| 149 return image; | 149 return image; |
| 150 } | 150 } |
| 151 | 151 |
| 152 return new (arena) RenderEmbeddedObject(this); | 152 return new RenderEmbeddedObject(this); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void HTMLPlugInImageElement::willRecalcStyle(StyleChange) | 155 void HTMLPlugInImageElement::willRecalcStyle(StyleChange) |
| 156 { | 156 { |
| 157 // FIXME: Why is this necessary? Manual re-attach is almost always wrong. | 157 // FIXME: Why is this necessary? Manual re-attach is almost always wrong. |
| 158 if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageTy
pe()) | 158 if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageTy
pe()) |
| 159 reattach(); | 159 reattach(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void HTMLPlugInImageElement::attach(const AttachContext& context) | 162 void HTMLPlugInImageElement::attach(const AttachContext& context) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const KURL& url) | 227 void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const KURL& url) |
| 228 { | 228 { |
| 229 LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); | 229 LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); |
| 230 LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); | 230 LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); |
| 231 | 231 |
| 232 m_loadedUrl = url; | 232 m_loadedUrl = url; |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace WebCore | 235 } // namespace WebCore |
| OLD | NEW |