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

Side by Side Diff: Source/core/html/HTMLImageElement.cpp

Issue 135273010: Enable HTMLImageElement to avoid immediate src loading when parsed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « Source/core/dom/Element.cpp ('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, 2008, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } else if (name == srcAttr || name == srcsetAttr) { 155 } else if (name == srcAttr || name == srcsetAttr) {
156 if (RuntimeEnabledFeatures::srcsetEnabled()) { 156 if (RuntimeEnabledFeatures::srcsetEnabled()) {
157 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr)); 157 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
158 m_bestFitImageURL = candidate.toAtomicString(); 158 m_bestFitImageURL = candidate.toAtomicString();
159 float candidateScaleFactor = candidate.scaleFactor(); 159 float candidateScaleFactor = candidate.scaleFactor();
160 if (candidateScaleFactor > 0) 160 if (candidateScaleFactor > 0)
161 m_imageDevicePixelRatio = 1 / candidateScaleFactor; 161 m_imageDevicePixelRatio = 1 / candidateScaleFactor;
162 if (renderer() && renderer()->isImage()) 162 if (renderer() && renderer()->isImage())
163 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio); 163 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio);
164 } 164 }
165 m_imageLoader.updateFromElementIgnoringPreviousError(); 165 if (!m_parserSet)
166 m_imageLoader.updateFromElementIgnoringPreviousError();
166 } 167 }
167 else if (name == usemapAttr) 168 else if (name == usemapAttr)
168 setIsLink(!value.isNull()); 169 setIsLink(!value.isNull());
169 else if (name == onbeforeloadAttr) 170 else if (name == onbeforeloadAttr)
170 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value)); 171 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value));
171 else if (name == compositeAttr) { 172 else if (name == compositeAttr) {
172 // FIXME: images don't support blend modes in their compositing attribut e. 173 // FIXME: images don't support blend modes in their compositing attribut e.
173 blink::WebBlendMode blendOp = blink::WebBlendModeNormal; 174 blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
174 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) ) 175 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) )
175 m_compositeOperator = CompositeSourceOver; 176 m_compositeOperator = CompositeSourceOver;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 404
404 return m_imageLoader.image()->image(); 405 return m_imageLoader.image()->image();
405 } 406 }
406 407
407 bool HTMLImageElement::isInteractiveContent() const 408 bool HTMLImageElement::isInteractiveContent() const
408 { 409 {
409 return fastHasAttribute(usemapAttr); 410 return fastHasAttribute(usemapAttr);
410 } 411 }
411 412
412 } 413 }
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698