Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 10dd190e17e3d86b2b948141f284f10f2c5e3c80
      
https://github.com/WebKit/WebKit/commit/10dd190e17e3d86b2b948141f284f10f2c5e3c80
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-02 (Thu, 02 Jul 2026)

  Changed paths:
    M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp

  Log Message:
  -----------
  [Web Inspector] Unsigned underflow in power-efficient playback heuristic 
spuriously reports power efficiency in the DOM agent
https://bugs.webkit.org/show_bug.cgi?id=318424
rdar://181205602

Reviewed by Devin Rousso.

InspectorDOMAgent computed a video element's power-efficient playback
state with `(displayCompositedVideoFrames - lastDisplayCompositedFrames) > 0`.
Both operands are unsigned, so the subtraction wraps on any decrease and
`(a - b) > 0` is equivalent to `a != b`. When the cumulative composited
frame count drops between samples -- which can happen across a media
reload, source change, or pipeline reset -- the difference underflows to a
large positive value and the element is reported as power-efficient
spuriously, dispatching a bogus powerEfficientPlaybackStateChanged event
to the frontend.

Compare the frame counts directly so the check expresses "composited
frame count increased" and cannot underflow. The increase and no-change
cases are unaffected; the only altered case is a decrease, which
previously wrapped to a spurious power-efficient report and now correctly
reports not-power-efficient (self-correcting on the next sample).

* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::mediaMetricsTimerFired):

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



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

Reply via email to