OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 #include "bindings/core/v8/ScriptEventListener.h" | 26 #include "bindings/core/v8/ScriptEventListener.h" |
27 #include "core/CSSPropertyNames.h" | 27 #include "core/CSSPropertyNames.h" |
28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
29 #include "core/MediaTypeNames.h" | 29 #include "core/MediaTypeNames.h" |
30 #include "core/css/MediaQueryMatcher.h" | 30 #include "core/css/MediaQueryMatcher.h" |
31 #include "core/css/MediaValuesDynamic.h" | 31 #include "core/css/MediaValuesDynamic.h" |
32 #include "core/css/parser/SizesAttributeParser.h" | 32 #include "core/css/parser/SizesAttributeParser.h" |
33 #include "core/dom/Attribute.h" | 33 #include "core/dom/Attribute.h" |
34 #include "core/dom/NodeTraversal.h" | 34 #include "core/dom/NodeTraversal.h" |
35 #include "core/fetch/ImageResource.h" | 35 #include "core/fetch/ImageResource.h" |
| 36 #include "core/frame/UseCounter.h" |
36 #include "core/html/HTMLAnchorElement.h" | 37 #include "core/html/HTMLAnchorElement.h" |
37 #include "core/html/HTMLCanvasElement.h" | 38 #include "core/html/HTMLCanvasElement.h" |
38 #include "core/html/HTMLFormElement.h" | 39 #include "core/html/HTMLFormElement.h" |
39 #include "core/html/HTMLSourceElement.h" | 40 #include "core/html/HTMLSourceElement.h" |
40 #include "core/html/canvas/CanvasRenderingContext.h" | 41 #include "core/html/canvas/CanvasRenderingContext.h" |
41 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
42 #include "core/html/parser/HTMLSrcsetParser.h" | 43 #include "core/html/parser/HTMLSrcsetParser.h" |
43 #include "core/rendering/RenderImage.h" | 44 #include "core/rendering/RenderImage.h" |
44 #include "platform/MIMETypeRegistry.h" | 45 #include "platform/MIMETypeRegistry.h" |
45 #include "platform/RuntimeEnabledFeatures.h" | 46 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 190 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
190 { | 191 { |
191 if (name == altAttr) { | 192 if (name == altAttr) { |
192 if (renderer() && renderer()->isImage()) | 193 if (renderer() && renderer()->isImage()) |
193 toRenderImage(renderer())->updateAltText(); | 194 toRenderImage(renderer())->updateAltText(); |
194 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) { | 195 } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) { |
195 selectSourceURL(ImageLoader::UpdateIgnorePreviousError); | 196 selectSourceURL(ImageLoader::UpdateIgnorePreviousError); |
196 } else if (name == usemapAttr) { | 197 } else if (name == usemapAttr) { |
197 setIsLink(!value.isNull()); | 198 setIsLink(!value.isNull()); |
198 } else if (name == compositeAttr) { | 199 } else if (name == compositeAttr) { |
199 // FIXME: images don't support blend modes in their compositing attribut
e. | |
200 blink::WebBlendMode blendOp = blink::WebBlendModeNormal; | 200 blink::WebBlendMode blendOp = blink::WebBlendModeNormal; |
201 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp)
) | 201 if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp)
) |
202 m_compositeOperator = CompositeSourceOver; | 202 m_compositeOperator = CompositeSourceOver; |
| 203 else if (m_compositeOperator != CompositeSourceOver) |
| 204 UseCounter::count(document(), UseCounter::HTMLImageElementComposite)
; |
203 } else { | 205 } else { |
204 HTMLElement::parseAttribute(name, value); | 206 HTMLElement::parseAttribute(name, value); |
205 } | 207 } |
206 } | 208 } |
207 | 209 |
208 const AtomicString& HTMLImageElement::altText() const | 210 const AtomicString& HTMLImageElement::altText() const |
209 { | 211 { |
210 // lets figure out the alt text.. magic stuff | 212 // lets figure out the alt text.. magic stuff |
211 // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen | 213 // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen |
212 // also heavily discussed by Hixie on bugzilla | 214 // also heavily discussed by Hixie on bugzilla |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 } | 580 } |
579 imageLoader().updateFromElement(behavior); | 581 imageLoader().updateFromElement(behavior); |
580 } | 582 } |
581 | 583 |
582 const KURL& HTMLImageElement::sourceURL() const | 584 const KURL& HTMLImageElement::sourceURL() const |
583 { | 585 { |
584 return cachedImage()->response().url(); | 586 return cachedImage()->response().url(); |
585 } | 587 } |
586 | 588 |
587 } | 589 } |
OLD | NEW |