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

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

Issue 688743002: Remove the composite attribute on <img> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « Source/core/html/HTMLImageElement.h ('k') | Source/core/paint/ImagePainter.cpp » ('j') | 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 MediaQueryListListener::trace(visitor); 73 MediaQueryListListener::trace(visitor);
74 } 74 }
75 private: 75 private:
76 explicit ViewportChangeListener(HTMLImageElement* element) : m_element(eleme nt) { } 76 explicit ViewportChangeListener(HTMLImageElement* element) : m_element(eleme nt) { }
77 RawPtrWillBeMember<HTMLImageElement> m_element; 77 RawPtrWillBeMember<HTMLImageElement> m_element;
78 }; 78 };
79 79
80 HTMLImageElement::HTMLImageElement(Document& document, HTMLFormElement* form, bo ol createdByParser) 80 HTMLImageElement::HTMLImageElement(Document& document, HTMLFormElement* form, bo ol createdByParser)
81 : HTMLElement(imgTag, document) 81 : HTMLElement(imgTag, document)
82 , m_imageLoader(HTMLImageLoader::create(this)) 82 , m_imageLoader(HTMLImageLoader::create(this))
83 , m_compositeOperator(CompositeSourceOver)
84 , m_imageDevicePixelRatio(1.0f) 83 , m_imageDevicePixelRatio(1.0f)
85 , m_formWasSetByParser(false) 84 , m_formWasSetByParser(false)
86 , m_elementCreatedByParser(createdByParser) 85 , m_elementCreatedByParser(createdByParser)
87 , m_intrinsicSizingViewportDependant(false) 86 , m_intrinsicSizingViewportDependant(false)
88 { 87 {
89 if (form && form->inDocument()) { 88 if (form && form->inDocument()) {
90 #if ENABLE(OILPAN) 89 #if ENABLE(OILPAN)
91 m_form = form; 90 m_form = form;
92 #else 91 #else
93 m_form = form->createWeakPtr(); 92 m_form = form->createWeakPtr();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 235
237 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 236 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
238 { 237 {
239 if (name == altAttr) { 238 if (name == altAttr) {
240 if (renderer() && renderer()->isImage()) 239 if (renderer() && renderer()->isImage())
241 toRenderImage(renderer())->updateAltText(); 240 toRenderImage(renderer())->updateAltText();
242 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) { 241 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) {
243 selectSourceURL(ImageLoader::UpdateIgnorePreviousError); 242 selectSourceURL(ImageLoader::UpdateIgnorePreviousError);
244 } else if (name == usemapAttr) { 243 } else if (name == usemapAttr) {
245 setIsLink(!value.isNull()); 244 setIsLink(!value.isNull());
246 } else if (name == compositeAttr) {
247 blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
248 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp) )
249 m_compositeOperator = CompositeSourceOver;
250 else if (m_compositeOperator != CompositeSourceOver)
251 UseCounter::count(document(), UseCounter::HTMLImageElementComposite) ;
252 } else { 245 } else {
253 HTMLElement::parseAttribute(name, value); 246 HTMLElement::parseAttribute(name, value);
254 } 247 }
255 } 248 }
256 249
257 const AtomicString& HTMLImageElement::altText() const 250 const AtomicString& HTMLImageElement::altText() const
258 { 251 {
259 // lets figure out the alt text.. magic stuff 252 // lets figure out the alt text.. magic stuff
260 // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen 253 // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen
261 // also heavily discussed by Hixie on bugzilla 254 // also heavily discussed by Hixie on bugzilla
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 } 646 }
654 imageLoader().updateFromElement(behavior); 647 imageLoader().updateFromElement(behavior);
655 } 648 }
656 649
657 const KURL& HTMLImageElement::sourceURL() const 650 const KURL& HTMLImageElement::sourceURL() const
658 { 651 {
659 return cachedImage()->response().url(); 652 return cachedImage()->response().url();
660 } 653 }
661 654
662 } 655 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLImageElement.h ('k') | Source/core/paint/ImagePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698