Changeset 260705 in webkit
- Timestamp:
- Apr 25, 2020 9:08:46 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r260701 r260705 1 2020-04-25 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] KeyframeEffect should ensure its target remains alive 4 https://bugs.webkit.org/show_bug.cgi?id=211019 5 6 Reviewed by Daniel Bates. 7 8 Add a test that creates a KeyframeEffect targeting an element with no other reference and trigger 9 garbage collection to check that the effect's target exists. This test would have failed prior to 10 this patch's code changes. 11 12 * webanimations/keyframe-effect-target-kept-alive-expected.txt: Added. 13 * webanimations/keyframe-effect-target-kept-alive.html: Added. 14 1 15 2020-04-25 Diego Pino Garcia <dpino@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r260703 r260705 1 2020-04-25 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] KeyframeEffect should ensure its target remains alive 4 https://bugs.webkit.org/show_bug.cgi?id=211019 5 6 Reviewed by Daniel Bates. 7 8 Test: webanimations/keyframe-effect-target-kept-alive.html 9 10 Make KeyframeEffect::m_target a RefPtr so that assigning an element to effect.target guarantees that element 11 is kept alive even if there are no other references to that element. 12 13 * animation/KeyframeEffect.cpp: 14 (WebCore::KeyframeEffect::KeyframeEffect): 15 (WebCore::KeyframeEffect::setTarget): 16 * animation/KeyframeEffect.h: 17 1 18 2020-04-25 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r260671 r260705 529 529 530 530 KeyframeEffect::KeyframeEffect(Element* target, PseudoId pseudoId) 531 : m_target( makeWeakPtr(target))531 : m_target(target) 532 532 , m_pseudoId(pseudoId) 533 533 { … … 1122 1122 void KeyframeEffect::setTarget(RefPtr<Element>&& newTarget) 1123 1123 { 1124 if (m_target .get() == newTarget.get())1124 if (m_target == newTarget) 1125 1125 return; 1126 1126 1127 1127 auto* previousTargetElementOrPseudoElement = targetElementOrPseudoElement(); 1128 m_target = makeWeakPtr(newTarget.get());1128 m_target = WTFMove(newTarget); 1129 1129 didChangeTargetElementOrPseudoElement(previousTargetElementOrPseudoElement); 1130 1130 } -
trunk/Source/WebCore/animation/KeyframeEffect.h
r260671 r260705 203 203 Vector<ParsedKeyframe> m_parsedKeyframes; 204 204 Vector<AcceleratedAction> m_pendingAcceleratedActions; 205 WeakPtr<Element> m_target;205 RefPtr<Element> m_target; 206 206 PseudoId m_pseudoId { PseudoId::None }; 207 207 std::unique_ptr<const RenderStyle> m_unanimatedStyle;
Note: See TracChangeset
for help on using the changeset viewer.