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