Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: sky/engine/core/loader/ImageLoader.cpp

Issue 855803002: Remove attrs sky doesn't support. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.idl ('k') | sky/engine/core/page/Chrome.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (!document.isActive()) 202 if (!document.isActive())
203 return; 203 return;
204 204
205 AtomicString imageSourceURL = m_element->imageSourceURL(); 205 AtomicString imageSourceURL = m_element->imageSourceURL();
206 KURL url = imageSourceToKURL(imageSourceURL); 206 KURL url = imageSourceToKURL(imageSourceURL);
207 ResourcePtr<ImageResource> newImage = 0; 207 ResourcePtr<ImageResource> newImage = 0;
208 if (!url.isNull()) { 208 if (!url.isNull()) {
209 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 209 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
210 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 210 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
211 ResourceRequest resourceRequest(url); 211 ResourceRequest resourceRequest(url);
212 if (!element()->getAttribute(HTMLNames::srcsetAttr).isNull())
213 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
214 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions); 212 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions);
215 213
216 newImage = document.fetcher()->fetchImage(request); 214 newImage = document.fetcher()->fetchImage(request);
217 215
218 if (!newImage && !pageIsBeingDismissed(&document)) 216 if (!newImage && !pageIsBeingDismissed(&document))
219 crossSiteOrCSPViolationOccured(imageSourceURL); 217 crossSiteOrCSPViolationOccured(imageSourceURL);
220 else 218 else
221 clearFailedLoadURL(); 219 clearFailedLoadURL();
222 } else if (!imageSourceURL.isNull()) { 220 } else if (!imageSourceURL.isNull()) {
223 // Fire an error event if the url string is not empty, but the KURL is. 221 // Fire an error event if the url string is not empty, but the KURL is.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 void ImageLoader::sourceImageChanged() 491 void ImageLoader::sourceImageChanged()
494 { 492 {
495 HashSet<ImageLoaderClient*>::iterator end = m_clients.end(); 493 HashSet<ImageLoaderClient*>::iterator end = m_clients.end();
496 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end ; ++it) { 494 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end ; ++it) {
497 ImageLoaderClient* handle = *it; 495 ImageLoaderClient* handle = *it;
498 handle->notifyImageSourceChanged(); 496 handle->notifyImageSourceChanged();
499 } 497 }
500 } 498 }
501 499
502 } 500 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.idl ('k') | sky/engine/core/page/Chrome.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698