Ability is needed to capture styles of elements to ensure proper optimization
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- frontend, performance
Direzione di ricerca
Inizia esaminando gli scenari CodePen e le issue collegate relative a Intersection Observer, quindi segui come Image Prioritizer utilizza i dati degli elementi durante le fasi initialize e finalize. Definisci l'ambito di captureElementStyles, lo schema degli elementi computedStyle e le misure di salvaguardia delle prestazioni; il lavoro è completo quando i casi di visibilità e content-visibility possono essere distinti senza compromettere le prestazioni della pagina.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Sometimes the Intersection Observer doesn't provide all of the information needed in order to perform optimizations. For example, images which have visibility:hidden, display:none, or opacity:0 should in theory get fetchpriority=low when they are in the initial viewport per https://github.com/WordPress/performance/issues/1587, but these won't
Conversely, from https://github.com/WordPress/performance/issues/1308#issuecomment-2560430599, images which are inside of elements which have content-visibility:auto will have a zeroed-out boundingClientRect which Image Prioritizer then interprets as being in the initial viewport (since the boundingClientRect.top of 0 is less than viewport.height) and so they are getting fetchpriority=low when they should actually get loading=lazy.
These issues should perhaps have a way to efficiently query the computed style of certain elements to store their properties with the element in URL Metrics. There could be an async getComputedStyle function exported to the initialize and finalize async functions in extensions which could include some additional performance safeguards, like returning a Promise that involves requestAnimationFrame() or maybe even first requestIdleCallback(). Calling getComputedStyle() can trigger a layout calculation (reflow), so we need to be careful to not negatively impact the performance of the page.
I put together a Codepen that shows what Intersection Observer reports for various scenarios: https://codepen.io/westonruter/pen/zxYoNJP?editors=1111
Notice importantly that elements with visibility:hidden and opacity:0 are considered fully visible as far as Intersection Observer is concerned, leading to them not getting fetchpriority=low. And notice how the element with content-visibility:auto has a boundingClientRect with zeroed out values, leading it to not get loading=lazy by Image Prioritizer.
In addition to the possibility of a new JS API, we should extend the element schema to include a computedStyle object. In fact, let's say instead of getComputedStyle() there was a captureElementStyles() function passed to initialize and finalize. It could take two args: the XPath of the element and an array of the styles properties to capture from the computed style. This could then automatically extend the computedStyle object of the element. Since the computedStyle object would be a core property it would not be available for extendElementData() to override. Image Prioritizer should do the computed style capturing should be done during initialize, since we want to know whether an image is visible up front.
- Lingua principale
- PHP
- Stelle
- 467
- Fork
- 171
- Merge medio
- 13h 21m
- PR unite (30g)
- 32
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WordPress/performance
-
Reuse template enhancement output buffer in Optimization Detective for WP 6.9Forse già presa @Hug0-Drelon l’ha presa 162 giorni fa. Aperta[Plugin] Optimization Detective [Type] Enhancement ContributorDay
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WordPress/performance#2224 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
AVIF sub-sizes are larger than WebP at the default quality of 82Forse già presa @b1ink0 l’ha presa 10 giorni fa. Aperta[Plugin] Modern Image Formats [Type] Bug
WordPress/performance#2745 · 15 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Enhanced Responsive Images assumes units of Column and Post Featured Image widthsForse già presa @rejaulalomkhan l’ha presa 26 giorni fa. Aperta[Plugin] Enhanced Responsive Images [Type] Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
WordPress/performance#2726 ·
I maintainer di solito rispondono entro 1 giorno
-
Fatal error in Enhanced Responsive Images when using old Columns block with a percentage float widthForse già presa @westonruter l’ha presa 28 giorni fa. Aperta[Plugin] Enhanced Responsive Images [Type] Bug
WordPress/performance#2724 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
WordPress/performance#2709 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WordPress/performance
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
backdrop-contrib/commerce#65 ·
-
backend enhancement good first issue php
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Evalogical-Inc/devReady#66 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mollie/PrestaShop#1627 ·
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
FriendsOfFlarum/follow-tags#118 ·