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

Side by Side Diff: Source/core/layout/LayoutImage.cpp

Issue 1277013005: Images from content:url() aren't loading if the alt attribute is present (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 4 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
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 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 if (hasBoxDecorationBackground() || hasMask() || hasShapeOutside()) 104 if (hasBoxDecorationBackground() || hasMask() || hasShapeOutside())
105 LayoutReplaced::imageChanged(newImage, rect); 105 LayoutReplaced::imageChanged(newImage, rect);
106 106
107 if (!m_imageResource) 107 if (!m_imageResource)
108 return; 108 return;
109 109
110 if (newImage != m_imageResource->imagePtr()) 110 if (newImage != m_imageResource->imagePtr())
111 return; 111 return;
112 112
113 if (isGeneratedContent() && isHTMLImageElement(node()) && m_imageResource->e rrorOccurred()) {
114 toHTMLImageElement(node())->ensureFallbackForGeneratedContent();
115 return;
116 }
117
113 // Per the spec, we let the server-sent header override srcset/other sources of dpr. 118 // Per the spec, we let the server-sent header override srcset/other sources of dpr.
114 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik -http-client-hints-01.txt#L255 119 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik -http-client-hints-01.txt#L255
115 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev icePixelRatioHeaderValue()) { 120 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev icePixelRatioHeaderValue()) {
116 UseCounter::count(&(view()->frameView()->frame()), UseCounter::ClientHin tsContentDPR); 121 UseCounter::count(&(view()->frameView()->frame()), UseCounter::ClientHin tsContentDPR);
117 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe lRatioHeaderValue(); 122 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe lRatioHeaderValue();
118 } 123 }
119 124
120 if (!m_didIncrementVisuallyNonEmptyPixelCount) { 125 if (!m_didIncrementVisuallyNonEmptyPixelCount) {
121 // At a zoom level of 1 the image is guaranteed to have an integer size. 126 // At a zoom level of 1 the image is guaranteed to have an integer size.
122 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize( m_imageResource->imageSize(1.0f))); 127 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize( m_imageResource->imageSize(1.0f)));
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return nullptr; 371 return nullptr;
367 372
368 ImageResource* cachedImage = m_imageResource->cachedImage(); 373 ImageResource* cachedImage = m_imageResource->cachedImage();
369 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 374 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
370 return toSVGImage(cachedImage->image())->embeddedContentBox(); 375 return toSVGImage(cachedImage->image())->embeddedContentBox();
371 376
372 return nullptr; 377 return nullptr;
373 } 378 }
374 379
375 } // namespace blink 380 } // namespace blink
OLDNEW
« Source/core/html/HTMLImageElement.cpp ('K') | « Source/core/html/HTMLImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698