| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // HTMLVideoElement uses this class to load the poster image, but it should
not fire events for loading or failure. | 53 // HTMLVideoElement uses this class to load the poster image, but it should
not fire events for loading or failure. |
| 54 if (isHTMLVideoElement(*element())) | 54 if (isHTMLVideoElement(*element())) |
| 55 return; | 55 return; |
| 56 | 56 |
| 57 bool errorOccurred = image()->errorOccurred(); | 57 bool errorOccurred = image()->errorOccurred(); |
| 58 if (isHTMLObjectElement(*element()) && !errorOccurred) | 58 if (isHTMLObjectElement(*element()) && !errorOccurred) |
| 59 errorOccurred = (image()->response().httpStatusCode() >= 400); // An <ob
ject> considers a 404 to be an error and should fire onerror. | 59 errorOccurred = (image()->response().httpStatusCode() >= 400); // An <ob
ject> considers a 404 to be an error and should fire onerror. |
| 60 element()->dispatchEvent(Event::create(errorOccurred ? EventTypeNames::error
: EventTypeNames::load)); | 60 element()->dispatchEvent(Event::create(errorOccurred ? EventTypeNames::error
: EventTypeNames::load)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 String HTMLImageLoader::sourceURI(const AtomicString& attr) const | |
| 64 { | |
| 65 return stripLeadingAndTrailingHTMLSpaces(attr); | |
| 66 } | |
| 67 | |
| 68 static void loadFallbackContentForElement(Element* element) | 63 static void loadFallbackContentForElement(Element* element) |
| 69 { | 64 { |
| 70 if (isHTMLImageElement(element)) | 65 if (isHTMLImageElement(element)) |
| 71 toHTMLImageElement(element)->ensureFallbackContent(); | 66 toHTMLImageElement(element)->ensureFallbackContent(); |
| 72 else if (isHTMLInputElement(element)) | 67 else if (isHTMLInputElement(element)) |
| 73 toHTMLInputElement(element)->ensureFallbackContent(); | 68 toHTMLInputElement(element)->ensureFallbackContent(); |
| 74 } | 69 } |
| 75 | 70 |
| 76 void HTMLImageLoader::noImageResourceToLoad() | 71 void HTMLImageLoader::noImageResourceToLoad() |
| 77 { | 72 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 m_loadFallbackContentTimer.startOneShot(0, FROM_HERE); | 106 m_loadFallbackContentTimer.startOneShot(0, FROM_HERE); |
| 112 else | 107 else |
| 113 loadFallbackContentForElement(element()); | 108 loadFallbackContentForElement(element()); |
| 114 } | 109 } |
| 115 | 110 |
| 116 void HTMLImageLoader::timerFired(Timer<HTMLImageLoader>*) | 111 void HTMLImageLoader::timerFired(Timer<HTMLImageLoader>*) |
| 117 { | 112 { |
| 118 loadFallbackContentForElement(element()); | 113 loadFallbackContentForElement(element()); |
| 119 } | 114 } |
| 120 } | 115 } |
| OLD | NEW |