Changeset 281188 in webkit
- Timestamp:
- Aug 18, 2021, 8:25:04 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
html/LazyLoadFrameObserver.cpp (modified) (1 diff)
-
html/LazyLoadImageObserver.cpp (modified) (1 diff)
-
page/IntersectionObserver.cpp (modified) (1 diff)
-
page/IntersectionObserverCallback.h (modified) (1 diff)
-
page/ResizeObserver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r281185 r281188 1 2021-08-18 Chris Dumez <cdumez@apple.com> 2 3 Crash under JSIntersectionObserverCallback::handleEvent() 4 https://bugs.webkit.org/show_bug.cgi?id=229196 5 <rdar://82016054> 6 7 Reviewed by Geoffrey Garen. 8 9 Early return in IntersectionObserver::notify() if the callback has already been destroyed. 10 This is not supposed to happen as we're supposed to be keeping the JSIntersectionObserver 11 wrapper alive as long as the IntersectionObserver may fire events, which should keep the 12 callback alive too. However, despite Ryosuke's fix in r280549, the crash is still happening 13 in the wild. To address the crash, I am simply doing an early return for now, similarly to 14 what we already do in MutationObserver::deliver(), while keeping a debug assertion around 15 in hope of finding the root cause at some point. 16 17 No new tests, we do not not how this is happening yet. 18 19 * page/IntersectionObserver.cpp: 20 (WebCore::IntersectionObserver::notify): 21 1 22 2021-08-18 Martin Robinson <mrobinson@webkit.org> 2 23 -
trunk/Source/WebCore/html/LazyLoadFrameObserver.cpp
r279800 r281188 44 44 45 45 private: 46 bool hasCallback() const final { return true; } 47 46 48 CallbackResult<void> handleEvent(IntersectionObserver&, const Vector<Ref<IntersectionObserverEntry>>& entries, IntersectionObserver&) final 47 49 { -
trunk/Source/WebCore/html/LazyLoadImageObserver.cpp
r279800 r281188 44 44 45 45 private: 46 bool hasCallback() const final { return true; } 47 46 48 CallbackResult<void> handleEvent(IntersectionObserver&, const Vector<Ref<IntersectionObserverEntry>>& entries, IntersectionObserver&) final 47 49 { -
trunk/Source/WebCore/page/IntersectionObserver.cpp
r280549 r281188 274 274 } 275 275 276 auto takenRecords = takeRecords(); 277 278 // FIXME: The JSIntersectionObserver wrapper should be kept alive as long as the intersection observer can fire events. 279 ASSERT(m_callback->hasCallback()); 280 if (!m_callback->hasCallback()) 281 return; 282 276 283 auto* context = m_callback->scriptExecutionContext(); 277 284 if (!context) 278 285 return; 279 280 auto takenRecords = takeRecords();281 286 282 287 InspectorInstrumentation::willFireObserverCallback(*context, "IntersectionObserver"_s); -
trunk/Source/WebCore/page/IntersectionObserverCallback.h
r269141 r281188 42 42 using ActiveDOMCallback::ActiveDOMCallback; 43 43 44 virtual bool hasCallback() const { return false; }44 virtual bool hasCallback() const = 0; 45 45 46 46 virtual CallbackResult<void> handleEvent(IntersectionObserver&, const Vector<Ref<IntersectionObserverEntry>>&, IntersectionObserver&) = 0; -
trunk/Source/WebCore/page/ResizeObserver.cpp
r280551 r281188 125 125 auto activeObservationTargets = std::exchange(m_activeObservationTargets, { }); 126 126 127 // FIXME: The JSResizeObserver wrapper should be kept alive as long as the resize observer can fire events. 128 ASSERT(m_callback->hasCallback()); 129 if (!m_callback->hasCallback()) 130 return; 131 127 132 auto* context = m_callback->scriptExecutionContext(); 128 133 if (!context)
Note:
See TracChangeset
for help on using the changeset viewer.