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

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

Issue 706093002: Remove <picture> and <source>. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review Created 6 years, 1 month 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/HTMLTagNames.in ('k') | no next file » | 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (!document.isActive()) 207 if (!document.isActive())
208 return; 208 return;
209 209
210 AtomicString imageSourceURL = m_element->imageSourceURL(); 210 AtomicString imageSourceURL = m_element->imageSourceURL();
211 KURL url = imageSourceToKURL(imageSourceURL); 211 KURL url = imageSourceToKURL(imageSourceURL);
212 ResourcePtr<ImageResource> newImage = 0; 212 ResourcePtr<ImageResource> newImage = 0;
213 if (!url.isNull()) { 213 if (!url.isNull()) {
214 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 214 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
215 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 215 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
216 ResourceRequest resourceRequest(url); 216 ResourceRequest resourceRequest(url);
217 if (isHTMLPictureElement(element()->parentNode()) || !element()->getAttr ibute(HTMLNames::srcsetAttr).isNull()) 217 if (!element()->getAttribute(HTMLNames::srcsetAttr).isNull())
218 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 218 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
219 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions); 219 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions);
220 220
221 newImage = document.fetcher()->fetchImage(request); 221 newImage = document.fetcher()->fetchImage(request);
222 222
223 if (!newImage && !pageIsBeingDismissed(&document)) 223 if (!newImage && !pageIsBeingDismissed(&document))
224 crossSiteOrCSPViolationOccured(imageSourceURL); 224 crossSiteOrCSPViolationOccured(imageSourceURL);
225 else 225 else
226 clearFailedLoadURL(); 226 clearFailedLoadURL();
227 } else if (!imageSourceURL.isNull()) { 227 } else if (!imageSourceURL.isNull()) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 void ImageLoader::sourceImageChanged() 500 void ImageLoader::sourceImageChanged()
501 { 501 {
502 HashSet<ImageLoaderClient*>::iterator end = m_clients.end(); 502 HashSet<ImageLoaderClient*>::iterator end = m_clients.end();
503 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end ; ++it) { 503 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end ; ++it) {
504 ImageLoaderClient* handle = *it; 504 ImageLoaderClient* handle = *it;
505 handle->notifyImageSourceChanged(); 505 handle->notifyImageSourceChanged();
506 } 506 }
507 } 507 }
508 508
509 } 509 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLTagNames.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698