New issue
Advanced search Search tips

Issue 689376 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Prevent FirstMeaningfulPaint from firing before FirstContentfulPaint

Project Member Reported by ksakamoto@chromium.org, Feb 7 2017

Issue description

Current Blink implementation can report FMP before FCP. But if we can assume FCP <= FMP, it would make analyses easier.

There're two reasons of FMP firing before FCP:

(1) FCP and FMP are the same Blink's paint phase, but monotonicallyIncreasingTime() call for FMP happened before that for FCP.
(2) In very rare cases, complex layout/paint without any text/images can happen (like drawing pictures w/ CSS boxes http://purecss3.net/doraemon/doraemon_css3.html).

I propose to enforce FMP (and FMPCandidate) being equal or after FCP, i.e.

  if (FMP < FCP)
    FMP = FCP;

This would affect FMP value in the cases of above (2). Also, FMP will not reported if the page does not have any contentful thing (e.g. https://airhorner.com/). These are very rare, so we can safely ignore them.

 
For #1, ideally we wouldn't call monotonicallyIncreasingTime twice, as getting the current time is expensive, at least on Android.

Can we fix #1 independently, just by being smarter about the timestamps we use?
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/064e872bec2dc2bc381a493c6be6c0f24d672c4d

commit 064e872bec2dc2bc381a493c6be6c0f24d672c4d
Author: ksakamoto <ksakamoto@chromium.org>
Date: Thu Feb 23 05:51:31 2017

Enforce FirstContentfulPaint <= FirstMeaningfulPaint

Before this patch, ordering of FirstContentfulPaint (FCP) and
FirstMeaningfulPaint (FMP) was not guaranteed. This change enforces
FCP <= FMP ordering, by reporting FCP timestamp as FMP if the last
FMP candidate is before FCP.

BUG= 689376 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2710623002
Cr-Commit-Position: refs/heads/master@{#452412}

[modify] https://crrev.com/064e872bec2dc2bc381a493c6be6c0f24d672c4d/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
[modify] https://crrev.com/064e872bec2dc2bc381a493c6be6c0f24d672c4d/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment