[Bug 18613] [Templates]: Section 7 Parsing HTML Templates needs to be re-written

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18613

--- Comment #6 from Rafael Weinstein <rafaelw@chromium.org> 2012-08-30 17:59:29 UTC ---
Decisions:

On Thu, Aug 30, 2012 at 10:52 AM, Rafael Weinstein <rafaelw@google.com> wrote:
> // Does naked template go into <head> or <body> -- as is, it goes into <head>
> #data
> <template>Hello</template>
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <template>
> |       "Hello"

This is correct (analog is <script>)

>
> // Can template exist as a child of <html> -- as is, it gets put into <head>
> #data
> <html><template><div>
> #errors
> #document
> | <html>
> |   <template>
> |     <div>
>

This is correct (analog is <script>)

> // Can template exist as a child of <colgroup> -- as is, no
> #data
> <table><colgroup><template>Hello
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <table>
> |       <colgroup>
> |         <template>
> |           "Hello"

We need parser edits for this. Relevant test which should pass is

// Can template exist as a child of <colgroup> -- as is, no
#data
<table><colgroup><template><col>
#errors
#document
| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <template>
|           <col>

>
> // Can template exist as a child of <frameset> -- as is, no
> #data
> <frameset><template><frame>
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <frameset>
> |       <template>
> |         <frame>

We need parser edits for this. Relevant test which should pass is

#data
<frameset><template><frame>
#errors
#document
| <html>
|   <head>
|   <frameset>
|     <template>
|       <frame>

>
> // Reset insertion mode picks InBody for </head>, which is wrong for this case.
> -- as is, this actually hits a series of assertions, and I'm pretty sure it's
> wrong.
> #data
> <head><template><div></div></template></head>
> #errors
> #document
> | <html>
> |   <head>
> |     <template>
> |       <div>

Step 11 of reset insertion mode appropriately should be:

If node is a head element and node is the context element, then switch the
insertion mode to "in body" ("in body"! not "in head"!) and abort these steps.
(fragment case)
otherwise, switch the insertion mode to "in head" and abort these steps.

>
> // Should "in cell" be modified to "close the cell" on </template> (e.g. with
> </table>, </tbody>, </tfoot>, </thead>, </tr>) -- as is, </tr> wil lbe ignored
> and <div> appended to <td>
> #data
> <body><template><td></tr><div></template>
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <template>
> |       <td>
> |       <div>

This is correct, but we need spec text that
http://dev.w3.org/html5/spec/parsing.html#has-an-element-in-table-scope
includes <template>

>
> Also, just to make sure this is what we want:
>
> #data
> <body><template><tr><div></div></tr></template>
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <template>
> |       <tr>
> |       <div>
>
> Note that the div is foster parented *after* the <tr>, not before.

Correct behavior.

>
> Likewise this one:
>
> #data
> <body><template><div><tr></tr></div></template>
> #errors
> #document
> | <html>
> |   <head>
> |   <body>
> |     <template>
> |       <div>
>
> (throws away the <tr> -- which I think makes sense).

Correct behavior.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 30 August 2012 17:59:31 UTC