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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // violated. | 54 // violated. |
55 if (oldChild == m_inner || !m_inner || oldChild->parent() == this) { | 55 if (oldChild == m_inner || !m_inner || oldChild->parent() == this) { |
56 ASSERT(oldChild == m_inner || !m_inner); | 56 ASSERT(oldChild == m_inner || !m_inner); |
57 LayoutFlexibleBox::removeChild(oldChild); | 57 LayoutFlexibleBox::removeChild(oldChild); |
58 m_inner = 0; | 58 m_inner = 0; |
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, LayoutSt
yle& 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 // Use margin:auto instead of align-items:center to get safe centering, i.e. | 69 // 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. | 70 // when the content overflows, treat it the same as align-items: flex-start. |
71 childStyle.setMarginTop(Length()); | 71 childStyle.setMarginTop(Length()); |
72 childStyle.setMarginBottom(Length()); | 72 childStyle.setMarginBottom(Length()); |
73 childStyle.setFlexDirection(style()->flexDirection()); | 73 childStyle.setFlexDirection(style()->flexDirection()); |
74 childStyle.setJustifyContent(style()->justifyContent()); | 74 childStyle.setJustifyContent(style()->justifyContent()); |
(...skipping 30 matching lines...) Expand all Loading... |
105 // baseline for the empty case manually here. | 105 // baseline for the empty case manually here. |
106 if (direction == HorizontalLine) { | 106 if (direction == HorizontalLine) { |
107 return marginTop() + size().height() - borderBottom() - paddingBotto
m() - horizontalScrollbarHeight(); | 107 return marginTop() + size().height() - borderBottom() - paddingBotto
m() - horizontalScrollbarHeight(); |
108 } | 108 } |
109 return marginRight() + size().width() - borderLeft() - paddingLeft() - v
erticalScrollbarWidth(); | 109 return marginRight() + size().width() - borderLeft() - paddingLeft() - v
erticalScrollbarWidth(); |
110 } | 110 } |
111 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); | 111 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); |
112 } | 112 } |
113 | 113 |
114 } // namespace blink | 114 } // namespace blink |
OLD | NEW |