Bug 111907 - [HTMLTemplateElement] EOF should unwind the stack of template insertion modes iteratively
Summary: [HTMLTemplateElement] EOF should unwind the stack of template insertion modes...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rafael Weinstein
URL:
Keywords:
Depends on:
Blocks: 103547
  Show dependency treegraph
 
Reported: 2013-03-08 17:41 PST by Rafael Weinstein
Modified: 2013-03-13 17:05 PDT (History)
9 users (show)

See Also:


Attachments
Patch (6.03 KB, patch)
2013-03-08 17:44 PST, Rafael Weinstein
no flags Details | Formatted Diff | Diff
Patch (6.52 KB, patch)
2013-03-11 16:41 PDT, Rafael Weinstein
no flags Details | Formatted Diff | Diff
Patch (5.10 KB, patch)
2013-03-13 16:37 PDT, Rafael Weinstein
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Weinstein 2013-03-08 17:41:03 PST
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.
Comment 1 Rafael Weinstein 2013-03-08 17:44:18 PST
Created attachment 192317 [details]
Patch
Comment 2 Adam Klein 2013-03-08 17:49:23 PST
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 3 Rafael Weinstein 2013-03-08 17:59:17 PST
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 4 WebKit Review Bot 2013-03-08 18:34:20 PST
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
Comment 5 Adam Barth 2013-03-08 19:35:31 PST
Looks like you've got some failing tests to work through.
Comment 6 Build Bot 2013-03-09 02:41:52 PST
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
Comment 7 Rafael Weinstein 2013-03-11 16:41:47 PDT
Created attachment 192591 [details]
Patch
Comment 8 Rafael Weinstein 2013-03-11 16:41:59 PDT
Fixed template.innerHTML case
Comment 9 Rafael Weinstein 2013-03-13 16:37:15 PDT
Created attachment 193023 [details]
Patch
Comment 10 Rafael Weinstein 2013-03-13 16:38:14 PDT
PTAL. Note that the spec bug has been resolved here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20924
Comment 11 Adam Barth 2013-03-13 16:40:08 PDT
Comment on attachment 193023 [details]
Patch

ok
Comment 12 WebKit Review Bot 2013-03-13 17:05:45 PDT
Comment on attachment 193023 [details]
Patch

Clearing flags on attachment: 193023

Committed r145772: <http://trac.webkit.org/changeset/145772>
Comment 13 WebKit Review Bot 2013-03-13 17:05:50 PDT
All reviewed patches have been landed.  Closing bug.