| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 | 1251 |
| 1252 // FIXME: Treating styled borders with initial color differently causes prob
lems | 1252 // FIXME: Treating styled borders with initial color differently causes prob
lems |
| 1253 // See crbug.com/316559, crbug.com/276231 | 1253 // See crbug.com/316559, crbug.com/276231 |
| 1254 if ((borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE |
| borderStyle == GROOVE)) | 1254 if ((borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE |
| borderStyle == GROOVE)) |
| 1255 return Color(238, 238, 238); | 1255 return Color(238, 238, 238); |
| 1256 return color(); | 1256 return color(); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 const BorderValue& RenderStyle::borderBefore() const | 1259 const BorderValue& RenderStyle::borderBefore() const |
| 1260 { | 1260 { |
| 1261 switch (writingMode()) { | 1261 // FIXME(sky): Remove |
| 1262 case TopToBottomWritingMode: | |
| 1263 return borderTop(); | |
| 1264 case BottomToTopWritingMode: | |
| 1265 return borderBottom(); | |
| 1266 case LeftToRightWritingMode: | |
| 1267 return borderLeft(); | |
| 1268 case RightToLeftWritingMode: | |
| 1269 return borderRight(); | |
| 1270 } | |
| 1271 ASSERT_NOT_REACHED(); | |
| 1272 return borderTop(); | 1262 return borderTop(); |
| 1273 } | 1263 } |
| 1274 | 1264 |
| 1275 const BorderValue& RenderStyle::borderAfter() const | 1265 const BorderValue& RenderStyle::borderAfter() const |
| 1276 { | 1266 { |
| 1277 switch (writingMode()) { | 1267 // FIXME(sky): Remove |
| 1278 case TopToBottomWritingMode: | |
| 1279 return borderBottom(); | |
| 1280 case BottomToTopWritingMode: | |
| 1281 return borderTop(); | |
| 1282 case LeftToRightWritingMode: | |
| 1283 return borderRight(); | |
| 1284 case RightToLeftWritingMode: | |
| 1285 return borderLeft(); | |
| 1286 } | |
| 1287 ASSERT_NOT_REACHED(); | |
| 1288 return borderBottom(); | 1268 return borderBottom(); |
| 1289 } | 1269 } |
| 1290 | 1270 |
| 1291 const BorderValue& RenderStyle::borderStart() const | 1271 const BorderValue& RenderStyle::borderStart() const |
| 1292 { | 1272 { |
| 1293 if (isHorizontalWritingMode()) | 1273 if (isHorizontalWritingMode()) |
| 1294 return isLeftToRightDirection() ? borderLeft() : borderRight(); | 1274 return isLeftToRightDirection() ? borderLeft() : borderRight(); |
| 1295 return isLeftToRightDirection() ? borderTop() : borderBottom(); | 1275 return isLeftToRightDirection() ? borderTop() : borderBottom(); |
| 1296 } | 1276 } |
| 1297 | 1277 |
| 1298 const BorderValue& RenderStyle::borderEnd() const | 1278 const BorderValue& RenderStyle::borderEnd() const |
| 1299 { | 1279 { |
| 1300 if (isHorizontalWritingMode()) | 1280 if (isHorizontalWritingMode()) |
| 1301 return isLeftToRightDirection() ? borderRight() : borderLeft(); | 1281 return isLeftToRightDirection() ? borderRight() : borderLeft(); |
| 1302 return isLeftToRightDirection() ? borderBottom() : borderTop(); | 1282 return isLeftToRightDirection() ? borderBottom() : borderTop(); |
| 1303 } | 1283 } |
| 1304 | 1284 |
| 1305 unsigned short RenderStyle::borderBeforeWidth() const | 1285 unsigned short RenderStyle::borderBeforeWidth() const |
| 1306 { | 1286 { |
| 1307 switch (writingMode()) { | 1287 // FIXME(sky): Remove |
| 1308 case TopToBottomWritingMode: | |
| 1309 return borderTopWidth(); | |
| 1310 case BottomToTopWritingMode: | |
| 1311 return borderBottomWidth(); | |
| 1312 case LeftToRightWritingMode: | |
| 1313 return borderLeftWidth(); | |
| 1314 case RightToLeftWritingMode: | |
| 1315 return borderRightWidth(); | |
| 1316 } | |
| 1317 ASSERT_NOT_REACHED(); | |
| 1318 return borderTopWidth(); | 1288 return borderTopWidth(); |
| 1319 } | 1289 } |
| 1320 | 1290 |
| 1321 unsigned short RenderStyle::borderAfterWidth() const | 1291 unsigned short RenderStyle::borderAfterWidth() const |
| 1322 { | 1292 { |
| 1323 switch (writingMode()) { | 1293 // FIXME(sky): Remove |
| 1324 case TopToBottomWritingMode: | |
| 1325 return borderBottomWidth(); | |
| 1326 case BottomToTopWritingMode: | |
| 1327 return borderTopWidth(); | |
| 1328 case LeftToRightWritingMode: | |
| 1329 return borderRightWidth(); | |
| 1330 case RightToLeftWritingMode: | |
| 1331 return borderLeftWidth(); | |
| 1332 } | |
| 1333 ASSERT_NOT_REACHED(); | |
| 1334 return borderBottomWidth(); | 1294 return borderBottomWidth(); |
| 1335 } | 1295 } |
| 1336 | 1296 |
| 1337 unsigned short RenderStyle::borderStartWidth() const | 1297 unsigned short RenderStyle::borderStartWidth() const |
| 1338 { | 1298 { |
| 1339 if (isHorizontalWritingMode()) | 1299 if (isHorizontalWritingMode()) |
| 1340 return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth()
; | 1300 return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth()
; |
| 1341 return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth(); | 1301 return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth(); |
| 1342 } | 1302 } |
| 1343 | 1303 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 // right | 1417 // right |
| 1458 radiiSum = radii.topRight().height() + radii.bottomRight().height(); | 1418 radiiSum = radii.topRight().height() + radii.bottomRight().height(); |
| 1459 if (radiiSum > rect.height()) | 1419 if (radiiSum > rect.height()) |
| 1460 factor = std::min(rect.height() / radiiSum, factor); | 1420 factor = std::min(rect.height() / radiiSum, factor); |
| 1461 | 1421 |
| 1462 ASSERT(factor <= 1); | 1422 ASSERT(factor <= 1); |
| 1463 return factor; | 1423 return factor; |
| 1464 } | 1424 } |
| 1465 | 1425 |
| 1466 } // namespace blink | 1426 } // namespace blink |
| OLD | NEW |