OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/HTMLImageFallbackHelper.h" | 5 #include "core/html/HTMLImageFallbackHelper.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/InputTypeNames.h" | 8 #include "core/InputTypeNames.h" |
9 #include "core/dom/ElementRareData.h" | 9 #include "core/dom/ElementRareData.h" |
10 #include "core/dom/Text.h" | 10 #include "core/dom/Text.h" |
11 #include "core/dom/shadow/ShadowRoot.h" | 11 #include "core/dom/shadow/ShadowRoot.h" |
12 #include "core/fetch/ImageResource.h" | 12 #include "core/fetch/ImageResource.h" |
13 #include "core/html/HTMLDivElement.h" | 13 #include "core/html/HTMLDivElement.h" |
14 #include "core/html/HTMLElement.h" | 14 #include "core/html/HTMLElement.h" |
15 #include "core/html/HTMLImageElement.h" | 15 #include "core/html/HTMLImageElement.h" |
16 #include "core/html/HTMLImageLoader.h" | 16 #include "core/html/HTMLImageLoader.h" |
17 #include "core/html/HTMLInputElement.h" | 17 #include "core/html/HTMLInputElement.h" |
18 #include "core/html/HTMLStyleElement.h" | 18 #include "core/html/HTMLStyleElement.h" |
19 #include "wtf/PassOwnPtr.h" | |
20 #include "wtf/text/StringBuilder.h" | 19 #include "wtf/text/StringBuilder.h" |
21 | 20 |
22 namespace blink { | 21 namespace blink { |
23 | 22 |
24 using namespace HTMLNames; | 23 using namespace HTMLNames; |
25 | 24 |
26 static bool noImageSourceSpecified(const Element& element) | 25 static bool noImageSourceSpecified(const Element& element) |
27 { | 26 { |
28 bool noSrcSpecified = !element.hasAttribute(srcAttr) || element.getAttribute
(srcAttr).isNull() || element.getAttribute(srcAttr).isEmpty(); | 27 bool noSrcSpecified = !element.hasAttribute(srcAttr) || element.getAttribute
(srcAttr).isNull() || element.getAttribute(srcAttr).isEmpty(); |
29 bool noSrcsetSpecified = !element.hasAttribute(srcsetAttr) || element.getAtt
ribute(srcsetAttr).isNull() || element.getAttribute(srcsetAttr).isEmpty(); | 28 bool noSrcsetSpecified = !element.hasAttribute(srcsetAttr) || element.getAtt
ribute(srcsetAttr).isNull() || element.getAttribute(srcsetAttr).isEmpty(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // This preserves legacy behaviour originally defined when alt-text was mana
ged by LayoutImage. | 104 // This preserves legacy behaviour originally defined when alt-text was mana
ged by LayoutImage. |
106 if (noImageSourceSpecified(element)) | 105 if (noImageSourceSpecified(element)) |
107 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); | 106 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
108 else | 107 else |
109 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); | 108 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); |
110 | 109 |
111 return newStyle; | 110 return newStyle; |
112 } | 111 } |
113 | 112 |
114 } // namespace blink | 113 } // namespace blink |
OLD | NEW |