Changeset 228412 in webkit
- Timestamp:
- Feb 12, 2018 5:28:27 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r228333 r228412 1 2018-02-12 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Support the copy constructors for KeyframeEffectReadOnly and KeyframeEffect 4 https://bugs.webkit.org/show_bug.cgi?id=182712 5 6 Reviewed by Dean Jackson. 7 8 Update test expectations for tests relevant to the copy constructors. 9 10 * web-platform-tests/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt: 11 * web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt: 12 1 13 2018-02-08 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt
r228333 r228412 1 1 2 FAIL Copied KeyframeEffectReadOnly has the same target Not enough arguments 3 FAIL Copied KeyframeEffectReadOnly has the same keyframes Not enough arguments 4 FAIL Copied KeyframeEffectReadOnly has the same KeyframeEffectOptions Not enough arguments 5 FAIL Copied KeyframeEffectReadOnly has the same timing content Not enough arguments 6 FAIL KeyframeEffect constructed from a KeyframeEffectReadOnly is mutable Not enough arguments 2 PASS Copied KeyframeEffectReadOnly has the same target 3 PASS Copied KeyframeEffectReadOnly has the same keyframes 4 PASS Copied KeyframeEffectReadOnly has the same KeyframeEffectOptions 5 PASS Copied KeyframeEffectReadOnly has the same timing content 6 PASS KeyframeEffect constructed from a KeyframeEffectReadOnly is mutable 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt
r228333 r228412 8 8 PASS AnimationEffectReadOnly interface: operation getComputedTiming() 9 9 PASS KeyframeEffectReadOnly interface: existence and properties of interface object 10 FAIL KeyframeEffectReadOnly interface object length assert_equals: wrong value for KeyframeEffectReadOnly.length expected 1 but got 2 10 PASS KeyframeEffectReadOnly interface object length 11 11 PASS KeyframeEffectReadOnly interface object name 12 12 PASS KeyframeEffectReadOnly interface: existence and properties of interface prototype object … … 25 25 PASS AnimationEffectReadOnly interface: new KeyframeEffectReadOnly(null, null) must inherit property "getComputedTiming()" with the proper type 26 26 PASS KeyframeEffect interface: existence and properties of interface object 27 FAIL KeyframeEffect interface object length assert_equals: wrong value for KeyframeEffect.length expected 1 but got 2 27 PASS KeyframeEffect interface object length 28 28 PASS KeyframeEffect interface object name 29 29 PASS KeyframeEffect interface: existence and properties of interface prototype object -
trunk/Source/WebCore/ChangeLog
r228400 r228412 1 2018-02-12 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Support the copy constructors for KeyframeEffectReadOnly and KeyframeEffect 4 https://bugs.webkit.org/show_bug.cgi?id=182712 5 6 Reviewed by Dean Jackson. 7 8 We now support the variants for the KeyframeEffectReadOnly and KeyframeEffect constructors where 9 another KeyframeEffectReadOnly is provided as a source. All timing, keyframe and target properties 10 of that source are copied on the newly-constructed KeyframeEffect. 11 12 To support copying properties, we add new copyPropertiesFromSource() methods to 13 AnimationEffectTimingReadOnly and KeyframeEffectReadOnly to encapsulate copying various 14 member variables in the relevant classes. Copying properties of the backing KeyframeList 15 is performed in KeyframeEffectReadOnly::copyPropertiesFromSource() via public KeyframeList 16 methods. 17 18 * animation/AnimationEffectTimingReadOnly.cpp: 19 (WebCore::AnimationEffectTimingReadOnly::copyPropertiesFromSource): 20 * animation/AnimationEffectTimingReadOnly.h: 21 * animation/KeyframeEffect.cpp: 22 (WebCore::KeyframeEffect::create): 23 * animation/KeyframeEffect.h: 24 * animation/KeyframeEffect.idl: 25 * animation/KeyframeEffectOptions.idl: 26 * animation/KeyframeEffectReadOnly.cpp: 27 (WebCore::KeyframeEffectReadOnly::create): 28 (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource): 29 * animation/KeyframeEffectReadOnly.h: 30 * animation/KeyframeEffectReadOnly.idl: 31 1 32 2018-02-12 Zalan Bujtas <zalan@apple.com> 2 33 -
trunk/Source/WebCore/animation/AnimationEffectTimingReadOnly.cpp
r228333 r228412 79 79 80 80 return { }; 81 } 82 83 void AnimationEffectTimingReadOnly::copyPropertiesFromSource(AnimationEffectTimingReadOnly* source) 84 { 85 m_fill = source->m_fill; 86 m_delay = source->m_delay; 87 m_endDelay = source->m_endDelay; 88 m_direction = source->m_direction; 89 m_iterations = source->m_iterations; 90 m_timingFunction = source->m_timingFunction; 91 m_iterationStart = source->m_iterationStart; 92 m_iterationDuration = source->m_iterationDuration; 81 93 } 82 94 -
trunk/Source/WebCore/animation/AnimationEffectTimingReadOnly.h
r228333 r228412 49 49 50 50 ExceptionOr<void> setProperties(std::optional<Variant<double, KeyframeEffectOptions>>&&); 51 void copyPropertiesFromSource(AnimationEffectTimingReadOnly*); 51 52 52 53 double bindingsDelay() const { return secondsToWebAnimationsAPITime(m_delay); } -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r228333 r228412 45 45 } 46 46 47 ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(JSC::ExecState&, Ref<KeyframeEffectReadOnly>&& source) 48 { 49 auto keyframeEffect = adoptRef(*new KeyframeEffect(AnimationEffectTiming::create(), nullptr)); 50 keyframeEffect->copyPropertiesFromSource(WTFMove(source)); 51 return WTFMove(keyframeEffect); 52 } 53 47 54 KeyframeEffect::KeyframeEffect(Ref<AnimationEffectTimingReadOnly>&& timing, Element* target) 48 55 : KeyframeEffectReadOnly(KeyframeEffectClass, WTFMove(timing), target) -
trunk/Source/WebCore/animation/KeyframeEffect.h
r228333 r228412 39 39 public: 40 40 static ExceptionOr<Ref<KeyframeEffect>> create(JSC::ExecState&, Element*, JSC::Strong<JSC::JSObject>&&, std::optional<Variant<double, KeyframeEffectOptions>>&&); 41 static ExceptionOr<Ref<KeyframeEffect>> create(JSC::ExecState&, Ref<KeyframeEffectReadOnly>&&); 41 42 ~KeyframeEffect() { } 42 43 -
trunk/Source/WebCore/animation/KeyframeEffect.idl
r228333 r228412 29 29 ConstructorMayThrowException, 30 30 ConstructorCallWith=ScriptState, 31 Constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options) 31 Constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options), 32 Constructor(KeyframeEffectReadOnly source) 32 33 ] interface KeyframeEffect : KeyframeEffectReadOnly { 33 34 inherit attribute IterationCompositeOperation iterationComposite; -
trunk/Source/WebCore/animation/KeyframeEffectOptions.idl
r226289 r228412 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 1 25 2 26 dictionary KeyframeEffectOptions : AnimationEffectTimingProperties { -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp
r228333 r228412 400 400 } 401 401 402 ExceptionOr<Ref<KeyframeEffectReadOnly>> KeyframeEffectReadOnly::create(JSC::ExecState&, Ref<KeyframeEffectReadOnly>&& source) 403 { 404 auto keyframeEffect = adoptRef(*new KeyframeEffectReadOnly(KeyframeEffectReadOnlyClass, AnimationEffectTimingReadOnly::create(), nullptr)); 405 keyframeEffect->copyPropertiesFromSource(WTFMove(source)); 406 return WTFMove(keyframeEffect); 407 } 408 402 409 KeyframeEffectReadOnly::KeyframeEffectReadOnly(ClassType classType, Ref<AnimationEffectTimingReadOnly>&& timing, Element* target) 403 410 : AnimationEffectReadOnly(classType, WTFMove(timing)) … … 405 412 , m_keyframes(emptyString()) 406 413 { 414 } 415 416 void KeyframeEffectReadOnly::copyPropertiesFromSource(Ref<KeyframeEffectReadOnly>&& source) 417 { 418 m_target = source->m_target; 419 m_offsets = source->m_offsets; 420 m_timingFunctions = source->m_timingFunctions; 421 m_compositeOperation = source->m_compositeOperation; 422 m_compositeOperations = source->m_compositeOperations; 423 m_iterationCompositeOperation = source->m_iterationCompositeOperation; 424 425 timing()->copyPropertiesFromSource(source->timing()); 426 427 KeyframeList keyframeList("keyframe-effect-" + createCanonicalUUIDString()); 428 for (auto& keyframe : source->m_keyframes.keyframes()) { 429 KeyframeValue keyframeValue(keyframe.key(), RenderStyle::clonePtr(*keyframe.style())); 430 for (auto propertyId : keyframe.properties()) 431 keyframeValue.addProperty(propertyId); 432 keyframeList.insert(WTFMove(keyframeValue)); 433 } 434 m_keyframes = WTFMove(keyframeList); 407 435 } 408 436 -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.h
r228333 r228412 45 45 public: 46 46 static ExceptionOr<Ref<KeyframeEffectReadOnly>> create(JSC::ExecState&, Element*, JSC::Strong<JSC::JSObject>&&, std::optional<Variant<double, KeyframeEffectOptions>>&&); 47 static ExceptionOr<Ref<KeyframeEffectReadOnly>> create(JSC::ExecState&, Ref<KeyframeEffectReadOnly>&&); 47 48 ~KeyframeEffectReadOnly() { } 48 49 … … 99 100 100 101 protected: 102 void copyPropertiesFromSource(Ref<KeyframeEffectReadOnly>&&); 101 103 ExceptionOr<void> processKeyframes(JSC::ExecState&, JSC::Strong<JSC::JSObject>&&); 104 102 105 IterationCompositeOperation m_iterationCompositeOperation { IterationCompositeOperation::Replace }; 103 106 CompositeOperation m_compositeOperation { CompositeOperation::Replace }; -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.idl
r228333 r228412 27 27 EnabledAtRuntime=WebAnimations, 28 28 Exposed=Window, 29 JSGenerateToNativeObject, 29 30 ConstructorMayThrowException, 30 31 ConstructorCallWith=ScriptState, 31 Constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options) 32 Constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options), 33 Constructor(KeyframeEffectReadOnly source) 32 34 ] interface KeyframeEffectReadOnly : AnimationEffectReadOnly { 33 35 readonly attribute Element? target;
Note: See TracChangeset
for help on using the changeset viewer.