Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /custom-elements/reactions/customized-builtins/HTMLMediaElement.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLMediaElement interface</title>
<meta name="assert" content="src, crossOrigin, preload, autoplay, loop,
controls, defaultMuted of HTMLMediaElement interface must have CEReactions">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/custom-elements-helpers.js"></script>
<script src="../resources/reactions.js"></script>
<body>
<script>
function getParentElement() {
return document.body;
}
function setAttributes(instance, value) {
instance.setAttribute('src', value);
}
testReflectAttribute(
'src', 'src', '/media/sound_0.mp3',
'/media/sound_5.mp3', 'src on HTMLMediaElement in audio', 'audio',
HTMLAudioElement
);
testReflectAttributeWithDependentAttributes(
'crossOrigin', 'crossorigin', 'use-credentials',
'anonymous', 'crossOrigin on HTMLMediaElement in audio', 'audio',
getParentElement, instance => setAttributes(instance, '/media/sound_5.mp3'),
HTMLAudioElement
);
testReflectAttributeWithDependentAttributes(
'preload', 'preload', 'auto',
'none', 'preload on HTMLMediaElement in audio', 'audio',
getParentElement, instance => setAttributes(instance, '/media/sound_5.mp3'),
HTMLAudioElement
);
testReflectBooleanAttributeWithDependentAttributes(
'autoplay', 'autoplay', 'autoplay on HTMLMediaElement in audio',
'audio', getParentElement,
instance => setAttributes(instance, '/media/sound_5.mp3'),
HTMLAudioElement
);
testReflectBooleanAttributeWithDependentAttributes(
'loop', 'loop', 'loop on HTMLMediaElement in audio',
'audio', getParentElement,
instance => setAttributes(instance, '/media/sound_5.mp3'), HTMLAudioElement
);
testReflectBooleanAttributeWithDependentAttributes(
'controls', 'controls', 'controls on HTMLMediaElement in audio',
'audio', getParentElement,
instance => setAttributes(instance, '/media/sound_5.mp3'),
HTMLAudioElement
);
testReflectBooleanAttributeWithDependentAttributes(
'defaultMuted', 'muted', 'defaultMuted on HTMLMediaElement in audio',
'audio', getParentElement,
instance => setAttributes(instance, '/media/sound_5.mp3'),
HTMLAudioElement
);
testReflectAttribute(
'src', 'src', '/media/video.webm',
'/media/movie_5.mp4', 'src on HTMLMediaElement in video', 'video',
HTMLVideoElement
);
testReflectAttributeWithDependentAttributes(
'crossOrigin', 'crossorigin', 'use-credentials',
'anonymous', 'crossOrigin on HTMLMediaElement in video', 'video',
getParentElement, instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
testReflectAttributeWithDependentAttributes(
'preload', 'preload', 'auto',
'none', 'preload on HTMLMediaElement in video', 'video',
getParentElement, instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
testReflectBooleanAttributeWithDependentAttributes(
'autoplay', 'autoplay', 'autoplay on HTMLMediaElement in video',
'video', getParentElement,
instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
testReflectBooleanAttributeWithDependentAttributes(
'loop', 'loop', 'loop on HTMLMediaElement in video',
'video', getParentElement,
instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
testReflectBooleanAttributeWithDependentAttributes(
'controls', 'controls', 'controls on HTMLMediaElement in video',
'video', getParentElement,
instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
testReflectBooleanAttributeWithDependentAttributes(
'defaultMuted', 'muted', 'defaultMuted on HTMLMediaElement in video',
'video', getParentElement,
instance => setAttributes(instance, '/media/movie_5.mp4'),
HTMLVideoElement
);
</script>
</body>