core(font-size): comment why source = Other happens #9363
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide the steps to reproduce
Or via DevTools.
What is the current behavior?
font-sizewill have anUnknown(10px).What is the expected behavior?
It should not say
Unknown.how'd I find this?
I was curious when this audit resulted in
Unknown, so I queried httparchive:result:
[ { "UNKNOWN": "8626", "USER_AGENT": "111618", "DYNAMIC": "485029", "TOTAL": "14162843" } ]That's ~0.05% (very few).
Gettings some URLs to work with:
[ { "url": "http://m.sands-style.com/", "source": "Unknown" }, { "url": "https://grayes.com/", "source": "Unknown" }, { "url": "https://fins.money/", "source": "Unknown" }, { "url": "http://m.espresso.repubblica.it/", "source": "Unknown" }, { "url": "https://www.heimgourmet.com/", "source": "Unknown" }, { "url": "https://www.albirplayahotel.com/", "source": "Unknown" }, { "url": "https://www.twistys.com/", "source": "Unknown" }, { "url": "http://www.kopi-ki.net/", "source": "Unknown" }, { "url": "https://grayhawkgolf.com/", "source": "Unknown" }, { "url": "http://thquanglong.pgdbadon.edu.vn/", "source": "Unknown" } ]I picked the first site, saw the unknown
font-sizewas 10, and ran this:and looked at some
h3s set to 10. The CSS that sets thefont-sizeto 10 is from a stlesheet, and is even mentioned in other items in thefont-sizetable! weird.I set a breakpoint in the
font-sizeaudit forUnknown, the stylesheetDeclaration is:Note lack of a
stylesheetproperty. This is set in thefont-sizegatherer here:lighthouse/lighthouse-core/gather/gatherers/seo/font-size.js
Line 340 in 7750fe4
Finding the failing nodes for this:
[ { "fontSize": 10, "textLength": 13, "node": { ... }, "cssRule": { "type": "Regular", "parentRule": { "origin": "regular", "selectors": [ { "text": "#footer h3" } ] } } }, { "fontSize": 10, "textLength": 12, "node": { ... } }, "cssRule": { "type": "Regular", "parentRule": { "origin": "regular", "selectors": [ { "text": "#footer h3" } ] } } } ]Note a lack of
styleSheetId/styleSheeton thecssRules. Which I trace back to the limtiting we do:lighthouse/lighthouse-core/gather/gatherers/seo/font-size.js
Line 292 in 7750fe4
So that makes sense. I'll just leave an explanatory comment.