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

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

Issue 201143002: Update image data upon changing the img.crossorigin attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix underlying script 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 } 168 } else if (name == crossoriginAttr) {
169 else if (name == usemapAttr) 169 m_imageLoader.updateFromElementIgnoringPreviousError();
170 } else if (name == usemapAttr)
170 setIsLink(!value.isNull()); 171 setIsLink(!value.isNull());
171 else if (name == onbeforeloadAttr) 172 else if (name == onbeforeloadAttr)
172 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value)); 173 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value));
173 else if (name == compositeAttr) { 174 else if (name == compositeAttr) {
174 // FIXME: images don't support blend modes in their compositing attribut e. 175 // FIXME: images don't support blend modes in their compositing attribut e.
175 blink::WebBlendMode blendOp = blink::WebBlendModeNormal; 176 blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
176 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) ) 177 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) )
177 m_compositeOperator = CompositeSourceOver; 178 m_compositeOperator = CompositeSourceOver;
178 } else 179 } else
179 HTMLElement::parseAttribute(name, value); 180 HTMLElement::parseAttribute(name, value);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (!image) 460 if (!image)
460 return FloatSize(); 461 return FloatSize();
461 LayoutSize size; 462 LayoutSize size;
462 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this. 463 size = image->imageSizeForRenderer(renderer(), 1.0f); // FIXME: Not sure abo ut this.
463 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth()) 464 if (renderer() && renderer()->isRenderImage() && image->image() && !image->i mage()->hasRelativeWidth())
464 size.scale(toRenderImage(renderer())->imageDevicePixelRatio()); 465 size.scale(toRenderImage(renderer())->imageDevicePixelRatio());
465 return size; 466 return size;
466 } 467 }
467 468
468 } 469 }
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