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

abarth at webkit.org abarth at webkit.org
Wed Dec 22 11:23:10 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f9e3419c7274274f13c159e297d31738456f238f
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 21 12:53:21 2010 +0000

    2010-07-21  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Associate elements with the active form
            https://bugs.webkit.org/show_bug.cgi?id=42728
    
            This patch fixes fast/forms/formmove3.html.  The test still doesn't
            pass due to some render tree differences, but it works as intended now.
    
            To fix this test, I needed to deviate from the spec slight.  Minefield
            seems to have the same deviation:
              - http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
    
            * html/HTMLConstructionSite.cpp:
            (WebCore::HTMLConstructionSite::takeForm):
            (WebCore::HTMLConstructionSite::setForm):
            (WebCore::HTMLConstructionSite::createHTMLElement):
            * html/HTMLConstructionSite.h:
            (WebCore::HTMLConstructionSite::form):
            * html/HTMLTreeBuilder.cpp:
            (WebCore::HTMLTreeBuilder::processStartTagForInBody):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c2526f7..ff0bbad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,29 @@
 
         Reviewed by Eric Seidel.
 
+        Associate elements with the active form
+        https://bugs.webkit.org/show_bug.cgi?id=42728
+
+        This patch fixes fast/forms/formmove3.html.  The test still doesn't
+        pass due to some render tree differences, but it works as intended now.
+
+        To fix this test, I needed to deviate from the spec slight.  Minefield
+        seems to have the same deviation:
+          - http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
+
+        * html/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::takeForm):
+        (WebCore::HTMLConstructionSite::setForm):
+        (WebCore::HTMLConstructionSite::createHTMLElement):
+        * html/HTMLConstructionSite.h:
+        (WebCore::HTMLConstructionSite::form):
+        * html/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+
+2010-07-21  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         The adoption agency doesn't properly attach()
         https://bugs.webkit.org/show_bug.cgi?id=42727
 
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index 13a6d36..e9bb762 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -32,6 +32,8 @@
 #include "Element.h"
 #include "Frame.h"
 #include "HTMLDocument.h"
+#include "HTMLElementFactory.h"
+#include "HTMLFormElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLNames.h"
 #include "HTMLScriptElement.h"
@@ -141,6 +143,11 @@ HTMLConstructionSite::~HTMLConstructionSite()
 {
 }
 
+PassRefPtr<HTMLFormElement> HTMLConstructionSite::takeForm()
+{
+    return m_form.release();
+}
+
 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded()
 {
     if (m_document->frame() && !m_isParsingFragment)
@@ -234,6 +241,14 @@ void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken& token)
     m_openElements.pushHTMLBodyElement(attachToCurrent(createHTMLElement(token)));
 }
 
+void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken& token)
+{
+    insertHTMLElement(token);
+    ASSERT(currentElement()->isHTMLElement());
+    ASSERT(currentElement()->hasTagName(formTag));
+    m_form = static_cast<HTMLFormElement*>(currentElement());
+}
+
 void HTMLConstructionSite::insertHTMLElement(AtomicHTMLToken& token)
 {
     m_openElements.push(attachToCurrent(createHTMLElement(token)));
@@ -307,7 +322,12 @@ PassRefPtr<Element> HTMLConstructionSite::createElement(AtomicHTMLToken& token,
 
 PassRefPtr<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& token)
 {
-    RefPtr<Element> element = createElement(token, xhtmlNamespaceURI);
+    QualifiedName tagName(nullAtom, token.name(), xhtmlNamespaceURI);
+    // FIXME: This can't use HTMLConstructionSite::createElement because we
+    // have to pass the current form element.  We should rework form association
+    // to occur after construction to allow better code sharing here.
+    RefPtr<Element> element = HTMLElementFactory::createHTMLElement(tagName, m_document, form(), true);
+    element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission);
     ASSERT(element->isHTMLElement());
     return element.release();
 }
diff --git a/WebCore/html/HTMLConstructionSite.h b/WebCore/html/HTMLConstructionSite.h
index 176433b..d9c8ac5 100644
--- a/WebCore/html/HTMLConstructionSite.h
+++ b/WebCore/html/HTMLConstructionSite.h
@@ -55,6 +55,7 @@ public:
     void insertHTMLHtmlElement(AtomicHTMLToken&);
     void insertHTMLHeadElement(AtomicHTMLToken&);
     void insertHTMLBodyElement(AtomicHTMLToken&);
+    void insertHTMLFormElement(AtomicHTMLToken&);
     void insertScriptElement(AtomicHTMLToken&);
     void insertTextNode(const String&);
     void insertForeignElement(AtomicHTMLToken&, const AtomicString& namespaceURI);
@@ -83,10 +84,8 @@ public:
 
     Element* head() const { return m_head.get(); }
 
-    Element* form() const { return m_form.get(); }
-    PassRefPtr<Element> takeForm() { return m_form.release(); }
-
-    void setForm(PassRefPtr<Element> form) { m_form = form; }
+    HTMLFormElement* form() const { return m_form.get(); }
+    PassRefPtr<HTMLFormElement> takeForm();
 
     class RedirectToFosterParentGuard : public Noncopyable {
     public:
@@ -128,7 +127,7 @@ private:
 
     Document* m_document;
     RefPtr<Element> m_head;
-    RefPtr<Element> m_form;
+    RefPtr<HTMLFormElement> m_form;
     mutable HTMLElementStack m_openElements;
     mutable HTMLFormattingElementList m_activeFormattingElements;
 
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index a926a8b..cc24339 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -33,6 +33,7 @@
 #include "Frame.h"
 #include "HTMLDocument.h"
 #include "HTMLElementFactory.h"
+#include "HTMLFormElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLNames.h"
 #include "HTMLScriptElement.h"
@@ -845,8 +846,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
             return;
         }
         processFakePEndTagIfPInScope();
-        m_tree.insertHTMLElement(token);
-        m_tree.setForm(m_tree.currentElement());
+        m_tree.insertHTMLFormElement(token);
         return;
     }
     if (token.name() == liTag) {
@@ -1142,7 +1142,10 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
         parseError(token);
         if (m_tree.form())
             return;
-        m_tree.insertSelfClosingHTMLElement(token);
+        // FIXME: This deviates from the spec:
+        //        http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216
+        m_tree.insertHTMLFormElement(token);
+        m_tree.openElements()->pop();
         return;
     }
     parseError(token);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list