feat: detect images without explicit width/height (CLS)#32
Merged
Conversation
An <img> with no width/height attribute reflows as it loads, causing Cumulative Layout Shift (CLS), a Core Web Vitals signal. The extraction pass already walks every <img> for alt text; it now also counts images missing a usable width or height. - ExtractedPage gains images_missing_dimensions; new column + additive migration; persistence threaded. - images_missing_dimensions (LOW) fires when any image lacks a dimension. Image byte-weight (needs HEAD requests) is intentionally deferred.
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.
What
Wave 2 / Block 2.1 — an
<img>with nowidth/heightattribute reflows as it loads, causing Cumulative Layout Shift (CLS), a Core Web Vitals signal.New
images_missing_dimensions(LOW), reported with the count: "N of M images have no width/height".How
<img>for alt text;_image_statsnow also counts images missing a usablewidthorheight(empty string counts as missing).ExtractedPagegainsimages_missing_dimensions; newdepth-style column + additive migration; persistence threaded.Image byte-weight (the other half of Block 2.1) needs HEAD requests / network I/O and was intentionally deferred per scope decision.
Tests
Extraction test (sized vs width-only vs none vs empty), detector test (flagged + clean), migration column assertion. Full suite: 225 passed.
ruffclean.