Closed Bug 1722322 Opened 3 years ago Closed 1 year ago

[meta] Largest Contentful Paint (LCP) implementation

Categories

(Core :: Performance, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: bdekoz, Assigned: sefeng)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Keywords: meta)

Attachments

(7 files, 6 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The Largest Contentful Paint (aka LCP) metric is one of three core metrics in Google's web vitals suite of analytic tools for web performance.

More information can be found here: https://web.dev/lcp/

This bug tracks the status and implementation of this metric in Gecko.

Dependencies include the W3C Element Timing API, and the specification can be found in the Largest Contentful Paint API ((https://wicg.github.io/largest-contentful-paint/)

Assignee: nobody → sefeng

So that it can be reused.

This patch mainly just adds hide_test_state: true to
LargestContentfulPaint related tests because the intermittent
test status can be considered as painted elements, which
may interfere the test results.

Plus a few minor tweaks.

Depends on D151073

With the implementation many tests start to pass, so we adjust
the ini files accordingly.

Depends on D151075

According to
https://fetch.spec.whatwg.org/#serializing-a-request-origin,
the algorithm should return "null" if the request has a
redirected-tainted origin.

Depends on D151077

So that it can be reused.

Attachment #9284220 - Attachment is obsolete: true
Attachment #9284222 - Attachment description: WIP: Bug 1722322 - Add some minor tweaks to LargestContentfulPaint WPTs → Bug 1722322 - Add some minor tweaks to LargestContentfulPaint WPTs r=emilio
Attachment #9284223 - Attachment description: WIP: Bug 1722322 - Convert two intersection algorithm related functions to static → Bug 1722322 - Convert two intersection algorithm related functions to static r=emilio
Attachment #9284225 - Attachment description: WIP: Bug 1722322 - Adjust the ini files for LargestContentfulPaint implementation accordingly → Bug 1722322 - Adjust the ini files for LargestContentfulPaint implementation accordingly r=emilio
Attachment #9284226 - Attachment description: WIP: Bug 1722322 - Refactor NotifyContentfulPaint to allow it's being called multiple times → Bug 1722322 - Tweak NotifyContentfulPaint to make it strictly based on FirstContentfulPaint r=emilio

Comment on attachment 9284231 [details]
Bug 1722322 - Refactor get-an-element algorithm to a static method r=emilio

Revision D151081 was moved to bug 1778345. Setting attachment 9284231 [details] to obsolete.

Attachment #9284231 - Attachment is obsolete: true
Blocks: 1778356
Attachment #9284227 - Attachment description: WIP: Bug 1722322 - Make serialized request origin can be null → Bug 1722322 - Fix two bugs in nsContentSecurityManager::GetSerializedOrigin r=#necko
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint → Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: Bug 1722322 - Implement LargestContentfulPaint r=emilio → WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio → Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: Bug 1722322 - Implement LargestContentfulPaint r=emilio → WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio
Blocks: 1800762
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio → Bug 1722322 - Implement LargestContentfulPaint r=emilio

We have tests that use content to generate text, however it looks like
we miss the one for images.

Attachment #9284228 - Attachment description: Bug 1722322 - Implement LargestContentfulPaint r=emilio → WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio → Bug 1722322 - Implement LargestContentfulPaint r=emilio
Flags: needinfo?(emilio)

Did another review pass, sorry for the lag again.

Flags: needinfo?(emilio)
Depends on: 1829388

Comment on attachment 9284222 [details]
Bug 1722322 - Add some minor tweaks to LargestContentfulPaint WPTs r=emilio

Revision D151074 was moved to bug 1829388. Setting attachment 9284222 [details] to obsolete.

Attachment #9284222 - Attachment is obsolete: true
Attachment #9284223 - Attachment is obsolete: true
Depends on: 1830778
Attachment #9284226 - Attachment description: Bug 1722322 - Tweak NotifyContentfulPaint to make it strictly based on FirstContentfulPaint r=emilio → Bug 1722322 - Rename some contentful paint related variables/functions to make it clear they are based on FirstContentfulPaint r=emilio
Depends on: 1830794

Comment on attachment 9284226 [details]
Bug 1722322 - Rename some contentful paint related variables/functions to make it clear they are based on FirstContentfulPaint r=emilio

Revision D151077 was moved to bug 1830778. Setting attachment 9284226 [details] to obsolete.

Attachment #9284226 - Attachment is obsolete: true

Comment on attachment 9314038 [details]
Bug 1722322 - Add the WebIDL support for LargestContentfulPaint r=emilio

Revision D167816 was moved to bug 1830794. Setting attachment 9314038 [details] to obsolete.

Attachment #9314038 - Attachment is obsolete: true
Attachment #9284228 - Attachment description: Bug 1722322 - Implement LargestContentfulPaint r=emilio → WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio → Bug 1722322 - Implement LargestContentfulPaint r=emilio
  • added one to ensure elements rendered by MathML are observable
  • added one to ensure elements created in different namespaces are observable
Attachment #9284228 - Attachment description: Bug 1722322 - Implement LargestContentfulPaint r=emilio → WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio
Attachment #9284228 - Attachment description: WIP: Bug 1722322 - Implement LargestContentfulPaint r=emilio → Bug 1722322 - Implement LargestContentfulPaint r=emilio

The meta tags for width and height are needed to make sure the
calculation for the image position uses device sizes
rather than virtual sizes.

minimum-scale is used to ensure the overflow:hidden content
is not scrollable on Firefox Android, so that the LCP size can
be computed correctly.

Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0121c8cf5d2f Adjust the ini files for LargestContentfulPaint implementation accordingly r=emilio https://hg.mozilla.org/integration/autoland/rev/f52b1f28f753 Fix two bugs in nsContentSecurityManager::GetSerializedOrigin r=necko-reviewers,dragana https://hg.mozilla.org/integration/autoland/rev/37fccb407777 Add a LCP test for generated css image r=emilio https://hg.mozilla.org/integration/autoland/rev/9955756855bd Implement LargestContentfulPaint r=emilio https://hg.mozilla.org/integration/autoland/rev/c2a6440a83d7 Add two more tests for LCP r=emilio https://hg.mozilla.org/integration/autoland/rev/7a75717f127c Update image-not-fully-visible.html to make it work on Firefox Android r=emilio https://hg.mozilla.org/integration/autoland/rev/0ebd32e273b8 apply code formatting via Lando
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42926 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Flags: needinfo?(sefeng)
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/db558fea2a7c Adjust the ini files for LargestContentfulPaint implementation accordingly r=emilio https://hg.mozilla.org/integration/autoland/rev/a3ad0e6a7e2e Fix two bugs in nsContentSecurityManager::GetSerializedOrigin r=necko-reviewers,dragana https://hg.mozilla.org/integration/autoland/rev/ad5e97f0e18a Add a LCP test for generated css image r=emilio https://hg.mozilla.org/integration/autoland/rev/9e951b5150b8 Implement LargestContentfulPaint r=emilio https://hg.mozilla.org/integration/autoland/rev/1b569e5741f1 Add two more tests for LCP r=emilio https://hg.mozilla.org/integration/autoland/rev/1adce8bfea68 Update image-not-fully-visible.html to make it work on Firefox Android r=emilio https://hg.mozilla.org/integration/autoland/rev/19a29adcc44d apply code formatting via Lando
Regressions: 1862906
Regressions: 1862907
Upstream PR merged by moz-wptsync-bot
Regressions: 1862966
Regressions: 1863139
Regressions: 1862940
Regressions: 1862810
Regressions: 1862909
Regressions: 1863104
Regressions: 1863491
Regressions: 1863948

Please add a relnote nomination for this when you get a chance.

Flags: needinfo?(sefeng)
Blocks: 1866266

Relnote nomination is added in bug 1866266.

Flags: needinfo?(sefeng)
Regressions: 1875426
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: