The current implementation follows the previous spec language of unwinding all open templates immediately. The new language calls for other insertion modes to act as if a </template> had been seen, then reprocess the EOF (which is more consistent with existing parser mechanisms). There should be no observable difference between the two implementations, but we keep our parser inline with the spec, so this patch reflects the new spec language.
Created attachment 192317 [details] Patch
Comment on attachment 192317 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192317&action=review > Source/WebCore/html/parser/HTMLTreeBuilder.cpp:977 > + processTemplateEndTag(token); Don't you want to process a fake template end tag instead of passing an EndOfFile token through to processTemplateEndTag? That seems like the usual thing to do in this situation...
Comment on attachment 192317 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192317&action=review >> Source/WebCore/html/parser/HTMLTreeBuilder.cpp:977 >> + processTemplateEndTag(token); > > Don't you want to process a fake template end tag instead of passing an EndOfFile token through to processTemplateEndTag? That seems like the usual thing to do in this situation... That's what happens. The token is only used if there is a parseError. This isn't really helpful since our parserError(token) doesn't do anything. I realize this is confusing. processTemplateEndTag can be called with either a </template> or an EOF. It should be impossible to hit the parse error in the EOF case, but that doesn't help needing the token.
Comment on attachment 192317 [details] Patch Attachment 192317 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17017418 New failing tests: fast/dom/HTMLTemplateElement/innerHTML-inert.html fast/dom/HTMLTemplateElement/innerHTML.html
Looks like you've got some failing tests to work through.
Comment on attachment 192317 [details] Patch Attachment 192317 [details] did not pass mac-ews (mac): Output: http://webkit-commit-queue.appspot.com/results/17047655 New failing tests: editing/selection/selection-modify-crash.html
Created attachment 192591 [details] Patch
Fixed template.innerHTML case
Created attachment 193023 [details] Patch
PTAL. Note that the spec bug has been resolved here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20924
Comment on attachment 193023 [details] Patch ok
Comment on attachment 193023 [details] Patch Clearing flags on attachment: 193023 Committed r145772: <http://trac.webkit.org/changeset/145772>
All reviewed patches have been landed. Closing bug.