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

Side by Side Diff: trunk/Source/core/loader/ImageLoader.cpp

Issue 367143002: Revert 177385 "Block mixed <picture> and <img srcset> by default." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « trunk/LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-srcset.html ('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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 Document& document = m_element->document(); 177 Document& document = m_element->document();
178 if (!document.isActive()) 178 if (!document.isActive())
179 return; 179 return;
180 180
181 AtomicString attr = m_element->imageSourceURL(); 181 AtomicString attr = m_element->imageSourceURL();
182 182
183 KURL url = imageURL(); 183 KURL url = imageURL();
184 ResourcePtr<ImageResource> newImage = 0; 184 ResourcePtr<ImageResource> newImage = 0;
185 if (!url.isNull()) { 185 if (!url.isNull()) {
186 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 186 FetchRequest request(ResourceRequest(url), element()->localName());
187 ResourceLoaderOptions resourceLoaderOptions;
188 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isEmpty())
189 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent;
190 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions);
191 if (bypassMainWorldCSP) 187 if (bypassMainWorldCSP)
192 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); 188 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
193 189
194 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr); 190 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr);
195 if (!crossOriginMode.isNull()) 191 if (!crossOriginMode.isNull())
196 request.setCrossOriginAccessControl(document.securityOrigin(), cross OriginMode); 192 request.setCrossOriginAccessControl(document.securityOrigin(), cross OriginMode);
197 193
198 if (m_loadManually) { 194 if (m_loadManually) {
199 bool autoLoadOtherImages = document.fetcher()->autoLoadImages(); 195 bool autoLoadOtherImages = document.fetcher()->autoLoadImages();
200 document.fetcher()->setAutoLoadImages(false); 196 document.fetcher()->setAutoLoadImages(false);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 539 }
544 540
545 #if ENABLE(OILPAN) 541 #if ENABLE(OILPAN)
546 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 542 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
547 { 543 {
548 m_loader.willRemoveClient(m_client); 544 m_loader.willRemoveClient(m_client);
549 } 545 }
550 #endif 546 #endif
551 547
552 } 548 }
OLDNEW
« no previous file with comments | « trunk/LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-srcset.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698