Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 if (value->isLength()) | 95 if (value->isLength()) |
| 96 return BorderImageLength(toAnimatableLength(value)->getLength( | 96 return BorderImageLength(toAnimatableLength(value)->getLength( |
| 97 state.style()->effectiveZoom(), ValueRangeNonNegative)); | 97 state.style()->effectiveZoom(), ValueRangeNonNegative)); |
| 98 if (value->isDouble()) | 98 if (value->isDouble()) |
| 99 return BorderImageLength( | 99 return BorderImageLength( |
| 100 clampTo<double>(toAnimatableDouble(value)->toDouble(), 0)); | 100 clampTo<double>(toAnimatableDouble(value)->toDouble(), 0)); |
| 101 ASSERT(toAnimatableUnknown(value)->toCSSValueID() == CSSValueAuto); | 101 ASSERT(toAnimatableUnknown(value)->toCSSValueID() == CSSValueAuto); |
| 102 return Length(Auto); | 102 return Length(Auto); |
| 103 } | 103 } |
| 104 | 104 |
| 105 template <typename T> | 105 double animatableValueToPixels(const AnimatableValue* value, |
| 106 T animatableValueClampTo(const AnimatableValue* value, | 106 const StyleResolverState& state) { |
| 107 T min = defaultMinimumForClamp<T>(), | 107 return toAnimatableLength(value) |
| 108 T max = defaultMaximumForClamp<T>()) { | 108 ->getLength(state.style()->effectiveZoom(), ValueRangeAll) |
| 109 static_assert(std::is_integral<T>::value, | 109 .pixels(); |
| 110 "should use integral type T when rounding values"); | |
| 111 return clampTo<T>( | |
| 112 roundForImpreciseConversion<T>(toAnimatableDouble(value)->toDouble()), | |
| 113 min, max); | |
| 114 } | 110 } |
| 115 | 111 |
| 116 template <typename T> | 112 template <typename T> |
| 117 T animatableLineWidthClamp(const AnimatableValue* value) { | 113 T roundedClampTo(double value, |
|
suzyh_UTC10 (ex-contributor)
2016/12/12 04:30:13
Is there any chance that the changes to function n
alancutter (OOO until 2018)
2016/12/13 02:36:34
Done.
| |
| 118 double doubleValue = toAnimatableDouble(value)->toDouble(); | 114 T min = defaultMinimumForClamp<T>(), |
| 115 T max = defaultMaximumForClamp<T>()) { | |
| 116 static_assert(std::is_integral<T>::value, | |
| 117 "should use integral type T when rounding values"); | |
| 118 return clampTo<T>(roundForImpreciseConversion<T>(value), min, max); | |
| 119 } | |
| 120 | |
| 121 template <typename T> | |
| 122 T animatableLineWidthClamp(const AnimatableValue* value, | |
| 123 const StyleResolverState& state) { | |
| 124 double lineWidth = animatableValueToPixels(value, state); | |
| 119 // This matches StyleBuilderConverter::convertLineWidth(). | 125 // This matches StyleBuilderConverter::convertLineWidth(). |
| 120 return (doubleValue > 0 && doubleValue < 1) | 126 return (lineWidth > 0 && lineWidth < 1) ? 1 : roundedClampTo<T>(lineWidth); |
| 121 ? 1 | |
| 122 : animatableValueClampTo<T>(value); | |
| 123 } | 127 } |
| 124 | 128 |
| 125 LengthBox animatableValueToLengthBox(const AnimatableValue* value, | 129 LengthBox animatableValueToLengthBox(const AnimatableValue* value, |
| 126 const StyleResolverState& state, | 130 const StyleResolverState& state, |
| 127 ValueRange range = ValueRangeAll) { | 131 ValueRange range = ValueRangeAll) { |
| 128 const AnimatableLengthBox* animatableLengthBox = toAnimatableLengthBox(value); | 132 const AnimatableLengthBox* animatableLengthBox = toAnimatableLengthBox(value); |
| 129 return LengthBox( | 133 return LengthBox( |
| 130 animatableValueToLength(animatableLengthBox->top(), state, range), | 134 animatableValueToLength(animatableLengthBox->top(), state, range), |
| 131 animatableValueToLength(animatableLengthBox->right(), state, range), | 135 animatableValueToLength(animatableLengthBox->right(), state, range), |
| 132 animatableValueToLength(animatableLengthBox->bottom(), state, range), | 136 animatableValueToLength(animatableLengthBox->bottom(), state, range), |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 156 | 160 |
| 157 TransformOrigin animatableValueToTransformOrigin( | 161 TransformOrigin animatableValueToTransformOrigin( |
| 158 const AnimatableValue* value, | 162 const AnimatableValue* value, |
| 159 const StyleResolverState& state, | 163 const StyleResolverState& state, |
| 160 ValueRange range = ValueRangeAll) { | 164 ValueRange range = ValueRangeAll) { |
| 161 const AnimatableLengthPoint3D* animatableLengthPoint3D = | 165 const AnimatableLengthPoint3D* animatableLengthPoint3D = |
| 162 toAnimatableLengthPoint3D(value); | 166 toAnimatableLengthPoint3D(value); |
| 163 return TransformOrigin( | 167 return TransformOrigin( |
| 164 animatableValueToLength(animatableLengthPoint3D->x(), state), | 168 animatableValueToLength(animatableLengthPoint3D->x(), state), |
| 165 animatableValueToLength(animatableLengthPoint3D->y(), state), | 169 animatableValueToLength(animatableLengthPoint3D->y(), state), |
| 166 clampTo<float>( | 170 animatableValueToPixels(animatableLengthPoint3D->z(), state)); |
| 167 toAnimatableDouble(animatableLengthPoint3D->z())->toDouble())); | |
| 168 } | 171 } |
| 169 | 172 |
| 170 LengthSize animatableValueToLengthSize(const AnimatableValue* value, | 173 LengthSize animatableValueToLengthSize(const AnimatableValue* value, |
| 171 const StyleResolverState& state, | 174 const StyleResolverState& state, |
| 172 ValueRange range) { | 175 ValueRange range) { |
| 173 const AnimatableLengthSize* animatableLengthSize = | 176 const AnimatableLengthSize* animatableLengthSize = |
| 174 toAnimatableLengthSize(value); | 177 toAnimatableLengthSize(value); |
| 175 return LengthSize( | 178 return LengthSize( |
| 176 animatableValueToLength(animatableLengthSize->width(), state, range), | 179 animatableValueToLength(animatableLengthSize->width(), state, range), |
| 177 animatableValueToLength(animatableLengthSize->height(), state, range)); | 180 animatableValueToLength(animatableLengthSize->height(), state, range)); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 return; | 348 return; |
| 346 case CSSPropertyBorderBottomLeftRadius: | 349 case CSSPropertyBorderBottomLeftRadius: |
| 347 style->setBorderBottomLeftRadius( | 350 style->setBorderBottomLeftRadius( |
| 348 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); | 351 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); |
| 349 return; | 352 return; |
| 350 case CSSPropertyBorderBottomRightRadius: | 353 case CSSPropertyBorderBottomRightRadius: |
| 351 style->setBorderBottomRightRadius( | 354 style->setBorderBottomRightRadius( |
| 352 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); | 355 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); |
| 353 return; | 356 return; |
| 354 case CSSPropertyBorderBottomWidth: | 357 case CSSPropertyBorderBottomWidth: |
| 355 style->setBorderBottomWidth(animatableLineWidthClamp<unsigned>(value)); | 358 style->setBorderBottomWidth( |
| 359 animatableLineWidthClamp<unsigned>(value, state)); | |
| 356 return; | 360 return; |
| 357 case CSSPropertyBorderImageOutset: | 361 case CSSPropertyBorderImageOutset: |
| 358 style->setBorderImageOutset( | 362 style->setBorderImageOutset( |
| 359 animatableValueToBorderImageLengthBox(value, state)); | 363 animatableValueToBorderImageLengthBox(value, state)); |
| 360 return; | 364 return; |
| 361 case CSSPropertyBorderImageSlice: | 365 case CSSPropertyBorderImageSlice: |
| 362 style->setBorderImageSlices( | 366 style->setBorderImageSlices( |
| 363 animatableValueToLengthBox(toAnimatableLengthBoxAndBool(value)->box(), | 367 animatableValueToLengthBox(toAnimatableLengthBoxAndBool(value)->box(), |
| 364 state, ValueRangeNonNegative)); | 368 state, ValueRangeNonNegative)); |
| 365 style->setBorderImageSlicesFill( | 369 style->setBorderImageSlicesFill( |
| 366 toAnimatableLengthBoxAndBool(value)->flag()); | 370 toAnimatableLengthBoxAndBool(value)->flag()); |
| 367 return; | 371 return; |
| 368 case CSSPropertyBorderImageSource: | 372 case CSSPropertyBorderImageSource: |
| 369 style->setBorderImageSource( | 373 style->setBorderImageSource( |
| 370 state.styleImage(property, *toAnimatableImage(value)->toCSSValue())); | 374 state.styleImage(property, *toAnimatableImage(value)->toCSSValue())); |
| 371 return; | 375 return; |
| 372 case CSSPropertyBorderImageWidth: | 376 case CSSPropertyBorderImageWidth: |
| 373 style->setBorderImageWidth( | 377 style->setBorderImageWidth( |
| 374 animatableValueToBorderImageLengthBox(value, state)); | 378 animatableValueToBorderImageLengthBox(value, state)); |
| 375 return; | 379 return; |
| 376 case CSSPropertyBorderLeftColor: | 380 case CSSPropertyBorderLeftColor: |
| 377 style->setBorderLeftColor(toAnimatableColor(value)->getColor()); | 381 style->setBorderLeftColor(toAnimatableColor(value)->getColor()); |
| 378 style->setVisitedLinkBorderLeftColor( | 382 style->setVisitedLinkBorderLeftColor( |
| 379 toAnimatableColor(value)->visitedLinkColor()); | 383 toAnimatableColor(value)->visitedLinkColor()); |
| 380 return; | 384 return; |
| 381 case CSSPropertyBorderLeftWidth: | 385 case CSSPropertyBorderLeftWidth: |
| 382 style->setBorderLeftWidth(animatableLineWidthClamp<unsigned>(value)); | 386 style->setBorderLeftWidth( |
| 387 animatableLineWidthClamp<unsigned>(value, state)); | |
| 383 return; | 388 return; |
| 384 case CSSPropertyBorderRightColor: | 389 case CSSPropertyBorderRightColor: |
| 385 style->setBorderRightColor(toAnimatableColor(value)->getColor()); | 390 style->setBorderRightColor(toAnimatableColor(value)->getColor()); |
| 386 style->setVisitedLinkBorderRightColor( | 391 style->setVisitedLinkBorderRightColor( |
| 387 toAnimatableColor(value)->visitedLinkColor()); | 392 toAnimatableColor(value)->visitedLinkColor()); |
| 388 return; | 393 return; |
| 389 case CSSPropertyBorderRightWidth: | 394 case CSSPropertyBorderRightWidth: |
| 390 style->setBorderRightWidth(animatableLineWidthClamp<unsigned>(value)); | 395 style->setBorderRightWidth( |
| 396 animatableLineWidthClamp<unsigned>(value, state)); | |
| 391 return; | 397 return; |
| 392 case CSSPropertyBorderTopColor: | 398 case CSSPropertyBorderTopColor: |
| 393 style->setBorderTopColor(toAnimatableColor(value)->getColor()); | 399 style->setBorderTopColor(toAnimatableColor(value)->getColor()); |
| 394 style->setVisitedLinkBorderTopColor( | 400 style->setVisitedLinkBorderTopColor( |
| 395 toAnimatableColor(value)->visitedLinkColor()); | 401 toAnimatableColor(value)->visitedLinkColor()); |
| 396 return; | 402 return; |
| 397 case CSSPropertyBorderTopLeftRadius: | 403 case CSSPropertyBorderTopLeftRadius: |
| 398 style->setBorderTopLeftRadius( | 404 style->setBorderTopLeftRadius( |
| 399 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); | 405 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); |
| 400 return; | 406 return; |
| 401 case CSSPropertyBorderTopRightRadius: | 407 case CSSPropertyBorderTopRightRadius: |
| 402 style->setBorderTopRightRadius( | 408 style->setBorderTopRightRadius( |
| 403 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); | 409 animatableValueToLengthSize(value, state, ValueRangeNonNegative)); |
| 404 return; | 410 return; |
| 405 case CSSPropertyBorderTopWidth: | 411 case CSSPropertyBorderTopWidth: |
| 406 style->setBorderTopWidth(animatableLineWidthClamp<unsigned>(value)); | 412 style->setBorderTopWidth( |
| 413 animatableLineWidthClamp<unsigned>(value, state)); | |
| 407 return; | 414 return; |
| 408 case CSSPropertyBottom: | 415 case CSSPropertyBottom: |
| 409 style->setBottom(animatableValueToLength(value, state)); | 416 style->setBottom(animatableValueToLength(value, state)); |
| 410 return; | 417 return; |
| 411 case CSSPropertyBoxShadow: | 418 case CSSPropertyBoxShadow: |
| 412 style->setBoxShadow(toAnimatableShadow(value)->getShadowList()); | 419 style->setBoxShadow(toAnimatableShadow(value)->getShadowList()); |
| 413 return; | 420 return; |
| 414 case CSSPropertyClip: | 421 case CSSPropertyClip: |
| 415 style->setClip(animatableValueToLengthBox(value, state)); | 422 style->setClip(animatableValueToLengthBox(value, state)); |
| 416 return; | 423 return; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 481 else | 488 else |
| 482 style->setLineHeight(Length( | 489 style->setLineHeight(Length( |
| 483 clampTo<float>(toAnimatableDouble(value)->toDouble(), 0), Percent)); | 490 clampTo<float>(toAnimatableDouble(value)->toDouble(), 0), Percent)); |
| 484 return; | 491 return; |
| 485 case CSSPropertyListStyleImage: | 492 case CSSPropertyListStyleImage: |
| 486 style->setListStyleImage( | 493 style->setListStyleImage( |
| 487 state.styleImage(property, *toAnimatableImage(value)->toCSSValue())); | 494 state.styleImage(property, *toAnimatableImage(value)->toCSSValue())); |
| 488 return; | 495 return; |
| 489 case CSSPropertyLetterSpacing: | 496 case CSSPropertyLetterSpacing: |
| 490 style->setLetterSpacing( | 497 style->setLetterSpacing( |
| 491 clampTo<float>(toAnimatableDouble(value)->toDouble())); | 498 clampTo<float>(animatableValueToPixels(value, state))); |
| 492 return; | 499 return; |
| 493 case CSSPropertyMarginBottom: | 500 case CSSPropertyMarginBottom: |
| 494 style->setMarginBottom(animatableValueToLength(value, state)); | 501 style->setMarginBottom(animatableValueToLength(value, state)); |
| 495 return; | 502 return; |
| 496 case CSSPropertyMarginLeft: | 503 case CSSPropertyMarginLeft: |
| 497 style->setMarginLeft(animatableValueToLength(value, state)); | 504 style->setMarginLeft(animatableValueToLength(value, state)); |
| 498 return; | 505 return; |
| 499 case CSSPropertyMarginRight: | 506 case CSSPropertyMarginRight: |
| 500 style->setMarginRight(animatableValueToLength(value, state)); | 507 style->setMarginRight(animatableValueToLength(value, state)); |
| 501 return; | 508 return; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 529 case CSSPropertyOrphans: | 536 case CSSPropertyOrphans: |
| 530 style->setOrphans( | 537 style->setOrphans( |
| 531 clampTo<short>(round(toAnimatableDouble(value)->toDouble()), 1)); | 538 clampTo<short>(round(toAnimatableDouble(value)->toDouble()), 1)); |
| 532 return; | 539 return; |
| 533 case CSSPropertyOutlineColor: | 540 case CSSPropertyOutlineColor: |
| 534 style->setOutlineColor(toAnimatableColor(value)->getColor()); | 541 style->setOutlineColor(toAnimatableColor(value)->getColor()); |
| 535 style->setVisitedLinkOutlineColor( | 542 style->setVisitedLinkOutlineColor( |
| 536 toAnimatableColor(value)->visitedLinkColor()); | 543 toAnimatableColor(value)->visitedLinkColor()); |
| 537 return; | 544 return; |
| 538 case CSSPropertyOutlineOffset: | 545 case CSSPropertyOutlineOffset: |
| 539 style->setOutlineOffset(animatableValueClampTo<int>(value)); | 546 style->setOutlineOffset( |
| 547 roundedClampTo<int>(animatableValueToPixels(value, state))); | |
| 540 return; | 548 return; |
| 541 case CSSPropertyOutlineWidth: | 549 case CSSPropertyOutlineWidth: |
| 542 style->setOutlineWidth(animatableLineWidthClamp<unsigned short>(value)); | 550 style->setOutlineWidth( |
| 551 animatableLineWidthClamp<unsigned short>(value, state)); | |
| 543 return; | 552 return; |
| 544 case CSSPropertyPaddingBottom: | 553 case CSSPropertyPaddingBottom: |
| 545 style->setPaddingBottom( | 554 style->setPaddingBottom( |
| 546 animatableValueToLength(value, state, ValueRangeNonNegative)); | 555 animatableValueToLength(value, state, ValueRangeNonNegative)); |
| 547 return; | 556 return; |
| 548 case CSSPropertyPaddingLeft: | 557 case CSSPropertyPaddingLeft: |
| 549 style->setPaddingLeft( | 558 style->setPaddingLeft( |
| 550 animatableValueToLength(value, state, ValueRangeNonNegative)); | 559 animatableValueToLength(value, state, ValueRangeNonNegative)); |
| 551 return; | 560 return; |
| 552 case CSSPropertyPaddingRight: | 561 case CSSPropertyPaddingRight: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 605 case CSSPropertyTextIndent: | 614 case CSSPropertyTextIndent: |
| 606 style->setTextIndent(animatableValueToLength(value, state)); | 615 style->setTextIndent(animatableValueToLength(value, state)); |
| 607 return; | 616 return; |
| 608 case CSSPropertyTextShadow: | 617 case CSSPropertyTextShadow: |
| 609 style->setTextShadow(toAnimatableShadow(value)->getShadowList()); | 618 style->setTextShadow(toAnimatableShadow(value)->getShadowList()); |
| 610 return; | 619 return; |
| 611 case CSSPropertyTop: | 620 case CSSPropertyTop: |
| 612 style->setTop(animatableValueToLength(value, state)); | 621 style->setTop(animatableValueToLength(value, state)); |
| 613 return; | 622 return; |
| 614 case CSSPropertyWebkitBorderHorizontalSpacing: | 623 case CSSPropertyWebkitBorderHorizontalSpacing: |
| 615 style->setHorizontalBorderSpacing( | 624 style->setHorizontalBorderSpacing(roundedClampTo<unsigned short>( |
| 616 animatableValueClampTo<unsigned short>(value)); | 625 animatableValueToPixels(value, state))); |
| 617 return; | 626 return; |
| 618 case CSSPropertyWebkitBorderVerticalSpacing: | 627 case CSSPropertyWebkitBorderVerticalSpacing: |
| 619 style->setVerticalBorderSpacing( | 628 style->setVerticalBorderSpacing(roundedClampTo<unsigned short>( |
| 620 animatableValueClampTo<unsigned short>(value)); | 629 animatableValueToPixels(value, state))); |
| 621 return; | 630 return; |
| 622 case CSSPropertyClipPath: | 631 case CSSPropertyClipPath: |
| 623 style->setClipPath( | 632 style->setClipPath( |
| 624 toAnimatableClipPathOperation(value)->getClipPathOperation()); | 633 toAnimatableClipPathOperation(value)->getClipPathOperation()); |
| 625 return; | 634 return; |
| 626 case CSSPropertyColumnCount: | 635 case CSSPropertyColumnCount: |
| 627 style->setColumnCount(clampTo<unsigned short>( | 636 style->setColumnCount(clampTo<unsigned short>( |
| 628 round(toAnimatableDouble(value)->toDouble()), 1)); | 637 round(toAnimatableDouble(value)->toDouble()), 1)); |
| 629 return; | 638 return; |
| 630 case CSSPropertyColumnGap: | 639 case CSSPropertyColumnGap: |
| 631 style->setColumnGap(clampTo(toAnimatableDouble(value)->toDouble(), 0)); | 640 style->setColumnGap(clampTo(animatableValueToPixels(value, state), 0)); |
| 632 return; | 641 return; |
| 633 case CSSPropertyColumnRuleColor: | 642 case CSSPropertyColumnRuleColor: |
| 634 style->setColumnRuleColor(toAnimatableColor(value)->getColor()); | 643 style->setColumnRuleColor(toAnimatableColor(value)->getColor()); |
| 635 style->setVisitedLinkColumnRuleColor( | 644 style->setVisitedLinkColumnRuleColor( |
| 636 toAnimatableColor(value)->visitedLinkColor()); | 645 toAnimatableColor(value)->visitedLinkColor()); |
| 637 return; | 646 return; |
| 638 case CSSPropertyColumnWidth: | 647 case CSSPropertyColumnWidth: |
| 639 style->setColumnWidth(clampTo(toAnimatableDouble(value)->toDouble(), | 648 style->setColumnWidth(clampTo(animatableValueToPixels(value, state), |
| 640 std::numeric_limits<float>::epsilon())); | 649 std::numeric_limits<float>::epsilon())); |
| 641 return; | 650 return; |
| 642 case CSSPropertyColumnRuleWidth: | 651 case CSSPropertyColumnRuleWidth: |
| 643 style->setColumnRuleWidth( | 652 style->setColumnRuleWidth( |
| 644 animatableLineWidthClamp<unsigned short>(value)); | 653 animatableLineWidthClamp<unsigned short>(value, state)); |
| 645 return; | 654 return; |
| 646 case CSSPropertyFilter: | 655 case CSSPropertyFilter: |
| 647 style->setFilter(toAnimatableFilterOperations(value)->operations()); | 656 style->setFilter(toAnimatableFilterOperations(value)->operations()); |
| 648 return; | 657 return; |
| 649 case CSSPropertyBackdropFilter: | 658 case CSSPropertyBackdropFilter: |
| 650 style->setBackdropFilter( | 659 style->setBackdropFilter( |
| 651 toAnimatableFilterOperations(value)->operations()); | 660 toAnimatableFilterOperations(value)->operations()); |
| 652 return; | 661 return; |
| 653 case CSSPropertyWebkitMaskBoxImageOutset: | 662 case CSSPropertyWebkitMaskBoxImageOutset: |
| 654 style->setMaskBoxImageOutset( | 663 style->setMaskBoxImageOutset( |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 680 case CSSPropertyWebkitMaskPositionY: | 689 case CSSPropertyWebkitMaskPositionY: |
| 681 setOnFillLayers<CSSPropertyWebkitMaskPositionY>(style->accessMaskLayers(), | 690 setOnFillLayers<CSSPropertyWebkitMaskPositionY>(style->accessMaskLayers(), |
| 682 value, state); | 691 value, state); |
| 683 return; | 692 return; |
| 684 case CSSPropertyWebkitMaskSize: | 693 case CSSPropertyWebkitMaskSize: |
| 685 setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), | 694 setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), |
| 686 value, state); | 695 value, state); |
| 687 return; | 696 return; |
| 688 case CSSPropertyPerspective: | 697 case CSSPropertyPerspective: |
| 689 style->setPerspective( | 698 style->setPerspective( |
| 690 value->isDouble() | 699 value->isLength() |
| 691 ? clampTo<float>(toAnimatableDouble(value)->toDouble()) | 700 ? clampTo<float>(animatableValueToPixels(value, state)) |
| 692 : 0); | 701 : 0); |
| 693 return; | 702 return; |
| 694 case CSSPropertyPerspectiveOrigin: | 703 case CSSPropertyPerspectiveOrigin: |
| 695 style->setPerspectiveOrigin(animatableValueToLengthPoint(value, state)); | 704 style->setPerspectiveOrigin(animatableValueToLengthPoint(value, state)); |
| 696 return; | 705 return; |
| 697 case CSSPropertyShapeOutside: | 706 case CSSPropertyShapeOutside: |
| 698 style->setShapeOutside(toAnimatableShapeValue(value)->getShapeValue()); | 707 style->setShapeOutside(toAnimatableShapeValue(value)->getShapeValue()); |
| 699 return; | 708 return; |
| 700 case CSSPropertyShapeMargin: | 709 case CSSPropertyShapeMargin: |
| 701 style->setShapeMargin( | 710 style->setShapeMargin( |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 775 case CSSPropertyWebkitPerspectiveOriginY: | 784 case CSSPropertyWebkitPerspectiveOriginY: |
| 776 style->setPerspectiveOriginY(animatableValueToLength(value, state)); | 785 style->setPerspectiveOriginY(animatableValueToLength(value, state)); |
| 777 return; | 786 return; |
| 778 case CSSPropertyWebkitTransformOriginX: | 787 case CSSPropertyWebkitTransformOriginX: |
| 779 style->setTransformOriginX(animatableValueToLength(value, state)); | 788 style->setTransformOriginX(animatableValueToLength(value, state)); |
| 780 return; | 789 return; |
| 781 case CSSPropertyWebkitTransformOriginY: | 790 case CSSPropertyWebkitTransformOriginY: |
| 782 style->setTransformOriginY(animatableValueToLength(value, state)); | 791 style->setTransformOriginY(animatableValueToLength(value, state)); |
| 783 return; | 792 return; |
| 784 case CSSPropertyWebkitTransformOriginZ: | 793 case CSSPropertyWebkitTransformOriginZ: |
| 785 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble()); | 794 style->setTransformOriginZ(animatableValueToPixels(value, state)); |
| 786 return; | 795 return; |
| 787 case CSSPropertyWidows: | 796 case CSSPropertyWidows: |
| 788 style->setWidows( | 797 style->setWidows( |
| 789 clampTo<short>(round(toAnimatableDouble(value)->toDouble()), 1)); | 798 clampTo<short>(round(toAnimatableDouble(value)->toDouble()), 1)); |
| 790 return; | 799 return; |
| 791 case CSSPropertyWidth: | 800 case CSSPropertyWidth: |
| 792 style->setWidth( | 801 style->setWidth( |
| 793 animatableValueToLength(value, state, ValueRangeNonNegative)); | 802 animatableValueToLength(value, state, ValueRangeNonNegative)); |
| 794 return; | 803 return; |
| 795 case CSSPropertyWordSpacing: | 804 case CSSPropertyWordSpacing: |
| 796 style->setWordSpacing( | 805 style->setWordSpacing( |
| 797 clampTo<float>(toAnimatableDouble(value)->toDouble())); | 806 clampTo<float>(animatableValueToPixels(value, state))); |
| 798 return; | 807 return; |
| 799 case CSSPropertyVerticalAlign: | 808 case CSSPropertyVerticalAlign: |
| 800 style->setVerticalAlignLength(animatableValueToLength(value, state)); | 809 style->setVerticalAlignLength(animatableValueToLength(value, state)); |
| 801 return; | 810 return; |
| 802 case CSSPropertyVisibility: | 811 case CSSPropertyVisibility: |
| 803 style->setVisibility(toAnimatableVisibility(value)->visibility()); | 812 style->setVisibility(toAnimatableVisibility(value)->visibility()); |
| 804 return; | 813 return; |
| 805 case CSSPropertyZIndex: | 814 case CSSPropertyZIndex: |
| 806 style->setZIndex( | 815 style->setZIndex( |
| 807 clampTo<int>(round(toAnimatableDouble(value)->toDouble()))); | 816 clampTo<int>(round(toAnimatableDouble(value)->toDouble()))); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 832 style->setRy( | 841 style->setRy( |
| 833 animatableValueToLength(value, state, ValueRangeNonNegative)); | 842 animatableValueToLength(value, state, ValueRangeNonNegative)); |
| 834 return; | 843 return; |
| 835 | 844 |
| 836 default: | 845 default: |
| 837 ASSERT_NOT_REACHED(); | 846 ASSERT_NOT_REACHED(); |
| 838 } | 847 } |
| 839 } | 848 } |
| 840 | 849 |
| 841 } // namespace blink | 850 } // namespace blink |
| OLD | NEW |