| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/html/HTMLImageFallbackHelper.h" | 6 #include "core/html/HTMLImageFallbackHelper.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/InputTypeNames.h" | 9 #include "core/InputTypeNames.h" |
| 10 #include "core/dom/ElementRareData.h" | 10 #include "core/dom/ElementRareData.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 placeHolder->setInlineStyleProperty(CSSPropertyHeight, 100, CSSPrimitive
Value::CSS_PERCENTAGE); | 97 placeHolder->setInlineStyleProperty(CSSPropertyHeight, 100, CSSPrimitive
Value::CSS_PERCENTAGE); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Make sure the broken image icon appears on the appropriate side of the im
age for the element's writing direction. | 100 // Make sure the broken image icon appears on the appropriate side of the im
age for the element's writing direction. |
| 101 brokenImage->setInlineStyleProperty(CSSPropertyFloat, AtomicString(newStyle-
>direction() == LTR ? "left" : "right")); | 101 brokenImage->setInlineStyleProperty(CSSPropertyFloat, AtomicString(newStyle-
>direction() == LTR ? "left" : "right")); |
| 102 | 102 |
| 103 // This is an <img> with no attributes, so don't display anything. | 103 // This is an <img> with no attributes, so don't display anything. |
| 104 if (noImageSourceSpecified(element) && !newStyle->width().isSpecifiedOrIntri
nsic() && !newStyle->height().isSpecifiedOrIntrinsic() && toHTMLElement(element)
.altText().isEmpty()) | 104 if (noImageSourceSpecified(element) && !newStyle->width().isSpecifiedOrIntri
nsic() && !newStyle->height().isSpecifiedOrIntrinsic() && toHTMLElement(element)
.altText().isEmpty()) |
| 105 newStyle->setDisplay(NONE); | 105 newStyle->setDisplay(NONE); |
| 106 | 106 |
| 107 // This preserves legacy behaviour originally defined when alt-text was mana
ged by RenderImage. | 107 // This preserves legacy behaviour originally defined when alt-text was mana
ged by LayoutImage. |
| 108 if (noImageSourceSpecified(element)) | 108 if (noImageSourceSpecified(element)) |
| 109 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); | 109 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
| 110 else | 110 else |
| 111 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); | 111 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); |
| 112 | 112 |
| 113 return newStyle; | 113 return newStyle; |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| OLD | NEW |