fix(common): skip checking whether SVGs are oversized
Prior to this commit, the ImagePerformanceWarning class was checking all img elements in the DOM to determine whether they were oversized after the DOM loading was complete. We should not check SVGs because they are vector-based and can scale infinitely without losing quality.
Closes #57941
@arturovt thanks for adding tests 👍 It looks like one of them is failing on CI (see test CI job):
packages/core/test/bundling/image-directive/index.ts:21:51 - error TS2307: Cannot find module './e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings' or its corresponding type declarations.
21 import {SvgNoOversizedPerfWarningsComponent} from './e2e/image-perf-warnings-oversized/svg-no-perf-oversized-warnings';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could you please take a look when you get a chance?
Caretaker note: presubmit is "green", this PR is ready for merge.
This PR was merged into the repository by commit e8b2d5fad8aece3b2e3f4a7ed1356642f68ee275.
The changes were merged into the following branches: main, 18.2.x
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.