HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

View: New views
6 Messages — Rating Filter:   Alert me  

HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

by Dan Connolly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

John, Noah, TimBL, Henry,

Have you looked at the integration of MathML and SVG into HTML 5?

John, I'm interested in your take, as both an HTML WG
member and a TAG member. I also note that Nokia
provided an editor, Lasse Pajunen, for http://www.w3.org/TR/WICD/ ;
don't feel obliged to represent a Nokia position in the TAG,
but if he's not too far down the hall, I suppose you might
naturally cross paths.

Noah, I'm interested in your take, as you provided the TAG
a sort of survey of the space around CDF and your experience
with Lotus notes etc. seems relevant.
http://lists.w3.org/Archives/Public/www-tag/2005Oct/0040

Henry, I'd like this to cross your radar since you're
chairing the 19 Nov TAG teleconference. On 8 Sep,
Maciej said the issue is all but resolved; HTML WG has no
plans to discuss this issue further as a group.
http://lists.w3.org/Archives/Public/public-html-wg-issue-tracking/2009Sep/0002.html
I don't think it's a "now or never" situation, but
if the 19 Nov agenda isn't full, maybe this fits.


TimBL, you have talked about more general mechanisms in this
space...

This design seems OK to me. There isn't a general-purpose mechanism
for mixing other UI-related namespaces in the spec, but any mechanism
of that sort that should come along should be consistent with
the HTML 5 design, IMO. (I gather XBL and/or XBL2 propose designs
in this space; they seem to be in the someday pile.)
That is: I don't think the HTML 5 design completely addresses
our mixed UI namespace issue, but I'm OK with constraining
any solution to this issue to be compatible with the HTML 5 design.

The HTML 5 design puts MathML elements in the MathML namespace
(and likewise SVG) with no syntactic cost to authors:

[[

Here is an example of the use of MathML in an HTML document:

<!DOCTYPE html>
<html>
 <head>
  <title>The quadratic formula</title>
 </head>
 <body>
  <h1>The quadratic formula</h1>
  <p>
   <math>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
     <mrow>
      <mo form="prefix">−</mo> <mi>b</mi>
      <mo>±</mo>
      <msqrt>
       <msup> <mi>b</mi> <mn>2</mn> </msup>
       <mo>−</mo>
       <mn>4</mn> <mo>⁢</mo> <mi>a</mi> <mo>⁢</mo> <mi>c</mi>
      </msqrt>
     </mrow>
     <mrow>
      <mn>2</mn> <mo>⁢</mo> <mi>a</mi>
     </mrow>
    </mfrac>
   </math>
  </p>
 </body>
</html>
]]
 -- http://dev.w3.org/html5/spec/the-canvas-element.html#mathml

[[
9.2.5.10 The "in body" insertion mode
Status: Last call for comments

When the insertion mode is "in body", tokens must be handled as follows:

A start tag whose tag name is "math"
       
        Reconstruct the active formatting elements, if any.
       
        Adjust MathML attributes for the token. (This fixes the case of
        MathML attributes that are not all lowercase.)
       
        Adjust foreign attributes for the token. (This fixes the use of
        namespaced attributes, in particular XLink.)
       
        Insert a foreign element for the token, in the MathML namespace.
]]
  -- http://dev.w3.org/html5/spec/syntax.html#parsing-main-inbody


For reference:
ISSUE-33 mixedUIXMLNamespace-33
Composability for user interface-oriented XML namespaces
http://www.w3.org/2001/tag/group/track/issues/33


p.s. I stuck this in tracker as ACTION-332.


--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
gpg D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E



Re: HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

by noah_mendelsohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan Connolly wrote:

> Noah, I'm interested in your take, as you provided the TAG
> a sort of survey of the space around CDF and your experience
> with Lotus notes etc. seems relevant.
> http://lists.w3.org/Archives/Public/www-tag/2005Oct/0040

Gee, how did that pop up on your radar?  Interesting to read it again, but
not a major source of detailed ideas for me in drafting the following
(I.e. readers of this email should feel no need to plow through the
document referenced above.)

> Have you looked at the integration of MathML and SVG into HTML 5?

If I understand the key design points in the current HTML draft, they
generalize as:  >>when using the text/html serialization, namespace
qualification in the DOM is provided only for particular vocabularies that
are baked into the (then current) version of the HTML Recommendation. Such
vocabularies will, in practice, be usable without prefix qualification; in
fact, even well known prefixes like <svg:circle> will not work. In HTML 5,
the supported vocabularies will be MathML and SVG.<<

(I'm not 100% sure regarding the bit about the prefixes not working if you
use them;  a quick search of the spec didn't yield a clear answer, but I
may well not have looked in the right places.)

> [...Dan quotes a sample document with no prefixes...]

To me, the big deals are:

* The fact that new vocabularies have to be explicitly supported with
modifications to the HTML Recommendations.  Stated differently: this is a
proposal for non-decentralized extensibility.
* The fact that qualified forms aren't supported (as best I can tell),
even when conventional prefixes are used.

The first of those points is "the big debate".  I did my best to outline
the pros and cons in my TPAC presentation [1].  I still am among those who
believe that it's worth trying very hard to do better.  Insofar as I
understand Liam Quin's proposal, it seems to offer at least an interesting
direction, in part because it offers a more decentralized way of
supporting new vocabularies, and evolving for eventual support in the core
specification.

On the second point, if a way can be found to make prefixing work better
in text/html, I think that would be a big plus, as this points a way
toward eventual convergence of XML and text/html, should users wish to go
there.  Supporting prefixes, even just for well-known vocabularies like
SVG, would help with some copy/paste and XSL scenarios, and would also
greatly increase the size of the polyglot subset.   I understand this is a
hard problem and I don't at this point have a closed-form solution to
promote.

For a non-decentralized design, what's proposed in the HTML draft seems
quite good, modulo the vague wish that there could be some way found to
support explicit prefixes as well.

Noah

[1] http://lists.w3.org/Archives/Public/www-archive/2009Nov/0004.html

--------------------------------------
Noah Mendelsohn
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








Dan Connolly <connolly@...>
Sent by: www-tag-request@...
11/10/2009 11:56 PM
 
        To:     www-tag@...
        cc:     "Michael(tm) Smith" <mike@...>, Maciej Stachowiak
<mjs@...>, (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        HTML 5 integration of SVG and MathML addresses
ISSUE-33/mixedUIXMLNamespace-33?


John, Noah, TimBL, Henry,

Have you looked at the integration of MathML and SVG into HTML 5?

John, I'm interested in your take, as both an HTML WG
member and a TAG member. I also note that Nokia
provided an editor, Lasse Pajunen, for http://www.w3.org/TR/WICD/ ;
don't feel obliged to represent a Nokia position in the TAG,
but if he's not too far down the hall, I suppose you might
naturally cross paths.

Noah, I'm interested in your take, as you provided the TAG
a sort of survey of the space around CDF and your experience
with Lotus notes etc. seems relevant.
http://lists.w3.org/Archives/Public/www-tag/2005Oct/0040

Henry, I'd like this to cross your radar since you're
chairing the 19 Nov TAG teleconference. On 8 Sep,
Maciej said the issue is all but resolved; HTML WG has no
plans to discuss this issue further as a group.
http://lists.w3.org/Archives/Public/public-html-wg-issue-tracking/2009Sep/0002.html

I don't think it's a "now or never" situation, but
if the 19 Nov agenda isn't full, maybe this fits.


TimBL, you have talked about more general mechanisms in this
space...

This design seems OK to me. There isn't a general-purpose mechanism
for mixing other UI-related namespaces in the spec, but any mechanism
of that sort that should come along should be consistent with
the HTML 5 design, IMO. (I gather XBL and/or XBL2 propose designs
in this space; they seem to be in the someday pile.)
That is: I don't think the HTML 5 design completely addresses
our mixed UI namespace issue, but I'm OK with constraining
any solution to this issue to be compatible with the HTML 5 design.

The HTML 5 design puts MathML elements in the MathML namespace
(and likewise SVG) with no syntactic cost to authors:

[[

Here is an example of the use of MathML in an HTML document:

<!DOCTYPE html>
<html>
 <head>
  <title>The quadratic formula</title>
 </head>
 <body>
  <h1>The quadratic formula</h1>
  <p>
   <math>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
     <mrow>
      <mo form="prefix">−</mo> <mi>b</mi>
      <mo>±</mo>
      <msqrt>
       <msup> <mi>b</mi> <mn>2</mn> </msup>
       <mo>−</mo>
       <mn>4</mn> <mo>⁢</mo> <mi>a</mi> <mo>⁢</mo> <mi>c</mi>
      </msqrt>
     </mrow>
     <mrow>
      <mn>2</mn> <mo>⁢</mo> <mi>a</mi>
     </mrow>
    </mfrac>
   </math>
  </p>
 </body>
</html>
]]
 -- http://dev.w3.org/html5/spec/the-canvas-element.html#mathml

[[
9.2.5.10 The "in body" insertion mode
Status: Last call for comments

When the insertion mode is "in body", tokens must be handled as follows:

A start tag whose tag name is "math"
 
        Reconstruct the active formatting elements, if any.
 
        Adjust MathML attributes for the token. (This fixes the case of
        MathML attributes that are not all lowercase.)
 
        Adjust foreign attributes for the token. (This fixes the use of
        namespaced attributes, in particular XLink.)
 
        Insert a foreign element for the token, in the MathML namespace.
]]
  -- http://dev.w3.org/html5/spec/syntax.html#parsing-main-inbody


For reference:
ISSUE-33 mixedUIXMLNamespace-33
Composability for user interface-oriented XML namespaces
http://www.w3.org/2001/tag/group/track/issues/33


p.s. I stuck this in tracker as ACTION-332.


--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
gpg D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E





Re: HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

by Dan Connolly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-11-11 at 12:32 -0500, noah_mendelsohn@... wrote:
> Dan Connolly wrote:
[...]
> > Have you looked at the integration of MathML and SVG into HTML 5?
>
> If I understand the key design points in the current HTML draft, they
> generalize as:  >>when using the text/html serialization, namespace
> qualification in the DOM is provided only for particular vocabularies that
> are baked into the (then current) version of the HTML Recommendation. Such
> vocabularies will, in practice, be usable without prefix qualification; in
> fact, even well known prefixes like <svg:circle> will not work. In HTML 5,
> the supported vocabularies will be MathML and SVG.<<

That's my understanding as well.

[...]
> The first of those points is "the big debate".  I did my best to outline
> the pros and cons in my TPAC presentation [1].  I still am among those who
> believe that it's worth trying very hard to do better.  Insofar as I
> understand Liam Quin's proposal, it seems to offer at least an interesting
> direction, in part because it offers a more decentralized way of
> supporting new vocabularies, and evolving for eventual support in the core
> specification.

I'm not aware of anything in Liam's proposal that has to do with
user interface; i.e. screen arbitration, event bubbling, etc.

I gather MS IE and Firefox each implement a binding of namespaces
to user interface components. I'm not very familiar with either
of them; I think the Firefox implementation is called XBL.

Some quick research shows
XBL 2 is at CR as of March 2007 http://www.w3.org/TR/xbl/ , waiting
for 2 implementations.

Wikipedia says "There used to be an XBL 1.0 specification document on
Mozilla.org, which was submitted to W3C as a Technical Note, but the
actual implementation never did match the specification."
 -- http://en.wikipedia.org/wiki/XBL


The Internet Explorer documentation seems to be:

Introduction to DHTML Behaviors
http://msdn.microsoft.com/en-us/library/ms531079%28VS.85%29.aspx


I'm not sure if either of those mechanisms is powerful enough
to handle something like SVG or MathML.


> [1] http://lists.w3.org/Archives/Public/www-archive/2009Nov/0004.html

--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
gpg D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E



Re: HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

by Liam Quin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 11, 2009 at 03:07:25PM -0600, Dan Connolly wrote:
> On Wed, 2009-11-11 at 12:32 -0500, noah_mendelsohn@... wrote:
> > Dan Connolly wrote:
> [...]
> > > Have you looked at the integration of MathML and SVG into HTML 5?
> >
> I'm not aware of anything in Liam's proposal that has to do with
> user interface; i.e. screen arbitration, event bubbling, etc.

Correct.  My proposal is only a way to describe the proposed HTML 5
behaviour with the default namespace changing based on a hard-coded
list of elements in the browser, and also to allow users to add to
that list.

If you use Scent elements (say) and the Web browser doesn't
have the necessary smarts (and/or the necessary hardware) to
generate smells, that's a separate problem to the ability
to recognise that the "smell" element belongs to a specific
namespace other than a more recent version of HTML than the
browser author knew about.

Liam

--
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/
http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/


Re: HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?

by noah_mendelsohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wrote:

>  Insofar as I
> understand Liam Quin's proposal, it seems to offer at least an
interesting
> direction, in part because it offers a more decentralized way of
> supporting new vocabularies, and evolving for eventual support in the
core
> specification.

Dan Connolly wrote:

> I'm not aware of anything in Liam's proposal that has to do with
> user interface; i.e. screen arbitration, event bubbling, etc.

Nor am I.  What I meant by "evolving for eventual support in the core
specification" is that Liam's proposal, as I understand it, offers a
reasonably clean migration path from early deployments in which users
spell the image tag this way:

        <mosaic:img>

to a later state in which the HTML WG eventually decides that img should
be added to the core specification, and therefore allows it to be spelled
this way:

        <img>

Liam's proposal provides a way for making clear at runtime, and otherwise,
that these are in fact referring to the same element name (specifically to
the same expanded name).    I agree that it does nothing, before or after,
regarding UI integration, event bubbling, etc.  Sorry for any confusion.

Noah

--------------------------------------
Noah Mendelsohn
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








Dan Connolly <connolly@...>
11/11/2009 04:07 PM
 
        To:     noah_mendelsohn@...
        cc:     "Michael(tm) Smith" <mike@...>, Maciej Stachowiak
<mjs@...>, www-tag@..., liam@...
        Subject:        Re: HTML 5 integration of SVG and MathML addresses
 ISSUE-33/mixedUIXMLNamespace-33?


On Wed, 2009-11-11 at 12:32 -0500, noah_mendelsohn@... wrote:
> Dan Connolly wrote:
[...]
> > Have you looked at the integration of MathML and SVG into HTML 5?
>
> If I understand the key design points in the current HTML draft, they
> generalize as:  >>when using the text/html serialization, namespace
> qualification in the DOM is provided only for particular vocabularies
that
> are baked into the (then current) version of the HTML Recommendation.
Such
> vocabularies will, in practice, be usable without prefix qualification;
in
> fact, even well known prefixes like <svg:circle> will not work. In HTML
5,
> the supported vocabularies will be MathML and SVG.<<

That's my understanding as well.

[...]
> The first of those points is "the big debate".  I did my best to outline

> the pros and cons in my TPAC presentation [1].  I still am among those
who
> believe that it's worth trying very hard to do better.  Insofar as I
> understand Liam Quin's proposal, it seems to offer at least an
interesting
> direction, in part because it offers a more decentralized way of
> supporting new vocabularies, and evolving for eventual support in the
core
> specification.

I'm not aware of anything in Liam's proposal that has to do with
user interface; i.e. screen arbitration, event bubbling, etc.

I gather MS IE and Firefox each implement a binding of namespaces
to user interface components. I'm not very familiar with either
of them; I think the Firefox implementation is called XBL.

Some quick research shows
XBL 2 is at CR as of March 2007 http://www.w3.org/TR/xbl/ , waiting
for 2 implementations.

Wikipedia says "There used to be an XBL 1.0 specification document on
Mozilla.org, which was submitted to W3C as a Technical Note, but the
actual implementation never did match the specification."
 -- http://en.wikipedia.org/wiki/XBL


The Internet Explorer documentation seems to be:

Introduction to DHTML Behaviors
http://msdn.microsoft.com/en-us/library/ms531079%28VS.85%29.aspx


I'm not sure if either of those mechanisms is powerful enough
to handle something like SVG or MathML.


> [1] http://lists.w3.org/Archives/Public/www-archive/2009Nov/0004.html

--
Dan Connolly, W3C http://www.w3.org/People/Connolly/
gpg D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E





XBL2 as HTML5's extensibility mechanism (was Re: HTML 5 integration of SVG and MathML addresses ISSUE-33/mixedUIXMLNamespace-33?)

by Robin Berjon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 11, 2009, at 22:07 , Dan Connolly wrote:
Some quick research shows
XBL 2 is at CR as of March 2007 http://www.w3.org/TR/xbl/ , waiting
for 2 implementations.
(...)
I'm not sure if either of those mechanisms is powerful enough
to handle something like SVG or MathML.

To the best of my knowledge XBL2 could indeed be used to implement SVG or MathML, assuming you had the APIs to produce the graphics rendering (e.g. Canvas2D). It might not be trivial (e.g. you'd still have to do your own hit testing, animation engine, etc.) and it might not be fast (e.g. SVG's <use> element would probably do very nasty to the performance of your CSS cascade) but it would work. You'd get SVG elements that not only render as SVG elements but also behave as such and expose the same APIs.

I think that XBL2 solves a lot of the extensibility debate by putting the choice in the users' hands, leaving only the question of how to extend core, low-level functionality.

Say that in order to better capture email discussions that are archived as HTML documents I wished to create an element representing philippics. It would naturally be stylable, and would also expose its own specific API as part of the DOM (e.g. philippic.onhalfwaythrough = doze;). Using XBL2, I can build a binding that does just that. Then when it comes to syntax, the author using my binding has a choice of:

- if using XHTML (or any other XML language), have a <robin:philippic> element:
  @namespace robin url("http://berjon.com/ns/diatribes#");
  robin|philippic { binding: url("diatribes.xml#philippic") }

- just adding a <philippic> element to HTML:
  philippic { binding: url("diatribes.xml#philippic") }

- binding based on a class (<div class='philippic'>):
  .philippic { binding: url("diatribes.xml#philippic") }

- or on an attribute (<aside type='philippic'>):
  aside[type=philippic] { binding: url("diatribes.xml#philippic") }

Or in fact any CSS that draws my fancy (though the above three would be the expected big ones).

XBL2 is, effectively, an extensibility mechanism for any format that has a DOM and runs in UAs that support CSS. It is limited in the higher-level semantics that it can provide but then so are namespaces; and it would be quite trivial to embed something like RDDL in XBL2. It also isn't necessarily tied to JS and I believe it could be used as a GRRDL-like mechanism.

Some may balk at the notion of author-chosen syntax but that's not very different from the fact that authors can today turn pretty much any element into any other with a good dose of CSS. It also means that user style sheets can override disliked UA behaviour.

This does make repurposing content harder since one has to process the CSS as well as the content but I think that this problem has two sides: if you're doing fully open ended indexing of the web you probably need to process CSS anyway as otherwise content can game you by setting "display: none" on things a crawler should see but not users; conversely if you're processing content within a reasonably controlled environment you can impose a syntax.

Extensibility-wise this only leaves the case of core functionality that cannot be easily added without extending browsers (I wonder how much of this there is that isn't about accessing a device's capabilities). Say you wanted to make audio processing available in the browser using for instance a syntax similar to SVG's filters. You would probably need some form of audio functionality added to the browser. I'd make the case that much if not all of this functionality ought to be added as an API and have its declarative side handled by XBL2. This points to a much awaited TAG finding on API versioning and extensibility.

Remains the question of how we handle the case of a binding becoming popular enough that it ought to migrate into, say, HTML 8. Could maybe XBL2 have a form of use-native-if-available attribute? This however doesn't seem like a major hurdle to address.

So, is there any reason why we can't just dub XBL2 as HTML5's extensibility mechanism and declare victory?

-- 
Robin Berjon - http://berjon.com/