Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: efdff18b6475b6b448bdc036864b7a1c9d6c77f4
      
https://github.com/WebKit/WebKit/commit/efdff18b6475b6b448bdc036864b7a1c9d6c77f4
  Author: Elijah Sawyers <[email protected]>
  Date:   2026-10-14 (Wed, 14 Oct 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIAlarms.cpp
    M Tools/Scripts/webkitpy/api_tests/allowlist.txt
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift

  Log Message:
  -----------
  alarms.onAlarm reports the next scheduledTime for repeating alarms when the 
background was unloaded
https://bugs.webkit.org/show_bug.cgi?id=327454
rdar://189951123

Reviewed by Brian Weinstein and Timothy Hatcher.

This patch captures an alarm's parameters at the moment it fires, so the 
onAlarm event reports the
time the alarm was scheduled to fire even when the event has to wait for the 
background content to
load.

Previously fireAlarmsEventIfNeeded() captured a reference to the alarm and read 
its parameters when
the event was sent. If the non-persistent background content was unloaded, that 
was deferred until
the background finished loading, by which point WebExtensionAlarm::fire() had 
already advanced
nextScheduledTime for repeating alarms. The event then reported the next 
occurrence, the same value
returned by browser.alarms.get().

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift

* Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIAlarms.cpp:
(WebKit::WebExtensionContext::fireAlarmsEventIfNeeded):
* Tools/Scripts/webkitpy/api_tests/allowlist.txt:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift:
(WKWebExtensionAPIAlarmsTests.repeatingScheduledTimeWithUnloadedBackground):

Canonical link: https://commits.webkit.org/323752@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to