[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:10:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3125d6bff4a48f36ac88bc8d2176c912cb37de19
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 10 08:26:45 2003 +0000

            Reviewed by Dave.
    
            - fixed 3478173 -- REGRESSION (112-113): getElementById is failing for many types of elements
    
            The problem was that ElementImpl::attach was being skipped for many objects with classes
            derived from ElementImpl. By changing them all to call up to their base classes instead of
            skipping levels, the bug went away. This was possible (and easy to do) because of the
            rendererIsNeeded() change I made a while back.
    
            * khtml/html/html_baseimpl.cpp:
            (HTMLFrameElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
            and then calling NodeBaseImpl::attach(). This was a remnant of the old way of changing the logic
            about when to create the renderer, not needed now that we have rendererIsNeeded().
            (HTMLFrameSetElementImpl::attach): Ditto.
            (HTMLIFrameElementImpl::attach): Ditto.
    
            * khtml/html/html_formimpl.h: Removed many unused attach() overrides.
            * khtml/html/html_formimpl.cpp:
            (HTMLGenericFormElementImpl::attach): Ditto.
            (HTMLButtonElementImpl::attach): Removed, because now the base class's attach does the right thing.
            (HTMLFieldSetElementImpl::attach): Ditto.
            (HTMLInputElementImpl::attach): Removed explicit createRendererIfNeeded call, not needed now that
            HTMLGenericFormElementImpl calls through to its base class.
            (HTMLLegendElementImpl::attach): Removed, because now the base class's attach does the right thing.
            (HTMLSelectElementImpl::attach): Ditto.
            (HTMLTextAreaElementImpl::attach): Ditto.
    
            * khtml/html/html_imageimpl.cpp:
            (HTMLImageElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
            and then calling NodeBaseImpl::attach().
            (HTMLImageElementImpl::detach): Call base class's detach() instead of NodeBaseImpl::detach(). No
            need to skip the ElementImpl::detach() function, and important not to for the new "id" optimization.
    
            * khtml/html/html_inlineimpl.h: Removed HTMLBRElementImpl::attach override.
            * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach): Call base class's attach() instead
            of creating renderer explicitly and then calling NodeBaseImpl::attach().
    
            * khtml/html/html_objectimpl.h: Removed HTMLAppletElementImpl::attach override.
            * khtml/html/html_objectimpl.cpp:
            (HTMLAppletElementImpl::attach): Removed, because the base class's attach does the right thing.
            (HTMLEmbedElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
            and then calling NodeBaseImpl::attach().
            (HTMLObjectElementImpl::attach): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5435 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 76bb382..4c721fc 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,49 @@
+2003-11-09  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+        - fixed 3478173 -- REGRESSION (112-113): getElementById is failing for many types of elements
+
+        The problem was that ElementImpl::attach was being skipped for many objects with classes
+        derived from ElementImpl. By changing them all to call up to their base classes instead of
+        skipping levels, the bug went away. This was possible (and easy to do) because of the
+        rendererIsNeeded() change I made a while back.
+
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLFrameElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
+        and then calling NodeBaseImpl::attach(). This was a remnant of the old way of changing the logic
+        about when to create the renderer, not needed now that we have rendererIsNeeded().
+        (HTMLFrameSetElementImpl::attach): Ditto.
+        (HTMLIFrameElementImpl::attach): Ditto.
+
+        * khtml/html/html_formimpl.h: Removed many unused attach() overrides.
+        * khtml/html/html_formimpl.cpp:
+        (HTMLGenericFormElementImpl::attach): Ditto.
+        (HTMLButtonElementImpl::attach): Removed, because now the base class's attach does the right thing.
+        (HTMLFieldSetElementImpl::attach): Ditto.
+        (HTMLInputElementImpl::attach): Removed explicit createRendererIfNeeded call, not needed now that
+        HTMLGenericFormElementImpl calls through to its base class.
+        (HTMLLegendElementImpl::attach): Removed, because now the base class's attach does the right thing.
+        (HTMLSelectElementImpl::attach): Ditto.
+        (HTMLTextAreaElementImpl::attach): Ditto.
+
+        * khtml/html/html_imageimpl.cpp:
+        (HTMLImageElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
+        and then calling NodeBaseImpl::attach().
+        (HTMLImageElementImpl::detach): Call base class's detach() instead of NodeBaseImpl::detach(). No
+        need to skip the ElementImpl::detach() function, and important not to for the new "id" optimization.
+
+        * khtml/html/html_inlineimpl.h: Removed HTMLBRElementImpl::attach override.
+        * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach): Call base class's attach() instead
+        of creating renderer explicitly and then calling NodeBaseImpl::attach().
+
+        * khtml/html/html_objectimpl.h: Removed HTMLAppletElementImpl::attach override.
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLAppletElementImpl::attach): Removed, because the base class's attach does the right thing.
+        (HTMLEmbedElementImpl::attach): Call base class's attach() instead of creating renderer explicitly
+        and then calling NodeBaseImpl::attach().
+        (HTMLObjectElementImpl::attach): Ditto.
+
 2003-11-09  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3478317, letter/word-spacing don't inherit properly through italic/bold elements.
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index c4f1dca..952c915 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -378,8 +378,7 @@ void HTMLFrameElementImpl::attach()
         node = static_cast<HTMLElementImpl*>(node->parentNode());
     }
 
-    createRendererIfNeeded();
-    NodeBaseImpl::attach();
+    HTMLElementImpl::attach();
 
     if (!m_render)
         return;
@@ -555,8 +554,7 @@ void HTMLFrameSetElementImpl::attach()
         node = static_cast<HTMLElementImpl*>(node->parentNode());
     }
 
-    createRendererIfNeeded();
-    NodeBaseImpl::attach();
+    HTMLElementImpl::attach();
 }
 
 void HTMLFrameSetElementImpl::defaultEventHandler(EventImpl *evt)
@@ -675,8 +673,7 @@ RenderObject *HTMLIFrameElementImpl::createRenderer(RenderArena *arena, RenderSt
 
 void HTMLIFrameElementImpl::attach()
 {
-    createRendererIfNeeded();
-    NodeBaseImpl::attach();
+    HTMLElementImpl::attach();
 
     if (m_render) {
         // we need a unique name for every frame in the frameset. Hope that's unique enough.
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index 4afdfc2..16eae4a 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -761,7 +761,7 @@ void HTMLGenericFormElementImpl::attach()
 	    m_form->registerFormElement(this);
     }
 
-    NodeBaseImpl::attach();
+    HTMLElementImpl::attach();
 
     // The call to updateFromElement() needs to go after the call through
     // to the base class's attach() because that can sometimes do a close
@@ -1047,26 +1047,6 @@ void HTMLButtonElementImpl::parseAttribute(AttributeImpl *attr)
     }
 }
 
-void HTMLButtonElementImpl::attach()
-{
-    // FIXME: This code is repeated here because this method does not call
-    // HTMLGenericFormElementImpl::attach(). But it's not clear why the call
-    // to updateFromElement() is a problem for the HTMLButtonElementImpl case.
-    // If we determine that it's not, then we should remove this and call
-    // HTMLGenericFormElementImpl::attach() instead of HTMLElementImpl::attach().
-    if (!m_form) {
-	m_form = getForm();
-	if (m_form)
-	    m_form->registerFormElement(this);
-    }
-
-    // skip the generic handler
-    HTMLElementImpl::attach();
-    // doesn't work yet in the renderer ### fixme
-//     if (renderer())
-//         renderer()->setReplaced(true);
-}
-
 void HTMLButtonElementImpl::defaultEventHandler(EventImpl *evt)
 {
     if (m_type != BUTTON && (evt->id() == EventImpl::DOMACTIVATE_EVENT)) {
@@ -1137,12 +1117,6 @@ DOMString HTMLFieldSetElementImpl::type() const
     return "fieldset";
 }
 
-void HTMLFieldSetElementImpl::attach()
-{
-    createRendererIfNeeded();
-    HTMLGenericFormElementImpl::attach();
-}
-
 RenderObject* HTMLFieldSetElementImpl::createRenderer(RenderArena* arena, RenderStyle* style)
 {
     return new (arena) RenderFieldset(this);
@@ -1442,7 +1416,6 @@ void HTMLInputElementImpl::attach()
         break;
     }
 
-    createRendererIfNeeded();
     HTMLGenericFormElementImpl::attach();
 
 #if APPLE_CHANGES
@@ -1838,12 +1811,6 @@ NodeImpl::Id HTMLLegendElementImpl::id() const
     return ID_LEGEND;
 }
 
-void HTMLLegendElementImpl::attach()
-{
-    createRendererIfNeeded();
-    HTMLGenericFormElementImpl::attach();
-}
-
 RenderObject* HTMLLegendElementImpl::createRenderer(RenderArena* arena, RenderStyle* style)
 {
     return new (arena) RenderLegend(this);
@@ -2125,12 +2092,6 @@ RenderObject *HTMLSelectElementImpl::createRenderer(RenderArena *arena, RenderSt
     return new (arena) RenderSelect(this);
 }
 
-void HTMLSelectElementImpl::attach()
-{
-    createRendererIfNeeded();
-    HTMLGenericFormElementImpl::attach();
-}
-
 bool HTMLSelectElementImpl::encoding(const QTextCodec* codec, khtml::encodingList& encoded_values, bool)
 {
     bool successful = false;
@@ -2641,12 +2602,6 @@ RenderObject *HTMLTextAreaElementImpl::createRenderer(RenderArena *arena, Render
     return new (arena) RenderTextArea(this);
 }
 
-void HTMLTextAreaElementImpl::attach()
-{
-    createRendererIfNeeded();
-    HTMLGenericFormElementImpl::attach();
-}
-
 bool HTMLTextAreaElementImpl::encoding(const QTextCodec* codec, encodingList& encoding, bool)
 {
     if (name().isEmpty()) return false;
diff --git a/WebCore/khtml/html/html_formimpl.h b/WebCore/khtml/html/html_formimpl.h
index 76f1e10..1b386cb 100644
--- a/WebCore/khtml/html/html_formimpl.h
+++ b/WebCore/khtml/html/html_formimpl.h
@@ -212,7 +212,6 @@ public:
     virtual Id id() const;
     DOMString type() const;
 
-    virtual void attach();
     virtual void parseAttribute(AttributeImpl *attr);
     virtual void defaultEventHandler(EventImpl *evt);
     virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool);
@@ -239,7 +238,6 @@ public:
     virtual ~HTMLFieldSetElementImpl();
 
     virtual Id id() const;
-    virtual void attach();
     
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
 
@@ -372,7 +370,6 @@ public:
     virtual ~HTMLLegendElementImpl();
 
     virtual Id id() const;
-    virtual void attach();
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
 
     virtual DOMString type() const;
@@ -428,7 +425,6 @@ public:
 
     virtual void parseAttribute(AttributeImpl *attr);
 
-    virtual void attach();
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
     virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool);
 
@@ -573,7 +569,6 @@ public:
     void select (  );
 
     virtual void parseAttribute(AttributeImpl *attr);
-    virtual void attach();
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
     virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool);
     virtual void reset();
diff --git a/WebCore/khtml/html/html_imageimpl.cpp b/WebCore/khtml/html/html_imageimpl.cpp
index 4f9350e..b32207e 100644
--- a/WebCore/khtml/html/html_imageimpl.cpp
+++ b/WebCore/khtml/html/html_imageimpl.cpp
@@ -191,7 +191,7 @@ RenderObject *HTMLImageElementImpl::createRenderer(RenderArena *arena, RenderSty
 
 void HTMLImageElementImpl::attach()
 {
-    createRendererIfNeeded();
+    HTMLElementImpl::attach();
     if (m_render) {
         m_render->updateFromElement();
     }
@@ -201,8 +201,6 @@ void HTMLImageElementImpl::attach()
         document->addNamedImageOrForm(oldIdAttr);
         document->addNamedImageOrForm(oldNameAttr);
     }
-
-    NodeBaseImpl::attach();
 }
 
 void HTMLImageElementImpl::detach()
@@ -213,7 +211,7 @@ void HTMLImageElementImpl::detach()
 	document->removeNamedImageOrForm(oldNameAttr);
     }
 
-    NodeBaseImpl::detach();
+    HTMLElementImpl::detach();
 }
 
 long HTMLImageElementImpl::width() const
diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp
index 2634edc..d87157c 100644
--- a/WebCore/khtml/html/html_inlineimpl.cpp
+++ b/WebCore/khtml/html/html_inlineimpl.cpp
@@ -246,12 +246,6 @@ RenderObject *HTMLBRElementImpl::createRenderer(RenderArena *arena, RenderStyle
      return new (arena) RenderBR(this);
 }
 
-void HTMLBRElementImpl::attach()
-{
-    createRendererIfNeeded();
-    NodeImpl::attach();
-}
-
 // -------------------------------------------------------------------------
 
 HTMLFontElementImpl::HTMLFontElementImpl(DocumentPtr *doc)
diff --git a/WebCore/khtml/html/html_inlineimpl.h b/WebCore/khtml/html/html_inlineimpl.h
index cece915..447246a 100644
--- a/WebCore/khtml/html/html_inlineimpl.h
+++ b/WebCore/khtml/html/html_inlineimpl.h
@@ -60,7 +60,6 @@ public:
 
     virtual Id id() const;
     virtual void parseAttribute(AttributeImpl *attr);
-    virtual void attach();
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
 };
 
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index a867973..63fb861 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -129,12 +129,6 @@ RenderObject *HTMLAppletElementImpl::createRenderer(RenderArena *arena, RenderSt
 #endif
 }
 
-void HTMLAppletElementImpl::attach()
-{
-    createRendererIfNeeded();
-    NodeBaseImpl::attach();
-}
-
 bool HTMLAppletElementImpl::getMember(const QString & name, JType & type, QString & val) {
 #if APPLE_CHANGES
     return false;
@@ -262,11 +256,10 @@ void HTMLEmbedElementImpl::attach()
         addCSSLength( CSS_PROP_HEIGHT, "0" );
     }
     
-    createRendererIfNeeded();
+    HTMLElementImpl::attach();
     if (m_render) {
         static_cast<RenderPartObject*>(m_render)->updateWidget();
     }
-    NodeBaseImpl::attach();
 }
 
 // -------------------------------------------------------------------------
@@ -370,7 +363,8 @@ RenderObject *HTMLObjectElementImpl::createRenderer(RenderArena *arena, RenderSt
 
 void HTMLObjectElementImpl::attach()
 {
-    createRendererIfNeeded();
+    HTMLElementImpl::attach();
+
     if (m_render) {
         if (canRenderImageType(serviceType)) {
             m_render->updateFromElement();
@@ -383,8 +377,6 @@ void HTMLObjectElementImpl::attach()
         }
     }
 
-    NodeBaseImpl::attach();
-
     // ### do this when we are actually finished loading instead
     if (m_render)
         dispatchHTMLEvent(EventImpl::LOAD_EVENT,false,false);
diff --git a/WebCore/khtml/html/html_objectimpl.h b/WebCore/khtml/html/html_objectimpl.h
index d89bcf2..1297efd 100644
--- a/WebCore/khtml/html/html_objectimpl.h
+++ b/WebCore/khtml/html/html_objectimpl.h
@@ -47,7 +47,6 @@ public:
     virtual Id id() const;
 
     virtual void parseAttribute(AttributeImpl *token);
-    virtual void attach();
     virtual bool rendererIsNeeded(khtml::RenderStyle *);
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list