| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // can also have children. | 108 // can also have children. |
| 109 return !isHTMLInputElement(*node()); | 109 return !isHTMLInputElement(*node()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 LayoutRect RenderButton::controlClipRect(const LayoutPoint& additionalOffset) co
nst | 112 LayoutRect RenderButton::controlClipRect(const LayoutPoint& additionalOffset) co
nst |
| 113 { | 113 { |
| 114 // Clip to the padding box to at least give content the extra padding space. | 114 // Clip to the padding box to at least give content the extra padding space. |
| 115 return LayoutRect(additionalOffset.x() + borderLeft(), additionalOffset.y()
+ borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); | 115 return LayoutRect(additionalOffset.x() + borderLeft(), additionalOffset.y()
+ borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 int RenderButton::baselinePosition(FontBaseline baseline, bool firstLine, LineDi
rectionMode direction, LinePositionMode linePositionMode) const | 118 int RenderButton::baselinePosition(FontBaseline baseline, OwnOrFirstLineStyle fi
rstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const |
| 119 { | 119 { |
| 120 ASSERT(linePositionMode == PositionOnContainingLine); | 120 ASSERT(linePositionMode == PositionOnContainingLine); |
| 121 // We want to call the RenderBlock version of firstLineBoxBaseline to | 121 // We want to call the RenderBlock version of firstLineBoxBaseline to |
| 122 // avoid RenderFlexibleBox synthesizing a baseline that we don't want. | 122 // avoid RenderFlexibleBox synthesizing a baseline that we don't want. |
| 123 // We use this check as a proxy for "are there any line boxes in this button
" | 123 // We use this check as a proxy for "are there any line boxes in this button
" |
| 124 if (!hasLineIfEmpty() && RenderBlock::firstLineBoxBaseline() == -1) { | 124 if (!hasLineIfEmpty() && RenderBlock::firstLineBoxBaseline() == -1) { |
| 125 // To ensure that we have a consistent baseline when we have no children
, | 125 // To ensure that we have a consistent baseline when we have no children
, |
| 126 // even when we have the anonymous RenderBlock child, we calculate the | 126 // even when we have the anonymous RenderBlock child, we calculate the |
| 127 // baseline for the empty case manually here. | 127 // baseline for the empty case manually here. |
| 128 if (direction == HorizontalLine) | 128 if (direction == HorizontalLine) |
| 129 return marginTop() + borderTop() + paddingTop() + contentHeight(); | 129 return marginTop() + borderTop() + paddingTop() + contentHeight(); |
| 130 | 130 |
| 131 return marginRight() + borderRight() + paddingRight() + contentWidth(); | 131 return marginRight() + borderRight() + paddingRight() + contentWidth(); |
| 132 } | 132 } |
| 133 return RenderFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); | 133 return RenderFlexibleBox::baselinePosition(baseline, firstLine, direction, l
inePositionMode); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace WebCore | 136 } // namespace WebCore |
| OLD | NEW |