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

Avoid reflow at accessing the window object #31

Closed
ghost opened this issue Jul 4, 2016 · 2 comments
Closed

Avoid reflow at accessing the window object #31

ghost opened this issue Jul 4, 2016 · 2 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Jul 4, 2016

Accessing all keys in the window object leads to an reflow at line 41 in index.js. A fast and dirty workaround of me would be to avoid all attributes with with or height in it.

if(k.toLowerCase().indexOf('width') > -1 || k.toLowerCase.indexOf('height') > -1) continue;

As I don't understand the reason for the function completely I'm not really able to propose a correct pull request. That's why I just raised an issue. I hope that's okay.

@ljharb
Copy link
Owner

ljharb commented Jul 4, 2016

The purpose of the line is to locate browser bugs - the purpose of the blacklisted keys is to avoid accessing any problematic window keys. I wasn't aware that simply accessing width and/or height caused a reflow :-/ the proper solution will be to add them to the exclusion list.

@ljharb ljharb self-assigned this Jul 4, 2016
@ljharb ljharb closed this as completed in 5aa31c4 Jul 4, 2016
@ljharb ljharb added the bug label Jul 4, 2016
@ljharb
Copy link
Owner

ljharb commented Jul 4, 2016

Thanks! Released in v1.0.10.

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

No branches or pull requests

1 participant