mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Do not try to render controls if they are already rendered
This commit is contained in:
parent
3a99c6ba6a
commit
82339a9295
1 changed files with 4 additions and 4 deletions
|
@ -1731,12 +1731,12 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
fn render_controls(&self) {
|
||||
if self.ready_state.get() < ReadyState::HaveMetadata {
|
||||
let element = self.htmlelement.upcast::<Element>();
|
||||
if self.ready_state.get() < ReadyState::HaveMetadata || element.is_shadow_host() {
|
||||
// Bail out if we have no metadata yet or
|
||||
// if we are already showing the controls.
|
||||
return;
|
||||
}
|
||||
// XXX cannot render controls while parsing.
|
||||
// XXX check that controls are not already rendered.
|
||||
let element = self.htmlelement.upcast::<Element>();
|
||||
if let Ok(shadow_root) = element.attach_shadow(IsUserAgentWidget::Yes) {
|
||||
let document = document_from_node(self);
|
||||
let script = HTMLScriptElement::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue