| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 LayoutRect oldLegendFrameRect = legend->frameRect(); | 62 LayoutRect oldLegendFrameRect = legend->frameRect(); |
| 63 | 63 |
| 64 if (relayoutChildren) | 64 if (relayoutChildren) |
| 65 legend->setNeedsLayoutAndFullPaintInvalidation( | 65 legend->setNeedsLayoutAndFullPaintInvalidation( |
| 66 LayoutInvalidationReason::FieldsetChanged); | 66 LayoutInvalidationReason::FieldsetChanged); |
| 67 legend->layoutIfNeeded(); | 67 legend->layoutIfNeeded(); |
| 68 | 68 |
| 69 LayoutUnit logicalLeft; | 69 LayoutUnit logicalLeft; |
| 70 if (style()->isLeftToRightDirection()) { | 70 if (style()->isLeftToRightDirection()) { |
| 71 switch (legend->style()->textAlign()) { | 71 switch (legend->style()->textAlign()) { |
| 72 case ETextAlign::Center: | 72 case ETextAlign::kCenter: |
| 73 logicalLeft = (logicalWidth() - logicalWidthForChild(*legend)) / 2; | 73 logicalLeft = (logicalWidth() - logicalWidthForChild(*legend)) / 2; |
| 74 break; | 74 break; |
| 75 case ETextAlign::Right: | 75 case ETextAlign::kRight: |
| 76 logicalLeft = logicalWidth() - borderEnd() - paddingEnd() - | 76 logicalLeft = logicalWidth() - borderEnd() - paddingEnd() - |
| 77 logicalWidthForChild(*legend); | 77 logicalWidthForChild(*legend); |
| 78 break; | 78 break; |
| 79 default: | 79 default: |
| 80 logicalLeft = | 80 logicalLeft = |
| 81 borderStart() + paddingStart() + marginStartForChild(*legend); | 81 borderStart() + paddingStart() + marginStartForChild(*legend); |
| 82 break; | 82 break; |
| 83 } | 83 } |
| 84 } else { | 84 } else { |
| 85 switch (legend->style()->textAlign()) { | 85 switch (legend->style()->textAlign()) { |
| 86 case ETextAlign::Left: | 86 case ETextAlign::kLeft: |
| 87 logicalLeft = borderStart() + paddingStart(); | 87 logicalLeft = borderStart() + paddingStart(); |
| 88 break; | 88 break; |
| 89 case ETextAlign::Center: { | 89 case ETextAlign::kCenter: { |
| 90 // Make sure that the extra pixel goes to the end side in RTL (since | 90 // Make sure that the extra pixel goes to the end side in RTL (since |
| 91 // it went to the end side in LTR). | 91 // it went to the end side in LTR). |
| 92 LayoutUnit centeredWidth = | 92 LayoutUnit centeredWidth = |
| 93 logicalWidth() - logicalWidthForChild(*legend); | 93 logicalWidth() - logicalWidthForChild(*legend); |
| 94 logicalLeft = centeredWidth - centeredWidth / 2; | 94 logicalLeft = centeredWidth - centeredWidth / 2; |
| 95 break; | 95 break; |
| 96 } | 96 } |
| 97 default: | 97 default: |
| 98 logicalLeft = logicalWidth() - borderStart() - paddingStart() - | 98 logicalLeft = logicalWidth() - borderStart() - paddingStart() - |
| 99 marginStartForChild(*legend) - | 99 marginStartForChild(*legend) - |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const LayoutPoint& paintOffset) const { | 154 const LayoutPoint& paintOffset) const { |
| 155 FieldsetPainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset); | 155 FieldsetPainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void LayoutFieldset::paintMask(const PaintInfo& paintInfo, | 158 void LayoutFieldset::paintMask(const PaintInfo& paintInfo, |
| 159 const LayoutPoint& paintOffset) const { | 159 const LayoutPoint& paintOffset) const { |
| 160 FieldsetPainter(*this).paintMask(paintInfo, paintOffset); | 160 FieldsetPainter(*this).paintMask(paintInfo, paintOffset); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace blink | 163 } // namespace blink |
| OLD | NEW |