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

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

Issue 210403002: Revert of Update image data upon changing the img.crossorigin attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « LayoutTests/http/tests/resources/origin.php ('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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (RuntimeEnabledFeatures::srcsetEnabled()) { 158 if (RuntimeEnabledFeatures::srcsetEnabled()) {
159 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr)); 159 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
160 m_bestFitImageURL = candidate.toAtomicString(); 160 m_bestFitImageURL = candidate.toAtomicString();
161 float candidateScaleFactor = candidate.scaleFactor(); 161 float candidateScaleFactor = candidate.scaleFactor();
162 if (candidateScaleFactor > 0) 162 if (candidateScaleFactor > 0)
163 m_imageDevicePixelRatio = 1 / candidateScaleFactor; 163 m_imageDevicePixelRatio = 1 / candidateScaleFactor;
164 if (renderer() && renderer()->isImage()) 164 if (renderer() && renderer()->isImage())
165 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio); 165 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio);
166 } 166 }
167 m_imageLoader.updateFromElementIgnoringPreviousError(); 167 m_imageLoader.updateFromElementIgnoringPreviousError();
168 } else if (name == crossoriginAttr) { 168 }
169 m_imageLoader.updateFromElementIgnoringPreviousError(); 169 else if (name == usemapAttr)
170 } else if (name == usemapAttr)
171 setIsLink(!value.isNull()); 170 setIsLink(!value.isNull());
172 else if (name == onbeforeloadAttr) 171 else if (name == onbeforeloadAttr)
173 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value)); 172 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value));
174 else if (name == compositeAttr) { 173 else if (name == compositeAttr) {
175 // FIXME: images don't support blend modes in their compositing attribut e. 174 // FIXME: images don't support blend modes in their compositing attribut e.
176 blink::WebBlendMode blendOp = blink::WebBlendModeNormal; 175 blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
177 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) ) 176 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) )
178 m_compositeOperator = CompositeSourceOver; 177 m_compositeOperator = CompositeSourceOver;
179 } else 178 } else
180 HTMLElement::parseAttribute(name, value); 179 HTMLElement::parseAttribute(name, value);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 if (!image) 459 if (!image)
461 return FloatSize(); 460 return FloatSize();
462 LayoutSize size; 461 LayoutSize size;
463 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this. 462 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this.
464 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth()) 463 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth())
465 size.scale(toRenderImage(renderer())->imageDevicePixelRatio()); 464 size.scale(toRenderImage(renderer())->imageDevicePixelRatio());
466 return size; 465 return size;
467 } 466 }
468 467
469 } 468 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/resources/origin.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698