| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // FIXME: if isLengthAttribute then we should avoid this call if the | 127 // FIXME: if isLengthAttribute then we should avoid this call if the |
| 128 // viewport didn't change, however since we don't have the computed | 128 // viewport didn't change, however since we don't have the computed |
| 129 // style yet we can't use updateBoundingBox/updateImageContainerSize. | 129 // style yet we can't use updateBoundingBox/updateImageContainerSize. |
| 130 // See http://crbug.com/466200. | 130 // See http://crbug.com/466200. |
| 131 markForLayoutAndParentResourceInvalidation(object); | 131 markForLayoutAndParentResourceInvalidation(object); |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (SVGURIReference::isKnownAttribute(attrName)) { | 135 if (SVGURIReference::isKnownAttribute(attrName)) { |
| 136 SVGElement::InvalidationGuard invalidationGuard(this); | 136 SVGElement::InvalidationGuard invalidationGuard(this); |
| 137 if (inShadowIncludingDocument()) | 137 if (isConnected()) |
| 138 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousErr
or); | 138 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousErr
or); |
| 139 else | 139 else |
| 140 m_needsLoaderURIUpdate = true; | 140 m_needsLoaderURIUpdate = true; |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 | 143 |
| 144 SVGGraphicsElement::svgAttributeChanged(attrName); | 144 SVGGraphicsElement::svgAttributeChanged(attrName); |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool SVGImageElement::selfHasRelativeLengths() const | 147 bool SVGImageElement::selfHasRelativeLengths() const |
| (...skipping 22 matching lines...) Expand all Loading... |
| 170 if (imageObj->imageResource()->hasImage()) | 170 if (imageObj->imageResource()->hasImage()) |
| 171 return; | 171 return; |
| 172 | 172 |
| 173 imageObj->imageResource()->setImageResource(imageLoader().image()); | 173 imageObj->imageResource()->setImageResource(imageLoader().image()); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode*
rootParent) | 177 Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode*
rootParent) |
| 178 { | 178 { |
| 179 SVGGraphicsElement::insertedInto(rootParent); | 179 SVGGraphicsElement::insertedInto(rootParent); |
| 180 if (!rootParent->inShadowIncludingDocument()) | 180 if (!rootParent->isConnected()) |
| 181 return InsertionDone; | 181 return InsertionDone; |
| 182 | 182 |
| 183 // We can only resolve base URIs properly after tree insertion - hence, URI
mutations while | 183 // We can only resolve base URIs properly after tree insertion - hence, URI
mutations while |
| 184 // detached are deferred until this point. | 184 // detached are deferred until this point. |
| 185 if (m_needsLoaderURIUpdate) { | 185 if (m_needsLoaderURIUpdate) { |
| 186 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousError); | 186 imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousError); |
| 187 m_needsLoaderURIUpdate = false; | 187 m_needsLoaderURIUpdate = false; |
| 188 } else { | 188 } else { |
| 189 // A previous loader update may have failed to actually fetch the image
if the document | 189 // A previous loader update may have failed to actually fetch the image
if the document |
| 190 // was inactive. In that case, force a re-update (but don't clear previo
us errors). | 190 // was inactive. In that case, force a re-update (but don't clear previo
us errors). |
| 191 if (!imageLoader().image()) | 191 if (!imageLoader().image()) |
| 192 imageLoader().updateFromElement(); | 192 imageLoader().updateFromElement(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 return InsertionDone; | 195 return InsertionDone; |
| 196 } | 196 } |
| 197 | 197 |
| 198 const AtomicString SVGImageElement::imageSourceURL() const | 198 const AtomicString SVGImageElement::imageSourceURL() const |
| 199 { | 199 { |
| 200 return AtomicString(hrefString()); | 200 return AtomicString(hrefString()); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) | 203 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) |
| 204 { | 204 { |
| 205 imageLoader().elementDidMoveToNewDocument(); | 205 imageLoader().elementDidMoveToNewDocument(); |
| 206 SVGGraphicsElement::didMoveToNewDocument(oldDocument); | 206 SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace blink | 209 } // namespace blink |
| OLD | NEW |