RE: Making template play nice with XML and tags-and-text

2012-08-06 Thread Tony Ross
From: hsivo...@gmail.com [mailto:hsivo...@gmail.com] On Behalf Of Henri Sivonen
Sent: Sunday, August 05, 2012 7:00 AM 
 On Wed, Jul 18, 2012 at 11:35 PM, Adam Barth w...@adambarth.com wrote:
  On Wed, Jul 18, 2012 at 11:29 AM, Adam Klein ad...@chromium.org
 wrote:
 
  On Wed, Jul 18, 2012 at 9:19 AM, Adam Barth w...@adambarth.com wrote:
 
  Inspired by a conversation with hsivonen in #whatwg, I spend some
  time thinking about how we would design template for an XML world.
  One idea I had was to put the elements inside the template into a
  namespace other than http://www.w3.org/1999/xhtml.
 
 On the face of things, this seems a lot less scary than the wormhole
 model. I think this merits further exploration! Thank you!

Just to clarify, is what you find scary about the other model the lack of 
support for XML, or something more?

I've been under the impression we're trying to shield HTML developers from 
namespaces, so I'm a little concerned that this new proposal will move us in 
the opposite direction. Sure I'd like a proposal that works for XML too, but 
not if it means making the feature confusing for web developers.

  Also, the elements inside template, though they appear to be HTML,
  wouldn't have any of the IDL attributes one might expect, e.g., a
  href=foo/a would have no href property in JS (nor would img
  have src, etc). They are, perhaps, too inert.
 
 I think that's not a problem, because you're not supposed to mutate the
 template anyway. You're supposed to clone the template and then mutate
 the clone.

I agree cloning is the main use case (and will probably require a dedicated API 
since cloneNode won't cut it as-is), but I wouldn't rule out developers 
altering templates dynamically. Under those conditions this exposes a lot of 
subtle differences I think most developers won't expect or understand. 

- Tony


RE: Making template play nice with XML and tags-and-text

2012-08-06 Thread Tony Ross
From: Adam Barth [mailto:w...@adambarth.com]
Sent: Monday, August 06, 2012 1:36 PM
 On Mon, Aug 6, 2012 at 11:44 AM, Tony Ross tr...@microsoft.com wrote:
 
  I've been under the impression we're trying to shield HTML developers
 from namespaces, so I'm a little concerned that this new proposal will
 move us in the opposite direction. Sure I'd like a proposal that works
 for XML too, but not if it means making the feature confusing for web
 developers.
 
 We already uses namespaces in HTML to implement SVG-in-HTML, for example.

I know and this works great at the parsing level, but developers get confused 
once they get to the DOM because suddenly namespaces matter again. I've lost 
count of how many times I've been asked why createElement(circle) doesn't 
work.

- Tony




RE: DOMParser Errors Should Be Exceptions

2012-05-23 Thread Tony Ross
 From: João Eiras [mailto:jo...@opera.com]

 Opera thrown an exception long time ago and since version 9.5 it changed
 the behavior to return the bogus parsererror tree because it caused
 yahoo mail to fail back them (among other things).
 
 While the current behavior of returning the parsererror document is
 inappropriate, I afraid it also unchangeable.

Has this been examined recently? In IE9+ DOMParser throws an exception when an 
XML parsing error is encountered. I've yet to hear of this causing a problem.

-Tony