WebCore:
[WebKit-https.git] / WebCore / html / HTMLMediaElement.cpp
index 654ba81..d381f4d 100644 (file)
@@ -110,11 +110,25 @@ void HTMLMediaElement::attributeChanged(Attribute* attr, bool preserveDecls)
         if (inDocument() && m_networkState == EMPTY)
             scheduleLoad();
     } if (attrName == controlsAttr) {
+        if (!isVideo() && attached() && (controls() != (renderer() != 0))) {
+            detach();
+            attach();
+        }
         if (renderer())
             renderer()->updateFromElement();
     }
 }
     
+bool HTMLMediaElement::rendererIsNeeded(RenderStyle* style)
+{
+    return controls() ? HTMLElement::rendererIsNeeded(style) : false;
+}
+
+RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
+{
+    return new (arena) RenderMedia(this);
+}
 void HTMLMediaElement::insertedIntoDocument()
 {
     HTMLElement::insertedIntoDocument();