| 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 | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 if (isHTMLPictureElement(element()->parentNode()) || | 309 if (isHTMLPictureElement(element()->parentNode()) || |
| 310 !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull()) | 310 !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull()) |
| 311 resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet); | 311 resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet); |
| 312 FetchRequest request(resourceRequest, element()->localName(), | 312 FetchRequest request(resourceRequest, element()->localName(), |
| 313 resourceLoaderOptions); | 313 resourceLoaderOptions); |
| 314 configureRequest(request, bypassBehavior, *m_element, | 314 configureRequest(request, bypassBehavior, *m_element, |
| 315 document.clientHintsPreferences()); | 315 document.clientHintsPreferences()); |
| 316 | 316 |
| 317 if (updateBehavior != UpdateForcedReload && document.settings() && | 317 if (updateBehavior != UpdateForcedReload && document.settings() && |
| 318 document.settings()->fetchImagePlaceholders()) { | 318 document.settings()->getFetchImagePlaceholders()) { |
| 319 request.setAllowImagePlaceholder(); | 319 request.setAllowImagePlaceholder(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 newImage = ImageResourceContent::fetch(request, document.fetcher()); | 322 newImage = ImageResourceContent::fetch(request, document.fetcher()); |
| 323 | 323 |
| 324 if (!newImage && !pageIsBeingDismissed(&document)) { | 324 if (!newImage && !pageIsBeingDismissed(&document)) { |
| 325 crossSiteOrCSPViolationOccurred(imageSourceURL); | 325 crossSiteOrCSPViolationOccurred(imageSourceURL); |
| 326 dispatchErrorEvent(); | 326 dispatchErrorEvent(); |
| 327 } else { | 327 } else { |
| 328 clearFailedLoadURL(); | 328 clearFailedLoadURL(); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 // Only consider updating the protection ref-count of the Element immediately | 614 // Only consider updating the protection ref-count of the Element immediately |
| 615 // before returning from this function as doing so might result in the | 615 // before returning from this function as doing so might result in the |
| 616 // destruction of this ImageLoader. | 616 // destruction of this ImageLoader. |
| 617 updatedHasPendingEvent(); | 617 updatedHasPendingEvent(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) { | 620 bool ImageLoader::getImageAnimationPolicy(ImageAnimationPolicy& policy) { |
| 621 if (!element()->document().settings()) | 621 if (!element()->document().settings()) |
| 622 return false; | 622 return false; |
| 623 | 623 |
| 624 policy = element()->document().settings()->imageAnimationPolicy(); | 624 policy = element()->document().settings()->getImageAnimationPolicy(); |
| 625 return true; | 625 return true; |
| 626 } | 626 } |
| 627 | 627 |
| 628 void ImageLoader::dispatchPendingLoadEvents() { | 628 void ImageLoader::dispatchPendingLoadEvents() { |
| 629 loadEventSender().dispatchPendingEvents(); | 629 loadEventSender().dispatchPendingEvents(); |
| 630 } | 630 } |
| 631 | 631 |
| 632 void ImageLoader::dispatchPendingErrorEvents() { | 632 void ImageLoader::dispatchPendingErrorEvents() { |
| 633 errorEventSender().dispatchPendingEvents(); | 633 errorEventSender().dispatchPendingEvents(); |
| 634 } | 634 } |
| 635 | 635 |
| 636 void ImageLoader::elementDidMoveToNewDocument() { | 636 void ImageLoader::elementDidMoveToNewDocument() { |
| 637 if (m_loadDelayCounter) | 637 if (m_loadDelayCounter) |
| 638 m_loadDelayCounter->documentChanged(m_element->document()); | 638 m_loadDelayCounter->documentChanged(m_element->document()); |
| 639 clearFailedLoadURL(); | 639 clearFailedLoadURL(); |
| 640 setImage(0); | 640 setImage(0); |
| 641 } | 641 } |
| 642 | 642 |
| 643 } // namespace blink | 643 } // namespace blink |
| OLD | NEW |