Chromium Code Reviews| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 { | 82 { |
| 83 RenderBlock::styleDidChange(diff, oldStyle); | 83 RenderBlock::styleDidChange(diff, oldStyle); |
| 84 | 84 |
| 85 if (m_inner) // RenderBlock handled updating the anonymous block's style. | 85 if (m_inner) // RenderBlock handled updating the anonymous block's style. |
| 86 setupInnerStyle(m_inner->style()); | 86 setupInnerStyle(m_inner->style()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void RenderButton::setupInnerStyle(RenderStyle* innerStyle) | 89 void RenderButton::setupInnerStyle(RenderStyle* innerStyle) |
| 90 { | 90 { |
| 91 ASSERT(innerStyle->refCount() == 1); | 91 ASSERT(innerStyle->refCount() == 1); |
| 92 // RenderBlock::createAnonymousBlock creates a new RenderStyle, so this is | |
|
cbiesinger
2014/05/13 07:58:27
You need to keep this comment.
harpreet.sk
2014/05/13 09:30:44
I will keep this comment in next patch.
| |
| 93 // safe to modify. | |
| 94 innerStyle->setFlexGrow(1.0f); | |
|
cbiesinger
2014/05/13 07:58:27
Why remove this line?
harpreet.sk
2014/05/13 09:30:44
Actually i removed this line as this line will dis
| |
| 95 // Use margin:auto instead of align-items:center to get safe centering, i.e. | 92 // Use margin:auto instead of align-items:center to get safe centering, i.e. |
| 96 // when the content overflows, treat it the same as align-items: flex-start. | 93 // when the content overflows, treat it the same as align-items: flex-start. |
| 97 innerStyle->setMarginTop(Length()); | 94 innerStyle->setMarginTop(Length()); |
| 98 innerStyle->setMarginBottom(Length()); | 95 innerStyle->setMarginBottom(Length()); |
| 96 | |
| 97 if (innerStyle->textAlign() == LEFT || innerStyle->textAlign() == WEBKIT_LEF T) { | |
| 98 innerStyle->setMarginRight(Length()); | |
| 99 } else if (innerStyle->textAlign() == RIGHT || innerStyle->textAlign() == WE BKIT_RIGHT) { | |
| 100 innerStyle->setMarginLeft(Length()); | |
| 101 } else { | |
| 102 innerStyle->setMarginLeft(Length()); | |
| 103 innerStyle->setMarginRight(Length()); | |
| 104 } | |
| 105 | |
| 99 innerStyle->setFlexDirection(style()->flexDirection()); | 106 innerStyle->setFlexDirection(style()->flexDirection()); |
| 100 } | 107 } |
| 101 | 108 |
| 102 bool RenderButton::canHaveGeneratedChildren() const | 109 bool RenderButton::canHaveGeneratedChildren() const |
| 103 { | 110 { |
| 104 // Input elements can't have generated children, but button elements can. We 'll | 111 // Input elements can't have generated children, but button elements can. We 'll |
| 105 // write the code assuming any other button types that might emerge in the f uture | 112 // write the code assuming any other button types that might emerge in the f uture |
| 106 // can also have children. | 113 // can also have children. |
| 107 return !isHTMLInputElement(*node()); | 114 return !isHTMLInputElement(*node()); |
| 108 } | 115 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 125 // baseline for the empty case manually here. | 132 // baseline for the empty case manually here. |
| 126 if (direction == HorizontalLine) | 133 if (direction == HorizontalLine) |
| 127 return marginTop() + borderTop() + paddingTop() + contentHeight(); | 134 return marginTop() + borderTop() + paddingTop() + contentHeight(); |
| 128 | 135 |
| 129 return marginRight() + borderRight() + paddingRight() + contentWidth(); | 136 return marginRight() + borderRight() + paddingRight() + contentWidth(); |
| 130 } | 137 } |
| 131 return RenderFlexibleBox::baselinePosition(baseline, firstLine, direction, l inePositionMode); | 138 return RenderFlexibleBox::baselinePosition(baseline, firstLine, direction, l inePositionMode); |
| 132 } | 139 } |
| 133 | 140 |
| 134 } // namespace WebCore | 141 } // namespace WebCore |
| OLD | NEW |