LayoutTests:
[WebKit-https.git] / WebCore / html / HTMLIFrameElement.cpp
index a929f0b8697fad443b23fa3729e0a9588ac70069..ec19dce77fed18def15fe21bfc0fb47b13c8e792 100644 (file)
@@ -39,7 +39,6 @@ using namespace HTMLNames;
 
 HTMLIFrameElement::HTMLIFrameElement(Document* doc)
     : HTMLFrameElement(iframeTag, doc)
-    , needWidgetUpdate(false)
 {
     m_frameBorder = false;
 }
@@ -60,7 +59,7 @@ bool HTMLIFrameElement::mapToEntry(const QualifiedName& attrName, MappedAttribut
         return false;
     }
     
-    return HTMLElement::mapToEntry(attrName, result);
+    return HTMLFrameElement::mapToEntry(attrName, result);
 }
 
 void HTMLIFrameElement::parseMappedAttribute(MappedAttribute *attr)
@@ -85,23 +84,14 @@ void HTMLIFrameElement::parseMappedAttribute(MappedAttribute *attr)
 
 void HTMLIFrameElement::insertedIntoDocument()
 {
+    HTMLFrameElement::insertedIntoDocument();
+    
     if (document()->isHTMLDocument()) {
         HTMLDocument *doc = static_cast<HTMLDocument *>(document());
         doc->addDocExtraNamedItem(oldNameAttr);
     }
 
-    HTMLElement::insertedIntoDocument();
-    
-    // Load the frame
-    m_name = getAttribute(nameAttr);
-    if (m_name.isNull())
-        m_name = getAttribute(idAttr);
-    
-    if (Frame* parentFrame = document()->frame()) {
-        m_name = parentFrame->tree()->uniqueChildName(m_name);
-        
-        openURL();
-    }    
+    openURL();
 }
 
 void HTMLIFrameElement::willRemove()
@@ -122,7 +112,7 @@ void HTMLIFrameElement::removedFromDocument()
         doc->removeDocExtraNamedItem(oldNameAttr);
     }
 
-    HTMLElement::removedFromDocument();
+    HTMLFrameElement::removedFromDocument();
 }
 
 bool HTMLIFrameElement::rendererIsNeeded(RenderStyle *style)
@@ -138,18 +128,12 @@ RenderObject *HTMLIFrameElement::createRenderer(RenderArena *arena, RenderStyle
 
 void HTMLIFrameElement::attach()
 {
-    HTMLElement::attach();
-
-    RenderPartObject* renderPart = static_cast<RenderPartObject*>(renderer());
-
-    if (renderPart) {        
-        if (!contentFrame())
-            openURL();
+    HTMLFrameElement::attach();
 
+    if (RenderPartObject* renderPart = static_cast<RenderPartObject*>(renderer())) {        
         if (contentFrame()) {
             renderPart->setWidget(contentFrame()->view());
             renderPart->updateWidget();
-            needWidgetUpdate = false;
         }
     }
 }
@@ -159,16 +143,6 @@ void HTMLIFrameElement::detach()
     HTMLElement::detach();
 }
 
-void HTMLIFrameElement::recalcStyle( StyleChange ch )
-{
-    if (needWidgetUpdate) {
-        if (renderer())
-            static_cast<RenderPartObject*>(renderer())->updateWidget();
-        needWidgetUpdate = false;
-    }
-    HTMLElement::recalcStyle( ch );
-}
-
 bool HTMLIFrameElement::isURLAttribute(Attribute *attr) const
 {
     return attr->name() == srcAttr;