| 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, 2009, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 KURL url; | 383 KURL url; |
| 384 | 384 |
| 385 // Don't load images for inactive documents. We don't want to slow down the | 385 // Don't load images for inactive documents. We don't want to slow down the |
| 386 // raw HTML parsing case by loading images we don't intend to display. | 386 // raw HTML parsing case by loading images we don't intend to display. |
| 387 Document& document = m_element->document(); | 387 Document& document = m_element->document(); |
| 388 if (!document.isActive()) | 388 if (!document.isActive()) |
| 389 return url; | 389 return url; |
| 390 | 390 |
| 391 // Do not load any image if the 'src' attribute is missing or if it is | 391 // Do not load any image if the 'src' attribute is missing or if it is |
| 392 // an empty string. | 392 // an empty string. |
| 393 if (!imageSourceURL.isNull() && !stripLeadingAndTrailingHTMLSpaces(imageSour
ceURL).isEmpty()) | 393 if (!imageSourceURL.isNull()) { |
| 394 url = document.completeURL(sourceURI(imageSourceURL)); | 394 String strippedImageSourceURL = stripLeadingAndTrailingHTMLSpaces(imageS
ourceURL); |
| 395 if (!strippedImageSourceURL.isEmpty()) |
| 396 url = document.completeURL(strippedImageSourceURL); |
| 397 } |
| 395 return url; | 398 return url; |
| 396 } | 399 } |
| 397 | 400 |
| 398 bool ImageLoader::shouldLoadImmediately(const KURL& url) const | 401 bool ImageLoader::shouldLoadImmediately(const KURL& url) const |
| 399 { | 402 { |
| 400 // We force any image loads which might require alt content through the asyn
chronous path so that we can add the shadow DOM | 403 // We force any image loads which might require alt content through the asyn
chronous path so that we can add the shadow DOM |
| 401 // for the alt-text content when style recalc is over and DOM mutation is al
lowed again. | 404 // for the alt-text content when style recalc is over and DOM mutation is al
lowed again. |
| 402 if (!url.isNull()) { | 405 if (!url.isNull()) { |
| 403 Resource* resource = memoryCache()->resourceForURL(url, m_element->docum
ent().fetcher()->getCacheIdentifier()); | 406 Resource* resource = memoryCache()->resourceForURL(url, m_element->docum
ent().fetcher()->getCacheIdentifier()); |
| 404 if (resource && !resource->errorOccurred()) | 407 if (resource && !resource->errorOccurred()) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 #endif | 622 #endif |
| 620 } | 623 } |
| 621 | 624 |
| 622 #if ENABLE(OILPAN) | 625 #if ENABLE(OILPAN) |
| 623 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() | 626 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() |
| 624 { | 627 { |
| 625 m_loader.willRemoveClient(m_client); | 628 m_loader.willRemoveClient(m_client); |
| 626 } | 629 } |
| 627 #endif | 630 #endif |
| 628 } | 631 } |
| OLD | NEW |