Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 41dcbb4310386635ed1cac662e25346e1f0a0e8e
      
https://github.com/WebKit/WebKit/commit/41dcbb4310386635ed1cac662e25346e1f0a0e8e
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-29 (Mon, 29 Jun 2026)

  Changed paths:
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm

  Log Message:
  -----------
  colorWithTargetLuminance() passes std::clamp() arguments in the wrong order
https://bugs.webkit.org/show_bug.cgi?id=318071
rdar://180869510

Reviewed by Lily Spiniolas.

colorWithTargetLuminance() called std::clamp(0.f, targetLuminance, 1.f),
which clamps the constant 0 into the range [targetLuminance, 1] rather
than clamping targetLuminance into [0, 1]. For a targetLuminance greater
than 1 this violates std::clamp()'s lo <= hi precondition (undefined
behavior) and yields an out-of-range luminance; the only saving grace is
that the sole caller currently passes a fixed 0.5, masking the bug.

Pass the arguments in the correct order so targetLuminance is clamped to
the valid [0, 1] range.

* Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm:
(WebCore::colorWithTargetLuminance):

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



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

Reply via email to