Ciao Giovanni, credo in realtà che in questo caso provare a leggere il sorgente sarebbe un'esperienza illuminante, utile soprattutto per chi C++ non lo conosce: quel codice è lì dal 2018 e tutta la storia delle commit è un continuo modificare WebKit per risolvere i problemi di visualizzazione di una o dell'altra azienda: https://github.com/WebKit/WebKit/commits/HEAD/Source/WebCore/page/Quirks.cpp On Mon, 01 Feb 2021 11:00:40 +0100 Giovanni Biscuolo wrote:
Per favore per i pigri, quelli che vanno di fretta come me e per chi non sa leggere l'inglese scritto in C++ potresti farci un sunto di cosa sono quei quirks?
Semplicemente una serie di controlli sul dominio e sulle url delle pagine visitate che abilitano o disabilitano determinati comportamenti del browser in modo "non standard". L'elenco è davvero troppo lungo ed estremamente variegato. Oltre ai GAFAM, ci sono "personalizzazioni" per Medium, Netflix, Yahoo.. Per esempio ad un certo punto si spiega:
We silence window resize events during the 'homing out' snapshot sequence when on nytimes.com to address <rdar://problem/59763843>, and on twitter.com to address <rdar://problem/58804852> & <rdar://problem/61731801>.
oppure
Vimeo.com used to bypass the back/forward cache by serving "Cache-Control: no-store" over HTTPS. We started caching such content in r250437 but the vimeo.com content unfortunately is not currently compatible because it changes the opacity of its body to 0 when navigating away and fails to restore the original opacity when coming back from the back/forward cache (e.g. in 'pageshow' event handler). See <rdar://problem/56996057>.
oppure ancora
Google Docs used to bypass the back/forward cache by serving "Cache-Control: no-store" over HTTPS. We started caching such content in r250437 but the Google Docs index page unfortunately is not currently compatible because it puts an overlay (with class "docs-homescreen-freeze-el-full") over the page when navigating away and fails to remove it when coming back from the back/forward cache (e.g. in 'pageshow' event handler). See <rdar://problem/57670064>. Note that this does not check for docs.google.com host because of hosted G Suite apps.
o anche
Facebook and Twitter will naively pause a <video> element that has scrolled out of the viewport, regardless of whether that element is currently in PiP mode. We should remove the quirk once <rdar://problem/67273166> and <rdar://problem/73369869> have been fixed.
I test più evidenti sono quelli sui domini e sui componenti delle url, ma ci sono anche verifiche puntuali su determinati css, ad esempio qui https://github.com/WebKit/WebKit/blob/main/Source/WebCore/page/Quirks.cpp#L9... Anche per questo, come non bastasse la varietà dei domini, è difficile contare i vantaggi forniti alle singole aziende. Nei test che abilitano questi "quirks" - "google" compare 13 volte, ma "youtube" compare altre 10 e isGoogleMaps viene testato a parte - "twitter" compare 12 - Microsoft compare con "live", "sharepoint", "bing" e "msn" per 10 "facebook" compare solo 2 volte, ma ultimamente non vanno d'accordo. Ma c'è "gizmodo", "mailchimp", "lifehacker"... Leggetelo... davvero... E poi pensate a tutti i "quirks" che non potete leggere nei sorgenti di Google Chrome o Windows... davvero è solo un problema di antitrust? Giacomo