GoogleChrome / GoogleChrome/lighthouse
SVGs and child nodes referenced from local SVG sprite count towards "Avoid an excessive DOM size"
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 19
Description
#### Provide the steps to reproduce
1. Run LH on https://andro4all.com/
#### What is the current behavior?
SVGs pointing to a local svg are adding nodes like they were the whole svg.
```html
```
becomes
```html
```
So, lighthouse evaluates this nodes too.
#### What is the expected behavior?
This svgs are pointing to a shared sprite SVG, so, lighthouse doesn't have to add the nodes inside the use tag. This rule penalizes reusing svgs instead of adding a new svg all the time.
Replacing this SVGs for dummy nodes in this page, for instance, like
```html
```
decreases the total by 376 nodes.
#### Environment Information
* Affected Channels: Devtools
* Lighthouse version: Lighthouse 4.0.0-beta
* Node.js version: macOS
Contributor guide
Assessment
This issue has not been assessed yet.