Add <style> to player tag instead of head #3240
Closed
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.
Description
Another portability fix (see #3230). Currently, players moved to or created in a different window from the video.js script will not have the proper dimensions applied.
Specific Changes proposed
The video dimensions stylesheet is added to the player element instead of
<head>
. Thescoped
attribute is also set, though only supported by Firefox it also serves as a cosmetic validation for where the element is contained (scoped style elements are permitted alongside flow content).By doing this, the element can be moved to another window or frame without losing these dimensions. All browsers support
<style>
elements outside of<head>
, though it is technically invalid without thescoped
attribute. Behaviour-wise, nothing has changed so current tests continue to pass and additional unit tests are unnecessary.Requirements Checklist