Changeset 63815 in webkit
- Timestamp:
- Jul 21, 2010 5:53:21 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63814 r63815 1 2010-07-21 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Associate elements with the active form 6 https://bugs.webkit.org/show_bug.cgi?id=42728 7 8 This patch fixes fast/forms/formmove3.html. The test still doesn't 9 pass due to some render tree differences, but it works as intended now. 10 11 To fix this test, I needed to deviate from the spec slight. Minefield 12 seems to have the same deviation: 13 - http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216 14 15 * html/HTMLConstructionSite.cpp: 16 (WebCore::HTMLConstructionSite::takeForm): 17 (WebCore::HTMLConstructionSite::setForm): 18 (WebCore::HTMLConstructionSite::createHTMLElement): 19 * html/HTMLConstructionSite.h: 20 (WebCore::HTMLConstructionSite::form): 21 * html/HTMLTreeBuilder.cpp: 22 (WebCore::HTMLTreeBuilder::processStartTagForInBody): 23 1 24 2010-07-21 Adam Barth <abarth@webkit.org> 2 25 -
trunk/WebCore/html/HTMLConstructionSite.cpp
r63814 r63815 33 33 #include "Frame.h" 34 34 #include "HTMLDocument.h" 35 #include "HTMLElementFactory.h" 36 #include "HTMLFormElement.h" 35 37 #include "HTMLHtmlElement.h" 36 38 #include "HTMLNames.h" … … 142 144 } 143 145 146 PassRefPtr<HTMLFormElement> HTMLConstructionSite::takeForm() 147 { 148 return m_form.release(); 149 } 150 144 151 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded() 145 152 { … … 233 240 ASSERT(!shouldFosterParent()); 234 241 m_openElements.pushHTMLBodyElement(attachToCurrent(createHTMLElement(token))); 242 } 243 244 void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken& token) 245 { 246 insertHTMLElement(token); 247 ASSERT(currentElement()->isHTMLElement()); 248 ASSERT(currentElement()->hasTagName(formTag)); 249 m_form = static_cast<HTMLFormElement*>(currentElement()); 235 250 } 236 251 … … 308 323 PassRefPtr<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& token) 309 324 { 310 RefPtr<Element> element = createElement(token, xhtmlNamespaceURI); 325 QualifiedName tagName(nullAtom, token.name(), xhtmlNamespaceURI); 326 // FIXME: This can't use HTMLConstructionSite::createElement because we 327 // have to pass the current form element. We should rework form association 328 // to occur after construction to allow better code sharing here. 329 RefPtr<Element> element = HTMLElementFactory::createHTMLElement(tagName, m_document, form(), true); 330 element->setAttributeMap(token.takeAtributes(), m_fragmentScriptingPermission); 311 331 ASSERT(element->isHTMLElement()); 312 332 return element.release(); -
trunk/WebCore/html/HTMLConstructionSite.h
r63762 r63815 56 56 void insertHTMLHeadElement(AtomicHTMLToken&); 57 57 void insertHTMLBodyElement(AtomicHTMLToken&); 58 void insertHTMLFormElement(AtomicHTMLToken&); 58 59 void insertScriptElement(AtomicHTMLToken&); 59 60 void insertTextNode(const String&); … … 84 85 Element* head() const { return m_head.get(); } 85 86 86 Element* form() const { return m_form.get(); } 87 PassRefPtr<Element> takeForm() { return m_form.release(); } 88 89 void setForm(PassRefPtr<Element> form) { m_form = form; } 87 HTMLFormElement* form() const { return m_form.get(); } 88 PassRefPtr<HTMLFormElement> takeForm(); 90 89 91 90 class RedirectToFosterParentGuard : public Noncopyable { … … 129 128 Document* m_document; 130 129 RefPtr<Element> m_head; 131 RefPtr< Element> m_form;130 RefPtr<HTMLFormElement> m_form; 132 131 mutable HTMLElementStack m_openElements; 133 132 mutable HTMLFormattingElementList m_activeFormattingElements; -
trunk/WebCore/html/HTMLTreeBuilder.cpp
r63814 r63815 34 34 #include "HTMLDocument.h" 35 35 #include "HTMLElementFactory.h" 36 #include "HTMLFormElement.h" 36 37 #include "HTMLHtmlElement.h" 37 38 #include "HTMLNames.h" … … 846 847 } 847 848 processFakePEndTagIfPInScope(); 848 m_tree.insertHTMLElement(token); 849 m_tree.setForm(m_tree.currentElement()); 849 m_tree.insertHTMLFormElement(token); 850 850 return; 851 851 } … … 1143 1143 if (m_tree.form()) 1144 1144 return; 1145 m_tree.insertSelfClosingHTMLElement(token); 1145 // FIXME: This deviates from the spec: 1146 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216 1147 m_tree.insertHTMLFormElement(token); 1148 m_tree.openElements()->pop(); 1146 1149 return; 1147 1150 }
Note: See TracChangeset
for help on using the changeset viewer.