A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

New Vocabularies Solution: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
* if current node is in the mathml namespace and is one of <mi>, <mo>, <mn>, <ms>, <mtext>, "in math content"
* if current node is in the mathml namespace and is one of <mi>, <mo>, <mn>, <ms>, <mtext>, "in math content"
* if current node is in the mathml namespace, "in math"
* if current node is in the mathml namespace, "in math"
* if current node is in the svg namespace and is one of <foreignObject>, <title>, <desc> "in svg content"
* if current node is in the svg namespace, "in svg"
* if current node is in the svg namespace, "in svg"


"in body":
'''"in body":'''
* "math" element - switch to "in math"
* "math" element - switch to "in math"
* "svg" element - switch to "in svg"
* "svg" element - switch to "in svg"


"in math":
'''"in math":'''


* comment
* comment
*# insert comment
*# insert comment
* text:
*# insert text


* doctype
* doctype
*# parse error
*# parse error
* text:
*# imply <mtext>
*# reprocess


* start tag for: <mi>, <mo>, <mn>, <ms>, <mtext>
* start tag for: <mi>, <mo>, <mn>, <ms>, <mtext>
Line 46: Line 46:




"in math content":
'''"in math content":'''


* start tag for one of: mglyph malignmark
* start tag for one of: mglyph malignmark
*# insert element for token, treat as void
* if the token is an end tag token and the current node is in the mathml namespace and matches the tag name of the token
** this should handle implied close tags
*# pop the current node, and switch to "in math"
* otherwise
*# treat as "in body"
'''"in svg":'''
First, perform tagname and attribute name fixup as follows: ...
* comment
*# insert comment
* text:
*# insert text
* doctype
*# parse error
* start tag for: <foreignObject>, <desc>, <title>
*# insert element for token
*# switch to "in svg content"
*# if the tag had a closing slash, imply a closing tag with the same tag name
* start tag for one of: ...
*# insert element for token
*# insert element for token
*# if the tag had a closing slash, imply a closing tag with the same tag name
*# if the tag had a closing slash, imply a closing tag with the same tag name


* end tag:
* other start tag:
# if the token is an end tag token and the current node is in the mathml namespace and matches the tag name of the token, pop the current node, and reset the insertion mode.
* end tag: </p> or </br>:
# otherwise, treat as "in body"
*# parse error
*# pop until <svg> element is popped
*# reset insertion mode
*# reprocess
 
* other end tag
*# if current element has the tag name of the token: pop it
*# otherwise: if there is a matching element in scope and it has the svg namespace: parse error, ignore token
*# otherwise:
*## parse error
*## pop until <svg> element is popped
*## reset insertion mode
*## reprocess
 
 
 
'''"in svg content":'''
 
* if the token is an end tag token and the current node is in the svg namespace and matches the tag name of the token
** this should handle implied close tags
*# pop the current node, and switch to "in svg"


* otherwise
* otherwise
# treat as "in body"
*# treat as "in body"
 
 
== MathML error handling in text/html ==
 
Require the following behaviour, since MathML requires the host language to define error handling:
 
* An element with the wrong number or type of children must render as an error indicator. (list cases)

Revision as of 08:03, 3 April 2008

resetting appropriately:

  • if current node is in the mathml namespace and is one of <mi>, <mo>, <mn>, <ms>, <mtext>, "in math content"
  • if current node is in the mathml namespace, "in math"
  • if current node is in the svg namespace and is one of <foreignObject>, <title>, <desc> "in svg content"
  • if current node is in the svg namespace, "in svg"

"in body":

  • "math" element - switch to "in math"
  • "svg" element - switch to "in svg"

"in math":

  • comment
    1. insert comment
  • text:
    1. insert text
  • doctype
    1. parse error
  • start tag for: <mi>, <mo>, <mn>, <ms>, <mtext>
    1. insert element for token
    2. switch to "in math content"
    3. if the tag had a closing slash, imply a closing tag with the same tag name
  • start tag for one of: maction maligngroup malignmark menclose merror mfenced mfrac mglyph mlabeledtr mmultiscripts mover mpadded mphantom mprescripts mroot mrow mspace msqrt mstyle msub msubsup msup mtable mtd mtr munder munderover none
    1. insert element for token
    2. if the tag had a closing slash, imply a closing tag with the same tag name
  • other start tag:
  • end tag:

    or
    :
    1. parse error
    2. pop until <math> element is popped
    3. reset insertion mode
    4. reprocess
  • other end tag
    1. if current element has the tag name of the token: pop it
    2. otherwise: if there is a matching element in scope and it has the mathml namespace: parse error, ignore token
    3. otherwise:
      1. parse error
      2. pop until <math> element is popped
      3. reset insertion mode
      4. reprocess


"in math content":

  • start tag for one of: mglyph malignmark
    1. insert element for token, treat as void
  • if the token is an end tag token and the current node is in the mathml namespace and matches the tag name of the token
    • this should handle implied close tags
    1. pop the current node, and switch to "in math"
  • otherwise
    1. treat as "in body"


"in svg":

First, perform tagname and attribute name fixup as follows: ...

  • comment
    1. insert comment
  • text:
    1. insert text
  • doctype
    1. parse error
  • start tag for: <foreignObject>, <desc>, <title>
    1. insert element for token
    2. switch to "in svg content"
    3. if the tag had a closing slash, imply a closing tag with the same tag name
  • start tag for one of: ...
    1. insert element for token
    2. if the tag had a closing slash, imply a closing tag with the same tag name
  • other start tag:
  • end tag:

    or
    :
    1. parse error
    2. pop until <svg> element is popped
    3. reset insertion mode
    4. reprocess
  • other end tag
    1. if current element has the tag name of the token: pop it
    2. otherwise: if there is a matching element in scope and it has the svg namespace: parse error, ignore token
    3. otherwise:
      1. parse error
      2. pop until <svg> element is popped
      3. reset insertion mode
      4. reprocess


"in svg content":

  • if the token is an end tag token and the current node is in the svg namespace and matches the tag name of the token
    • this should handle implied close tags
    1. pop the current node, and switch to "in svg"
  • otherwise
    1. treat as "in body"


MathML error handling in text/html

Require the following behaviour, since MathML requires the host language to define error handling:

  • An element with the wrong number or type of children must render as an error indicator. (list cases)