| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 LayoutRect oldLegendFrameRect = legend->frameRect(); | 126 LayoutRect oldLegendFrameRect = legend->frameRect(); |
| 127 | 127 |
| 128 if (relayoutChildren) | 128 if (relayoutChildren) |
| 129 legend->setNeedsLayoutAndFullPaintInvalidation( | 129 legend->setNeedsLayoutAndFullPaintInvalidation( |
| 130 LayoutInvalidationReason::FieldsetChanged); | 130 LayoutInvalidationReason::FieldsetChanged); |
| 131 legend->layoutIfNeeded(); | 131 legend->layoutIfNeeded(); |
| 132 | 132 |
| 133 LayoutUnit logicalLeft; | 133 LayoutUnit logicalLeft; |
| 134 if (style()->isLeftToRightDirection()) { | 134 if (style()->isLeftToRightDirection()) { |
| 135 switch (legend->style()->textAlign()) { | 135 switch (legend->style()->textAlign()) { |
| 136 case CENTER: | 136 case ETextAlign::Center: |
| 137 logicalLeft = (logicalWidth() - logicalWidthForChild(*legend)) / 2; | 137 logicalLeft = (logicalWidth() - logicalWidthForChild(*legend)) / 2; |
| 138 break; | 138 break; |
| 139 case RIGHT: | 139 case ETextAlign::Right: |
| 140 logicalLeft = logicalWidth() - borderEnd() - paddingEnd() - | 140 logicalLeft = logicalWidth() - borderEnd() - paddingEnd() - |
| 141 logicalWidthForChild(*legend); | 141 logicalWidthForChild(*legend); |
| 142 break; | 142 break; |
| 143 default: | 143 default: |
| 144 logicalLeft = | 144 logicalLeft = |
| 145 borderStart() + paddingStart() + marginStartForChild(*legend); | 145 borderStart() + paddingStart() + marginStartForChild(*legend); |
| 146 break; | 146 break; |
| 147 } | 147 } |
| 148 } else { | 148 } else { |
| 149 switch (legend->style()->textAlign()) { | 149 switch (legend->style()->textAlign()) { |
| 150 case LEFT: | 150 case ETextAlign::Left: |
| 151 logicalLeft = borderStart() + paddingStart(); | 151 logicalLeft = borderStart() + paddingStart(); |
| 152 break; | 152 break; |
| 153 case CENTER: { | 153 case ETextAlign::Center: { |
| 154 // Make sure that the extra pixel goes to the end side in RTL (since | 154 // Make sure that the extra pixel goes to the end side in RTL (since |
| 155 // it went to the end side in LTR). | 155 // it went to the end side in LTR). |
| 156 LayoutUnit centeredWidth = | 156 LayoutUnit centeredWidth = |
| 157 logicalWidth() - logicalWidthForChild(*legend); | 157 logicalWidth() - logicalWidthForChild(*legend); |
| 158 logicalLeft = centeredWidth - centeredWidth / 2; | 158 logicalLeft = centeredWidth - centeredWidth / 2; |
| 159 break; | 159 break; |
| 160 } | 160 } |
| 161 default: | 161 default: |
| 162 logicalLeft = logicalWidth() - borderStart() - paddingStart() - | 162 logicalLeft = logicalWidth() - borderStart() - paddingStart() - |
| 163 marginStartForChild(*legend) - | 163 marginStartForChild(*legend) - |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 LayoutFlexibleBox::removeChild(oldChild); | 296 LayoutFlexibleBox::removeChild(oldChild); |
| 297 m_innerBlock = nullptr; | 297 m_innerBlock = nullptr; |
| 298 } else if (oldChild->parent() == this) { | 298 } else if (oldChild->parent() == this) { |
| 299 LayoutFlexibleBox::removeChild(oldChild); | 299 LayoutFlexibleBox::removeChild(oldChild); |
| 300 } else if (m_innerBlock) { | 300 } else if (m_innerBlock) { |
| 301 m_innerBlock->removeChild(oldChild); | 301 m_innerBlock->removeChild(oldChild); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace blink | 305 } // namespace blink |
| OLD | NEW |