12017-03-05 Chris Dumez <cdumez@apple.com>
2
3 Using <form> in <template> causes following <form> to get swallowed
4 https://bugs.webkit.org/show_bug.cgi?id=163552
5
6 Reviewed by NOBODY (OOPS!).
7
8 As per the HTML specification [1], when finding a "form" tag in the "in body"
9 insertion mode, we should insert an HTML element for the token, and, if there
10 is no template element on the stack of open elements, set the form element
11 pointer to point to the element created.
12
13 We were missing the "if there is no template element on the stack of open
14 elements" check and setting the form element pointer unconditionally.
15 This patch fixes the issue.
16
17 [1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
18
19 Test: fast/parser/form-after-template.html
20
21 * html/parser/HTMLConstructionSite.cpp:
22 (WebCore::HTMLConstructionSite::insertHTMLFormElement):
23