core(unsized-images): respect CSS rules from stylesheets - #11590
Merged
Conversation
patrickhulce
commented
Oct 23, 2020
| <!-- PASS(responsive): image is used at full size --> | ||
| <!-- PASS(responsive-inverse): image does not account for DPR 2.625 --> | ||
| <!-- PASS(offscreen): image is lazily loaded --> | ||
| <!-- PASS(unsized-images): CSS sizing from stylesheet, not inline --> |
Collaborator
Author
There was a problem hiding this comment.
this was failing before the fix
patrickhulce
commented
Oct 23, 2020
| * Finds the most specific directly matched CSS font-size rule from the list. | ||
| * | ||
| * @param {Array<LH.Crdp.CSS.RuleMatch>} [matchedCSSRules] | ||
| * @param {Array<LH.Crdp.CSS.RuleMatch>} matchedCSSRules |
Collaborator
Author
There was a problem hiding this comment.
this causes vscode to complain about ordering of optional arguments
adamraine
approved these changes
Oct 23, 2020
8000
| * @param {string} property | ||
| * @return {string | undefined} | ||
| */ | ||
| function findSizeDeclaration(style, property) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CSS rules from stylesheets were being completely ignored due to an errant
ts-expect-error, the explanation sounded so reasonable but it was referencing a property name that didn't even exist. Yet another reminder to preferif (!foo) throw new Error('Impossible')over@ts-expect-error😄Also drive-by fix for AVIF getting incorrectly mime type sniffed.
Related Issues/PRs
fixes https://twitter.com/andreasbovens/status/1319411834865262594 :)