This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23152 - Call out that content model: Text, in HTML, depends on the kind of element
Summary: Call out that content model: Text, in HTML, depends on the kind of element
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P2 editorial
Target Milestone: ---
Assignee: Robin Berjon
QA Contact: HTML WG Bugzilla archive list
URL: http://www.w3.org/html/wg/drafts/html...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-04 09:13 UTC by Leif Halvard Silli
Modified: 2016-04-26 21:16 UTC (History)
6 users (show)

See Also:


Attachments

Description Leif Halvard Silli 2013-09-04 09:13:44 UTC
PROBLEM:

   The spec defines ‘content type’ like so:
      “A normative description of what content must be included
       as children and descendants of the element.”
http://www.w3.org/html/wg/drafts/html/master/single-page.html#element-dfn-content-model

   And like so:
      “Each element defined in this specification has a content
       model: a description of the element's expected contents”
http://www.w3.org/html/wg/drafts/html/master/single-page.html#element-dfn-content-model

   However, the exact meaning of such a ”normative description”
   is not decided by the code but by the result in the DOM:
      “The contents of an element are its children in the DOM”
http://www.w3.org/html/wg/drafts/html/master/single-page.html#concept-html-contents

   However, for most of the ”standard” content models, this is
   not a problem. For instance, the meaning of “flow content” is 
   unambiguous.

   But, viewed from code/author level, then, for
   “content model: Text”, the meaning varies, see below.
   This is a gotcha. And should be called out in the the 
   very definition of ”content type: Text”.
    

PROPOSAL:

  Inside the definition of “content model: Text”, call out
  that the meaning of ”Text” on the *code level* depends on

  A. Element kind: Whether the element is a normal element, a raw
     text element, an escapable raw text element etc
  B. For some of the element kinds: Whether the element
     occurs inside XHTML or HTML
  C. Whether there are "extra constraints"
  D. May be “whether the contents is an element or an
     attribute” should be mentioned as a condition.
  
  (Currently, the “extra constraints” condition, is the only
  condition that is mentioned)
  
EXACT TEXT SUGGESTION:

   ”For elements in HTML, the meaning of “content model: 
    Text” also depends the kind of element. For instance,
    an ”<” inside <textarea> does not need to be escaped
    in HTML because it is a raw text element. (This does not
    apply to XHTML. In XHTML, the kind of element doesn’t
    affect the meaning of ‘content model: Text’)”

JUSTIFICATION:

  The section on Terminology states:

   “when the specification states that a feature applies to
    the HTML syntax or the XHTML syntax, it also includes the
    other. When a feature specifically only applies to one of
    the two languages, it is called out by explicitly stating
    that it does not apply to the other format, as in "for
    HTML, ... (this does not apply to XHTML)".”
Comment 1 Leif Halvard Silli 2013-09-04 09:16:37 UTC
(In reply to comment #0)

> EXACT  TEXT SUGGESTION:
> 
>    ”For elements in HTML, the meaning of “content model: 
>     Text” also depends the kind of element. For instance,
>     an ”<” inside <textarea> does not need to be escaped
>     in HTML because it is a raw text element.

Correction: “it is a _escapable_ raw text element”

>     (This does not
>     apply to XHTML. In XHTML, the kind of element doesn’t
>     affect the meaning of ‘content model: Text’)”
Comment 2 Leif Halvard Silli 2013-09-04 09:27:17 UTC
The report (and comments) of bug 23145 might be helpful when evaluating this bug.
Comment 3 Leif Halvard Silli 2013-09-04 09:29:52 UTC
(In reply to comment #1)
> (In reply to comment #0)
> 
> > EXACT  TEXT SUGGESTION:
> > 
> >    ”For elements in HTML, the meaning of

Correction: replace ”meaning” with “constraints”


> >     “content model: 
> >     Text” also depends the kind of element. For instance,
> >     an ”<” inside <textarea> does not need to be escaped
> >     in HTML because it is a raw text element.
> 
> Correction: “it is a _escapable_ raw text element”
> 
> >     (This does not
> >     apply to XHTML. In XHTML, the kind of element doesn’t
> >     affect the meaning of ‘content model: Text’)”

Correction: again, replace ”meaning” with “constraints”
Comment 4 Leif Halvard Silli 2013-09-04 18:31:46 UTC
(In reply to comment #0)

>    And like so:
>       “Each element defined in this specification has a content
>        model: a description of the element's expected contents”
> http://www.w3.org/html/wg/drafts/html/master/single-page.html#element-dfn-
> content-model

correct URL:
http://www.w3.org/html/wg/drafts/html/master/single-page.html#content-models
Comment 5 Travis Leithead [MSFT] 2016-04-26 21:16:49 UTC
HTML5.1 Bugzilla Bug Triage: Fixed in PR https://github.com/w3c/html/pull/243

If this resolution is not satisfactory, please copy the relevant bug details/proposal into a new issue at the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new where it will be re-triaged. Thanks!