| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (newStyle->width().isSpecifiedOrIntrinsic() && newStyle->height().isSpeci
fiedOrIntrinsic()) { | 92 if (newStyle->width().isSpecifiedOrIntrinsic() && newStyle->height().isSpeci
fiedOrIntrinsic()) { |
| 93 placeHolder->setInlineStyleProperty(CSSPropertyWidth, 100, CSSPrimitiveV
alue::UnitType::Percentage); | 93 placeHolder->setInlineStyleProperty(CSSPropertyWidth, 100, CSSPrimitiveV
alue::UnitType::Percentage); |
| 94 placeHolder->setInlineStyleProperty(CSSPropertyHeight, 100, CSSPrimitive
Value::UnitType::Percentage); | 94 placeHolder->setInlineStyleProperty(CSSPropertyHeight, 100, CSSPrimitive
Value::UnitType::Percentage); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Make sure the broken image icon appears on the appropriate side of the im
age for the element's writing direction. | 97 // Make sure the broken image icon appears on the appropriate side of the im
age for the element's writing direction. |
| 98 brokenImage->setInlineStyleProperty(CSSPropertyFloat, AtomicString(newStyle-
>direction() == LTR ? "left" : "right")); | 98 brokenImage->setInlineStyleProperty(CSSPropertyFloat, AtomicString(newStyle-
>direction() == LTR ? "left" : "right")); |
| 99 | 99 |
| 100 // This is an <img> with no attributes, so don't display anything. | 100 // This is an <img> with no attributes, so don't display anything. |
| 101 if (noImageSourceSpecified(element) && !newStyle->width().isSpecifiedOrIntri
nsic() && !newStyle->height().isSpecifiedOrIntrinsic() && toHTMLElement(element)
.altText().isEmpty()) | 101 if (noImageSourceSpecified(element) && !newStyle->width().isSpecifiedOrIntri
nsic() && !newStyle->height().isSpecifiedOrIntrinsic() && toHTMLElement(element)
.altText().isEmpty()) |
| 102 newStyle->setDisplay(NONE); | 102 newStyle->setDisplay(EDisplay::None); |
| 103 | 103 |
| 104 // 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. |
| 105 if (noImageSourceSpecified(element)) | 105 if (noImageSourceSpecified(element)) |
| 106 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); | 106 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone); |
| 107 else | 107 else |
| 108 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); | 108 brokenImage->setInlineStyleProperty(CSSPropertyDisplay, CSSValueInline); |
| 109 | 109 |
| 110 return newStyle; | 110 return newStyle; |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |