| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 // However, as soon as some content is entered, the line boxes will be | 1126 // However, as soon as some content is entered, the line boxes will be |
| 1127 // constructed and this kludge is not called any more. So only the caret size | 1127 // constructed and this kludge is not called any more. So only the caret size |
| 1128 // of an empty :first-line'd block is wrong. I think we can live with that. | 1128 // of an empty :first-line'd block is wrong. I think we can live with that. |
| 1129 const ComputedStyle& currentStyle = firstLineStyleRef(); | 1129 const ComputedStyle& currentStyle = firstLineStyleRef(); |
| 1130 | 1130 |
| 1131 enum CaretAlignment { AlignLeft, AlignRight, AlignCenter }; | 1131 enum CaretAlignment { AlignLeft, AlignRight, AlignCenter }; |
| 1132 | 1132 |
| 1133 CaretAlignment alignment = AlignLeft; | 1133 CaretAlignment alignment = AlignLeft; |
| 1134 | 1134 |
| 1135 switch (currentStyle.textAlign()) { | 1135 switch (currentStyle.textAlign()) { |
| 1136 case ETextAlign::Left: | 1136 case ETextAlign::kLeft: |
| 1137 case ETextAlign::WebkitLeft: | 1137 case ETextAlign::kWebkitLeft: |
| 1138 break; | 1138 break; |
| 1139 case ETextAlign::Center: | 1139 case ETextAlign::kCenter: |
| 1140 case ETextAlign::WebkitCenter: | 1140 case ETextAlign::kWebkitCenter: |
| 1141 alignment = AlignCenter; | 1141 alignment = AlignCenter; |
| 1142 break; | 1142 break; |
| 1143 case ETextAlign::Right: | 1143 case ETextAlign::kRight: |
| 1144 case ETextAlign::WebkitRight: | 1144 case ETextAlign::kWebkitRight: |
| 1145 alignment = AlignRight; | 1145 alignment = AlignRight; |
| 1146 break; | 1146 break; |
| 1147 case ETextAlign::Justify: | 1147 case ETextAlign::kJustify: |
| 1148 case ETextAlign::Start: | 1148 case ETextAlign::kStart: |
| 1149 if (!currentStyle.isLeftToRightDirection()) | 1149 if (!currentStyle.isLeftToRightDirection()) |
| 1150 alignment = AlignRight; | 1150 alignment = AlignRight; |
| 1151 break; | 1151 break; |
| 1152 case ETextAlign::End: | 1152 case ETextAlign::kEnd: |
| 1153 if (currentStyle.isLeftToRightDirection()) | 1153 if (currentStyle.isLeftToRightDirection()) |
| 1154 alignment = AlignRight; | 1154 alignment = AlignRight; |
| 1155 break; | 1155 break; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 LayoutUnit x = borderLeft() + paddingLeft(); | 1158 LayoutUnit x = borderLeft() + paddingLeft(); |
| 1159 LayoutUnit maxX = width - borderRight() - paddingRight(); | 1159 LayoutUnit maxX = width - borderRight() - paddingRight(); |
| 1160 | 1160 |
| 1161 switch (alignment) { | 1161 switch (alignment) { |
| 1162 case AlignLeft: | 1162 case AlignLeft: |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 if (rootElementStyle->hasBackground()) | 1340 if (rootElementStyle->hasBackground()) |
| 1341 return false; | 1341 return false; |
| 1342 | 1342 |
| 1343 if (node() != document().firstBodyElement()) | 1343 if (node() != document().firstBodyElement()) |
| 1344 return false; | 1344 return false; |
| 1345 | 1345 |
| 1346 return true; | 1346 return true; |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 } // namespace blink | 1349 } // namespace blink |
| OLD | NEW |