Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0f6e74d7d5d25c1cdc313a1714ce796cf186bb57
      
https://github.com/WebKit/WebKit/commit/0f6e74d7d5d25c1cdc313a1714ce796cf186bb57
  Author: Taher Ali <[email protected]>
  Date:   2025-11-19 (Wed, 19 Nov 2025)

  Changed paths:
    M Source/WebCore/style/values/backgrounds/StyleLineWidth.cpp
    M Source/WebCore/style/values/backgrounds/StyleLineWidth.h

  Log Message:
  -----------
  [Style] Avoid redundant LayoutUnit conversion in LineWidth evaluation
https://bugs.webkit.org/show_bug.cgi?id=302668
rdar://164917570

Reviewed by Brent Fulgham and Alan Baradlay.

This fix performs device pixel snapping math directly, avoiding the
intermediate LayoutUnit conversion.

Previously, when evaluating LineWidth values, the Evaluation template
called floorToDevicePixel, which internally converted to LayoutUnit.
The caller then converted the result to LayoutUnit again, causing
two constructor calls with full bounds validation for every
border width query during layout.

Tested on Speedometer 3 with eval-time zoom enabled:
- Before: Evaluation<LineWidth, LayoutUnit> showed ~392 samples in traces
- After: ~169 samples (~57% fewer, ~223 saved)

* Source/WebCore/style/values/backgrounds/StyleLineWidth.cpp:
(WebCore::Style::Serialize<LineWidth>::operator):
* Source/WebCore/style/values/backgrounds/StyleLineWidth.h:

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



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

Reply via email to