| 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" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 brokenImage->setInlineStyleProperty( | 117 brokenImage->setInlineStyleProperty( |
| 118 CSSPropertyFloat, | 118 CSSPropertyFloat, |
| 119 AtomicString(newStyle->direction() == TextDirection::kLtr ? "left" | 119 AtomicString(newStyle->direction() == TextDirection::kLtr ? "left" |
| 120 : "right")); | 120 : "right")); |
| 121 | 121 |
| 122 // This is an <img> with no attributes, so don't display anything. | 122 // This is an <img> with no attributes, so don't display anything. |
| 123 if (noImageSourceSpecified(element) && | 123 if (noImageSourceSpecified(element) && |
| 124 !newStyle->width().isSpecifiedOrIntrinsic() && | 124 !newStyle->width().isSpecifiedOrIntrinsic() && |
| 125 !newStyle->height().isSpecifiedOrIntrinsic() && | 125 !newStyle->height().isSpecifiedOrIntrinsic() && |
| 126 toHTMLElement(element).altText().isEmpty()) | 126 toHTMLElement(element).altText().isEmpty()) |
| 127 newStyle->setDisplay(EDisplay::None); | 127 newStyle->setDisplay(EDisplay::kNone); |
| 128 | 128 |
| 129 // This preserves legacy behaviour originally defined when alt-text was | 129 // This preserves legacy behaviour originally defined when alt-text was |
| 130 // managed by LayoutImage. | 130 // managed by LayoutImage. |
| 131 if (noImageSourceSpecified(element)) | 131 if (noImageSourceSpecified(element)) |
| 132 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); | 132 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
| 133 else | 133 else |
| 134 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); | 134 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); |
| 135 | 135 |
| 136 return newStyle; | 136 return newStyle; |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |