OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 return 0; | 517 return 0; |
518 case CSSValueLeft: | 518 case CSSValueLeft: |
519 ASSERT(isHorizontal); | 519 ASSERT(isHorizontal); |
520 return 0; | 520 return 0; |
521 case CSSValueBottom: | 521 case CSSValueBottom: |
522 ASSERT(!isHorizontal); | 522 ASSERT(!isHorizontal); |
523 return size.height(); | 523 return size.height(); |
524 case CSSValueRight: | 524 case CSSValueRight: |
525 ASSERT(isHorizontal); | 525 ASSERT(isHorizontal); |
526 return size.width(); | 526 return size.width(); |
| 527 case CSSValueCenter: |
| 528 return origin + sign * .5f * edgeDistance; |
527 default: | 529 default: |
528 break; | 530 break; |
529 } | 531 } |
530 | 532 |
531 return origin + sign * primitiveValue->computeLength<float>(conversionData); | 533 return origin + sign * primitiveValue->computeLength<float>(conversionData); |
532 } | 534 } |
533 | 535 |
534 FloatPoint CSSGradientValue::computeEndPoint(CSSValue* horizontal, CSSValue* ver
tical, const CSSToLengthConversionData& conversionData, const IntSize& size) | 536 FloatPoint CSSGradientValue::computeEndPoint(CSSValue* horizontal, CSSValue* ver
tical, const CSSToLengthConversionData& conversionData, const IntSize& size) |
535 { | 537 { |
536 FloatPoint result; | 538 FloatPoint result; |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 visitor->trace(m_firstRadius); | 1220 visitor->trace(m_firstRadius); |
1219 visitor->trace(m_secondRadius); | 1221 visitor->trace(m_secondRadius); |
1220 visitor->trace(m_shape); | 1222 visitor->trace(m_shape); |
1221 visitor->trace(m_sizingBehavior); | 1223 visitor->trace(m_sizingBehavior); |
1222 visitor->trace(m_endHorizontalSize); | 1224 visitor->trace(m_endHorizontalSize); |
1223 visitor->trace(m_endVerticalSize); | 1225 visitor->trace(m_endVerticalSize); |
1224 CSSGradientValue::traceAfterDispatch(visitor); | 1226 CSSGradientValue::traceAfterDispatch(visitor); |
1225 } | 1227 } |
1226 | 1228 |
1227 } // namespace blink | 1229 } // namespace blink |
OLD | NEW |