[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTi...
[WebKit-https.git] / Source / WebCore / page / DOMTimer.cpp
index c8a313d..56c9a29 100644 (file)
@@ -236,6 +236,14 @@ void DOMTimer::removeById(ScriptExecutionContext& context, int timeoutId)
     if (timeoutId <= 0)
         return;
 
+#if PLATFORM(IOS_FAMILY)
+    if (is<Document>(context) && downcast<Document>(context).page()) {
+        auto& document = downcast<Document>(context);
+        if (auto* timer = document.findTimeout(timeoutId))
+            document.page()->contentChangeObserver().didRemoveDOMTimer(*timer);
+    }
+#endif
+
     if (NestedTimersMap* nestedTimers = NestedTimersMap::instanceForContext(context))
         nestedTimers->remove(timeoutId);