[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 12:56:18 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e164bb64a71814c872c057becd4b761907b51912
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 2 10:58:04 2010 +0000

    2010-09-02  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Dimitri Glazkov.
    
            Share more code between HTMLObjectElement and HTMLEmbedElement
            https://bugs.webkit.org/show_bug.cgi?id=45054
    
            This pushes more of HTMLObjectElement code down into
            HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement.
    
            This patch was originally written in one piece and reviewed by Dimitri.
            I'm landing it as four separate changes for easier readability and less
            chance of regression.
    
            No functional change, thus no tests.
    
            * html/HTMLEmbedElement.cpp:
            (WebCore::HTMLEmbedElement::HTMLEmbedElement):
            (WebCore::HTMLEmbedElement::create):
            * html/HTMLEmbedElement.h:
            * html/HTMLObjectElement.cpp:
            (WebCore::HTMLObjectElement::HTMLObjectElement):
            * html/HTMLObjectElement.h:
            * html/HTMLPlugInImageElement.cpp:
            (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
            (WebCore::HTMLPlugInImageElement::detach):
            (WebCore::HTMLPlugInImageElement::finishParsingChildren):
            * html/HTMLPlugInImageElement.h:
            * html/HTMLTagNames.in:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66657 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cd24a83..deb1310 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -25,6 +25,36 @@
         This pushes more of HTMLObjectElement code down into
         HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement.
 
+        This patch was originally written in one piece and reviewed by Dimitri.
+        I'm landing it as four separate changes for easier readability and less
+        chance of regression.
+
+        No functional change, thus no tests.
+
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::HTMLEmbedElement):
+        (WebCore::HTMLEmbedElement::create):
+        * html/HTMLEmbedElement.h:
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::HTMLObjectElement):
+        * html/HTMLObjectElement.h:
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
+        (WebCore::HTMLPlugInImageElement::detach):
+        (WebCore::HTMLPlugInImageElement::finishParsingChildren):
+        * html/HTMLPlugInImageElement.h:
+        * html/HTMLTagNames.in:
+
+2010-09-02  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Share more code between HTMLObjectElement and HTMLEmbedElement
+        https://bugs.webkit.org/show_bug.cgi?id=45054
+
+        This pushes more of HTMLObjectElement code down into
+        HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement.
+
         I also moved a little code from HTMLPluginElement to HTMLPlugInImageElement
         since HTMLAppletElement does not need to share this same widget update logic.
         This is a small correction from the previous change.
diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp
index 1e562d1..c2ca671 100644
--- a/WebCore/html/HTMLEmbedElement.cpp
+++ b/WebCore/html/HTMLEmbedElement.cpp
@@ -42,15 +42,15 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document* document)
-    : HTMLPlugInImageElement(tagName, document)
+inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document* document, bool createdByParser)
+    : HTMLPlugInImageElement(tagName, document, createdByParser)
 {
     ASSERT(hasTagName(embedTag));
 }
 
-PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document* document)
+PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
 {
-    return adoptRef(new HTMLEmbedElement(tagName, document));
+    return adoptRef(new HTMLEmbedElement(tagName, document, createdByParser));
 }
 
 static inline RenderWidget* findWidgetRenderer(const Node* n) 
diff --git a/WebCore/html/HTMLEmbedElement.h b/WebCore/html/HTMLEmbedElement.h
index bab1c64..c71fb1d 100644
--- a/WebCore/html/HTMLEmbedElement.h
+++ b/WebCore/html/HTMLEmbedElement.h
@@ -29,10 +29,10 @@ namespace WebCore {
 
 class HTMLEmbedElement : public HTMLPlugInImageElement {
 public:
-    static PassRefPtr<HTMLEmbedElement> create(const QualifiedName&, Document*);
+    static PassRefPtr<HTMLEmbedElement> create(const QualifiedName&, Document*, bool createdByParser);
 
 private:
-    HTMLEmbedElement(const QualifiedName&, Document*);
+    HTMLEmbedElement(const QualifiedName&, Document*, bool createdByParser);
 
     virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const;
     virtual void parseMappedAttribute(Attribute*);
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index d76c0c1..250930e 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -46,13 +46,10 @@ namespace WebCore {
 using namespace HTMLNames;
 
 inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document* document, bool createdByParser) 
-    : HTMLPlugInImageElement(tagName, document)
+    : HTMLPlugInImageElement(tagName, document, createdByParser)
     , m_docNamedItem(true)
     , m_useFallbackContent(false)
 {
-    // HTMLObjectElement tries to delay updating its widget while parsing until
-    // after all of its children are parsed.
-    setNeedsWidgetUpdate(!createdByParser);
     ASSERT(hasTagName(objectTag));
 }
 
@@ -147,24 +144,6 @@ void HTMLObjectElement::attach()
     }
 }
 
-void HTMLObjectElement::finishParsingChildren()
-{
-    HTMLPlugInImageElement::finishParsingChildren();
-    if (!useFallbackContent()) {
-        setNeedsWidgetUpdate(true);
-        if (inDocument())
-            setNeedsStyleRecalc();
-    }
-}
-
-void HTMLObjectElement::detach()
-{
-    if (attached() && renderer() && !useFallbackContent())
-        // Update the widget the next time we attach (detaching destroys the plugin).
-        setNeedsWidgetUpdate(true);
-    HTMLPlugInImageElement::detach();
-}
-
 void HTMLObjectElement::insertedIntoDocument()
 {
     if (isDocNamedItem() && document()->isHTMLDocument()) {
diff --git a/WebCore/html/HTMLObjectElement.h b/WebCore/html/HTMLObjectElement.h
index 13c0df8..4dc69af 100644
--- a/WebCore/html/HTMLObjectElement.h
+++ b/WebCore/html/HTMLObjectElement.h
@@ -48,8 +48,6 @@ private:
 
     virtual void attach();
     virtual bool rendererIsNeeded(RenderStyle*);
-    virtual void finishParsingChildren();
-    virtual void detach();
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
     
diff --git a/WebCore/html/HTMLPlugInImageElement.cpp b/WebCore/html/HTMLPlugInImageElement.cpp
index 7111c1f..51c29e2 100644
--- a/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/WebCore/html/HTMLPlugInImageElement.cpp
@@ -31,9 +31,13 @@
 
 namespace WebCore {
 
-HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document* document)
+HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document* document, bool createdByParser)
     : HTMLPlugInElement(tagName, document)
-    , m_needsWidgetUpdate(false)
+    // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay
+    // widget updates until after all children are parsed.  For HTMLEmbedElement
+    // this delay is unnecessary, but it is simpler to make both classes share
+    // the same codepath in this class.
+    , m_needsWidgetUpdate(!createdByParser)    
 {
 }
 
@@ -74,6 +78,14 @@ RenderObject* HTMLPlugInImageElement::createRenderer(RenderArena* arena, RenderS
     return new (arena) RenderEmbeddedObject(this);
 }
 
+void HTMLPlugInImageElement::detach()
+{
+    if (attached() && renderer() && !useFallbackContent())
+        // Update the widget the next time we attach (detaching destroys the plugin).
+        setNeedsWidgetUpdate(true);
+    HTMLPlugInElement::detach();
+}
+
 void HTMLPlugInImageElement::updateWidget()
 {
     document()->updateStyleIfNeeded();
@@ -81,6 +93,16 @@ void HTMLPlugInImageElement::updateWidget()
         renderEmbeddedObject()->updateWidget(true);
 }
 
+void HTMLPlugInImageElement::finishParsingChildren()
+{
+    HTMLPlugInElement::finishParsingChildren();
+    if (!useFallbackContent()) {
+        setNeedsWidgetUpdate(true);
+        if (inDocument())
+            setNeedsStyleRecalc();
+    }
+}
+
 void HTMLPlugInImageElement::willMoveToNewOwnerDocument()
 {
     if (m_imageLoader)
diff --git a/WebCore/html/HTMLPlugInImageElement.h b/WebCore/html/HTMLPlugInImageElement.h
index 9e19b27..94e6094 100644
--- a/WebCore/html/HTMLPlugInImageElement.h
+++ b/WebCore/html/HTMLPlugInImageElement.h
@@ -38,23 +38,24 @@ public:
     void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = needsWidgetUpdate; }
 
     RenderEmbeddedObject* renderEmbeddedObject() const;
-    
+
 protected:
-    HTMLPlugInImageElement(const QualifiedName& tagName, Document*);
+    HTMLPlugInImageElement(const QualifiedName& tagName, Document*, bool createdByParser);
 
     bool isImageType();
 
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-
-    static void updateWidgetCallback(Node*);
-
     OwnPtr<HTMLImageLoader> m_imageLoader;
     String m_serviceType;
     String m_url;
 
+    static void updateWidgetCallback(Node*);
+    virtual void detach();
+
 private:
     virtual bool canLazyAttach() { return false; }
-
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+    
+    virtual void finishParsingChildren();
     virtual void willMoveToNewOwnerDocument();
 
     void updateWidget();
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index f844fa8..209636d 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -43,7 +43,7 @@ div
 dl interfaceName=HTMLDListElement
 dt interfaceName=HTMLElement
 em interfaceName=HTMLElement
-embed
+embed constructorNeedsCreatedByParser
 fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement
 figcaption interfaceName=HTMLElement
 figure interfaceName=HTMLElement
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index 958d946..ceafb88 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -40,7 +40,6 @@
 #include "HTMLNames.h"
 #include "HTMLPlugInImageElement.h"
 #include "MIMETypeRegistry.h"
-#include "Node.h"
 #include "Page.h"
 #include "PluginData.h"
 #include "RenderEmbeddedObject.h"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list