Changeset 255141 in webkit
- Timestamp:
- Jan 27, 2020, 4:01:21 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r255138 r255141 1 2020-01-26 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Update all DocumentTimeline objects when updating animations 4 https://bugs.webkit.org/show_bug.cgi?id=206819 5 6 Reviewed by Antti Koivisto. 7 8 Mark a single new WPT progression. 9 10 * web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt: 11 1 12 2020-01-27 Rob Buis <rbuis@igalia.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt
r255076 r255141 39 39 PASS Does NOT remove an animation after making a redundant change to another animation's effect's properties 40 40 PASS Does NOT remove an animation after making a redundant change to its effect's properties 41 FAIL Updates ALL timelines before checking for replacement assert_equals: expected "removed" but got "active" 41 PASS Updates ALL timelines before checking for replacement 42 42 PASS Dispatches remove events after finish events 43 43 PASS Fires remove event before requestAnimationFrame -
trunk/Source/WebCore/ChangeLog
r255136 r255141 1 2020-01-26 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Update all DocumentTimeline objects when updating animations 4 https://bugs.webkit.org/show_bug.cgi?id=206819 5 6 Reviewed by Antti Koivisto. 7 8 Developers can create additional DocumentTimeline objects in JavaScript using that class's constructor, and an animation can be 9 assigned to that timeline after its creation. Until now we would only update an timeline created by a Document when that document's 10 animations were updated. Now we keep track of all DocumentTimeline objects that are created for a given Document as a vector of weak 11 references, and we update all of them when updating a document's animations. 12 13 * animation/DocumentTimeline.cpp: 14 (WebCore::DocumentTimeline::DocumentTimeline): 15 (WebCore::DocumentTimeline::~DocumentTimeline): 16 * animation/DocumentTimeline.h: 17 * dom/Document.cpp: 18 (WebCore::Document::updateAnimationsAndSendEvents): 19 (WebCore::Document::addTimeline): 20 (WebCore::Document::removeTimeline): 21 * dom/Document.h: 22 1 23 2020-01-26 Darin Adler <darin@apple.com> 2 24 -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r255131 r255141 63 63 , m_originTime(originTime) 64 64 { 65 if (m_document) 66 m_document->addTimeline(*this); 65 67 if (m_document && m_document->page() && !m_document->page()->isVisible()) 66 68 suspendAnimations(); 67 69 } 68 70 69 DocumentTimeline::~DocumentTimeline() = default; 71 DocumentTimeline::~DocumentTimeline() 72 { 73 if (m_document) 74 m_document->removeTimeline(*this); 75 } 70 76 71 77 void DocumentTimeline::detachFromDocument() -
trunk/Source/WebCore/animation/DocumentTimeline.h
r255131 r255141 32 32 #include <wtf/Markable.h> 33 33 #include <wtf/Ref.h> 34 #include <wtf/WeakPtr.h> 34 35 35 36 namespace WebCore { … … 38 39 class RenderElement; 39 40 40 class DocumentTimeline final : public AnimationTimeline 41 class DocumentTimeline final : public AnimationTimeline, public CanMakeWeakPtr<DocumentTimeline> 41 42 { 42 43 public: -
trunk/Source/WebCore/dom/Document.cpp
r255131 r255141 6353 6353 void Document::updateAnimationsAndSendEvents(DOMHighResTimeStamp timestamp) 6354 6354 { 6355 if (m_timeline) 6356 m_timeline->updateAnimationsAndSendEvents(timestamp); 6355 ASSERT(!m_timelines.hasNullReferences()); 6356 // We need to copy m_timelines before iterating over its members since calling updateAnimationsAndSendEvents() may mutate m_timelines. 6357 Vector<RefPtr<DocumentTimeline>> timelines; 6358 for (auto& timeline : m_timelines) 6359 timelines.append(&timeline); 6360 for (auto& timeline : timelines) 6361 timeline->updateAnimationsAndSendEvents(timestamp); 6357 6362 } 6358 6363 … … 8039 8044 } 8040 8045 8046 void Document::addTimeline(DocumentTimeline& timeline) 8047 { 8048 m_timelines.add(timeline); 8049 } 8050 8051 void Document::removeTimeline(DocumentTimeline& timeline) 8052 { 8053 m_timelines.remove(timeline); 8054 } 8055 8041 8056 DocumentTimeline& Document::timeline() 8042 8057 { -
trunk/Source/WebCore/dom/Document.h
r254785 r255141 1472 1472 WEBCORE_EXPORT void setConsoleMessageListener(RefPtr<StringCallback>&&); // For testing. 1473 1473 1474 void addTimeline(DocumentTimeline&); 1475 void removeTimeline(DocumentTimeline&); 1474 1476 WEBCORE_EXPORT DocumentTimeline& timeline(); 1475 1477 DocumentTimeline* existingTimeline() const { return m_timeline.get(); } … … 2038 2040 2039 2041 RefPtr<DocumentTimeline> m_timeline; 2042 WeakHashSet<DocumentTimeline> m_timelines; 2043 2040 2044 DocumentIdentifier m_identifier; 2041 2045
Note:
See TracChangeset
for help on using the changeset viewer.