Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elem.innerText performance issue #11233

Closed
patmmccann opened this issue Mar 18, 2024 · 1 comment
Closed

elem.innerText performance issue #11233

patmmccann opened this issue Mar 18, 2024 · 1 comment

Comments

@patmmccann
Copy link
Collaborator

patmmccann commented Mar 18, 2024

Type of issue

Enhancement

Description

https://gist.github.com/paulirish/5d52fb081b3570c81e3a suggests element.innerText causes layout recalculations

Luckily only a few times is it used

email = targetElement.innerText;

const content = window.top.document.body.innerText.toLowerCase();

price: priceNode.textContent || priceNode.innerText

domain.push(domainNode.textContent || domainNode.innerText);

I wonder if we can somehow eliminate its use and ban calling it from the library via the linter?

@patmmccann
Copy link
Collaborator Author

It seems the first two can be converted to using textContent, the second two can eliminate the fallback, and we can add the linting rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants