-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
prevent default action for simple html5 media events. fixes #573, fixes #620 (duplicate bug) #630
Closed
cameront
wants to merge
5
commits into
videojs:stable
from
cameront:hotfix/620-media-default-actions
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0bdbe02
Prevent default action for handled media events. Fixes #573 and fixes…
1c225da
Update media test to use PlayerTest player
25d629d
Revert "Update media test to use PlayerTest player"
ff0b443
Revert "Prevent default action for handled media events. Fixes #573 a…
424f3ea
Make event triggering obey event.bubbles attribute. Fixes #573 and #620
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing a test!
There's a PlayerTest.makePlayer() function that could make this simpler. https://github.com/videojs/video.js/blob/master/test/unit/test-helpers.js#L8
createEvent is apparently deprecated.
https://developer.mozilla.org/en-US/docs/Web/API/document.createEvent
Also not supported in ie8, but I guess that's not really an issue in the HTML5 tests. Probably better to use a constructor like MDN says.
It seems like at the core of this you're just testing that preventDefault works, does that sound right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay - I've incorporated PlayerTest.makePlayer().
I should have mentioned this before submitting, but I did try to use event constructors and ran into an issue in phantomjs - ariya/phantomjs#11289. Okay to keep createElement for now?
And yeah - the point is just a regression test to verify that events bubbled from the html5 tech have preventDefault called on them before trigger is called.