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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLImageLoader.cpp

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: rebase Created 3 years, 6 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
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, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 toHTMLInputElement(GetElement())->EnsureFallbackContent(); 68 toHTMLInputElement(GetElement())->EnsureFallbackContent();
69 } 69 }
70 70
71 void HTMLImageLoader::ImageNotifyFinished(ImageResourceContent*) { 71 void HTMLImageLoader::ImageNotifyFinished(ImageResourceContent*) {
72 ImageResourceContent* cached_image = GetImage(); 72 ImageResourceContent* cached_image = GetImage();
73 Element* element = this->GetElement(); 73 Element* element = this->GetElement();
74 ImageLoader::ImageNotifyFinished(cached_image); 74 ImageLoader::ImageNotifyFinished(cached_image);
75 75
76 bool load_error = cached_image->ErrorOccurred(); 76 bool load_error = cached_image->ErrorOccurred();
77 if (isHTMLImageElement(*element)) { 77 if (isHTMLImageElement(*element)) {
78 toHTMLImageElement(element)->ImageNotifyFinished(!load_error);
78 if (load_error) 79 if (load_error)
79 toHTMLImageElement(element)->EnsureCollapsedOrFallbackContent(); 80 toHTMLImageElement(element)->EnsureCollapsedOrFallbackContent();
80 else 81 else
81 toHTMLImageElement(element)->EnsurePrimaryContent(); 82 toHTMLImageElement(element)->EnsurePrimaryContent();
82 } 83 }
83 84
84 if (isHTMLInputElement(*element)) { 85 if (isHTMLInputElement(*element)) {
85 if (load_error) 86 if (load_error)
86 toHTMLInputElement(element)->EnsureFallbackContent(); 87 toHTMLInputElement(element)->EnsureFallbackContent();
87 else 88 else
88 toHTMLInputElement(element)->EnsurePrimaryContent(); 89 toHTMLInputElement(element)->EnsurePrimaryContent();
89 } 90 }
90 91
91 if ((load_error || cached_image->GetResponse().HttpStatusCode() >= 400) && 92 if ((load_error || cached_image->GetResponse().HttpStatusCode() >= 400) &&
92 isHTMLObjectElement(*element)) 93 isHTMLObjectElement(*element))
93 toHTMLObjectElement(element)->RenderFallbackContent(); 94 toHTMLObjectElement(element)->RenderFallbackContent();
94 } 95 }
95 96
96 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.idl ('k') | third_party/WebKit/Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698