W3C home > Mailing lists > Public > public-webapps-bugzilla@w3.org > August 2012

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

From: <bugzilla@jessica.w3.org>
Date: Thu, 30 Aug 2012 17:59:30 +0000
Message-Id: <E1T791e-0007KT-8K@jessica.w3.org>
To: public-webapps-bugzilla@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 30 August 2012 17:59:31 GMT