Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 86af7895045818824f56bd8ac1c08ea52428669d
      
https://github.com/WebKit/WebKit/commit/86af7895045818824f56bd8ac1c08ea52428669d
  Author: Simon Fraser <[email protected]>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/largest-contentful-paint/lcp-buffer-size-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/largest-contentful-paint/lcp-buffer-size.html
    M 
LayoutTests/imported/w3c/web-platform-tests/user-timing/measures-expected.txt
    M Source/WebCore/page/Performance.cpp
    M Source/WebCore/page/Performance.h
    M Source/WebCore/page/PerformanceEntry.h
    M Source/WebCore/page/PerformanceObserver.cpp
    M Source/WebCore/page/PerformanceObserver.h

  Log Message:
  -----------
  LCP buffer size seems to be set to 1 instead of 150
https://bugs.webkit.org/show_bug.cgi?id=305256
rdar://168015751

Reviewed by Ryosuke Niwa.

The `Performance` object stored only one LCP entry, instead of the buffer of 
150 entries
as specified by [1].

Fix by implementing the `performance entry buffer map` per spec [2], allowing 
us to
specify the max buffer size on a per-entryType basis. This replaces the ad-hoc
buffers, and brings the code closer to spec terminology.

Change PerformanceEntry::Type to be a normal enum; we can use EnumSet where
necessary, and now just trivially cast the values to get indexes into the 
std::array.

[1] https://w3c.github.io/timing-entrytypes-registry/#registry
[2] https://w3c.github.io/performance-timeline/#performance-entry-buffer-map

Test: 
imported/w3c/web-platform-tests/largest-contentful-paint/lcp-buffer-size.html

* 
LayoutTests/imported/w3c/web-platform-tests/largest-contentful-paint/lcp-buffer-size-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/largest-contentful-paint/lcp-buffer-size.html:
 Added.
* LayoutTests/imported/w3c/web-platform-tests/user-timing/measures-expected.txt:
* Source/WebCore/page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::entryBufferTuple):
(WebCore::Performance::entryBufferTuple const):
(WebCore::Performance::initializeEntryBufferMap):
(WebCore::Performance::addToEntryBuffer):
(WebCore::Performance::clearEntryBuffer):
(WebCore::Performance::getEntries const):
(WebCore::Performance::getEntriesByType const):
(WebCore::Performance::getEntriesByName const):
(WebCore::Performance::appendBufferedEntriesByType const):
(WebCore::Performance::processEventEntry):
(WebCore::Performance::clearResourceTimings):
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::reportFirstContentfulPaint):
(WebCore::Performance::enqueueLargestContentfulPaint):
(WebCore::Performance::addNavigationTiming):
(WebCore::Performance::addResourceTiming):
(WebCore::Performance::isResourceTimingBufferFull const):
(WebCore::Performance::resourceTimingBufferFullTimerFired):
(WebCore::Performance::mark):
(WebCore::Performance::clearMarks):
(WebCore::Performance::measure):
(WebCore::Performance::clearMeasures):
* Source/WebCore/page/Performance.h:
* Source/WebCore/page/PerformanceEntry.h:
* Source/WebCore/page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::observe):
* Source/WebCore/page/PerformanceObserver.h:
(WebCore::PerformanceObserver::typeFilter const):

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



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

Reply via email to