| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2005 Apple Computer, Inc. | 2 * Copyright (C) 2005 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } else { | 59 } else { |
| 60 m_inner->removeChild(oldChild); | 60 m_inner->removeChild(oldChild); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 void LayoutButton::updateAnonymousChildStyle(const LayoutObject& child, Computed
Style& childStyle) const | 64 void LayoutButton::updateAnonymousChildStyle(const LayoutObject& child, Computed
Style& childStyle) const |
| 65 { | 65 { |
| 66 ASSERT(!m_inner || &child == m_inner); | 66 ASSERT(!m_inner || &child == m_inner); |
| 67 | 67 |
| 68 childStyle.setFlexGrow(1.0f); | 68 childStyle.setFlexGrow(1.0f); |
| 69 // min-width: 0; is needed for correct shrinking. |
| 70 childStyle.setMinWidth(Length(0, Fixed)); |
| 69 // Use margin:auto instead of align-items:center to get safe centering, i.e. | 71 // Use margin:auto instead of align-items:center to get safe centering, i.e. |
| 70 // when the content overflows, treat it the same as align-items: flex-start. | 72 // when the content overflows, treat it the same as align-items: flex-start. |
| 71 childStyle.setMarginTop(Length()); | 73 childStyle.setMarginTop(Length()); |
| 72 childStyle.setMarginBottom(Length()); | 74 childStyle.setMarginBottom(Length()); |
| 73 childStyle.setFlexDirection(style()->flexDirection()); | 75 childStyle.setFlexDirection(style()->flexDirection()); |
| 74 childStyle.setJustifyContent(style()->justifyContent()); | 76 childStyle.setJustifyContent(style()->justifyContent()); |
| 75 childStyle.setFlexWrap(style()->flexWrap()); | 77 childStyle.setFlexWrap(style()->flexWrap()); |
| 76 childStyle.setAlignItems(style()->alignItems()); | 78 childStyle.setAlignItems(style()->alignItems()); |
| 77 childStyle.setAlignContent(style()->alignContent()); | 79 childStyle.setAlignContent(style()->alignContent()); |
| 78 } | 80 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 103 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); | 105 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); |
| 104 } | 106 } |
| 105 | 107 |
| 106 | 108 |
| 107 // For compatibility with IE/FF we only clip overflow on input elements. | 109 // For compatibility with IE/FF we only clip overflow on input elements. |
| 108 bool LayoutButton::hasControlClip() const | 110 bool LayoutButton::hasControlClip() const |
| 109 { | 111 { |
| 110 return !isHTMLButtonElement(node()); | 112 return !isHTMLButtonElement(node()); |
| 111 } | 113 } |
| 112 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |