Invalid cast in WebCore::toElement / WebCore::HTMLElementStack::ElementRecord::element
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 07:32:52 +0000 (07:32 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 07:32:52 +0000 (07:32 +0000)
commit0c91da2f09dcb2ae98fd50d4b0d66984150127a7
tree5e5ac598a385afc8d4e62045c90fa70c1178d711
parenta045d6ca793b6dc0cff64465e6d0cad07aaa7d6e
Invalid cast in WebCore::toElement / WebCore::HTMLElementStack::ElementRecord::element
https://bugs.webkit.org/show_bug.cgi?id=78975

Reviewed by Eric Seidel.

Source/WebCore:

We're supposed to set the action attribute on the form element we just
created.  Previously, we assumed the newly created form element would
be on the top of the stack of open elements, but if we're in the table
body insertion mode, the form element gets treated as self closing and
is therefore popped off the stack of open elements.

Fortunately, we already cache a pointer to the most recently inserted
form element on the HTMLConstructionSite, so we can just grab the
element from there.

Test: html5lib/runner.html

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processIsindexStartTagForInBody):
(WebCore):

LayoutTests:

* html5lib/resourcesl/webkit-02.dat:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/html5lib/resources/webkit02.dat
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLTreeBuilder.cpp