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

polyfill Element.matches (fixes #1223) #1230

Merged
merged 2 commits into from May 11, 2019

Conversation

markbrouch
Copy link
Contributor

@markbrouch markbrouch commented May 10, 2019

This fixes a bug (#1223) in IE and older versions of Chrome that use a non-standard name for Element.matches() by implementing a polyfill.

Please advise if there is a more appropriate place to implement this polyfill.

@markbrouch
Copy link
Contributor Author

@eddyerburgh it looks like jsdom globals are turned off in node env: https://github.com/vuejs/vue-test-utils/blob/dev/test/setup/mocha.setup.js#L3

This causes tests to fail on this change because Element does not exist outside of jsdom. What's the intent of disabling jsdom globals for node env?

@eddyerburgh
Copy link
Member

The tests run for both @vue/test-utils and @vue/server-test-utils.

Can you add the polyfill in mount.js, which is only used in @vue/test-utils.

@markbrouch
Copy link
Contributor Author

The tests run for both @vue/test-utils and @vue/server-test-utils.

Can you add the polyfill in mount.js, which is only used in @vue/test-utils.

I moved the polyfill to its own module that is invoked in mount.js.

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

@eddyerburgh eddyerburgh merged commit 5e04331 into vuejs:dev May 11, 2019
@vue-bot
Copy link

vue-bot commented May 11, 2019

Hey @markbrouch, thank you for your time and effort spent on this PR, contributions like yours help make Vue better for everyone. Cheers! 💚

@markbrouch markbrouch deleted the polyfill-element-matches branch May 13, 2019 17:01
@asinakdeniz
Copy link

asinakdeniz commented Jul 10, 2019

Hi @eddyerburgh,
As I understood, this fix has not been released yet, when are you planning to get release? Thanks...

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

Successfully merging this pull request may close these issues.

None yet

4 participants