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

Don't count duplicated queries on elements not attached to DOM #519

Merged
merged 2 commits into from
May 25, 2015

Conversation

gmetais
Copy link
Contributor

@gmetais gmetais commented May 25, 2015

Hi there!

Some DOM queries are counted as duplicated but aren't. Example:

var detachedDiv1 = document.createElement('div');
var detachedDiv2 = document.createElement('div');

detachedDiv1.getElementsByTagName('a');
detachedDiv2.getElementsByTagName('a');// should not be counted as duplicated query

Currently, they are counted as duplicated and this is the offender:
* tag name "a" (in div): 2 queries

Same thing with elements inside document fragments. While it's sometimes true, we can't be sure the browser is running the query inside the same document fragment.

@macbre macbre added this to the v1.11 milestone May 25, 2015
@macbre macbre added the bug label May 25, 2015
macbre pushed a commit that referenced this pull request May 25, 2015
Don't count duplicated queries on elements not attached to DOM
@macbre macbre merged commit 0adc54e into macbre:devel May 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants