Feedback on XML content sink plans

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Feedback on XML content sink plans

Henri Sivonen
I wrote about my plans on incrementalizing the XML content sink (bug
18333):
http://hsivonen.iki.fi/kesakoodi/content-sink/

I would appreciate a sanity check. Does it look right?

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Christian Biesinger
Henri Sivonen wrote:
> I wrote about my plans on incrementalizing the XML content sink (bug
> 18333):
> http://hsivonen.iki.fi/kesakoodi/content-sink/

What does "I should also figure out how to show an error banner and get
rid of the Yellow Screen of Death." mean? In particular, what's an error
banner? And what would you show instead of the "yellow screen of death"?
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Nickolay Ponomarev
On 6/11/06, Christian Biesinger <[hidden email]> wrote:
> Henri Sivonen wrote:
> > I wrote about my plans on incrementalizing the XML content sink (bug
> > 18333):
> > http://hsivonen.iki.fi/kesakoodi/content-sink/
>
> What does "I should also figure out how to show an error banner and get
> rid of the Yellow Screen of Death." mean? In particular, what's an error
> banner? And what would you show instead of the "yellow screen of death"?

As I understand, Henri refers to the yellow-ish infobar widget popping
above the content area in Firefox as a "banner". It is the planned
replacement for the yellow XML error screen (so people will be able to
*gasp* view malformed XHTML documents, at least partially).

Nickolay
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Christian Biesinger
In article <[hidden email]>,
 Christian Biesinger <[hidden email]> wrote:

> Henri Sivonen wrote:
> > I wrote about my plans on incrementalizing the XML content sink (bug
> > 18333):
> > http://hsivonen.iki.fi/kesakoodi/content-sink/
>
> What does "I should also figure out how to show an error banner and get
> rid of the Yellow Screen of Death." mean? In particular, what's an error
> banner?

I mean a thing like the missing plug-ins alert that is shown between the
toolbars and the content area. I hope there's a general purpose
interface for requesting such a thing to be shown. Is there?

> And what would you show instead of the "yellow screen of death"?

In the error banner something along the lines of "An XML parse error was
encountered. The document is only partially rendered." and in the
content area the document rendered up to the first fatal error.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Christian Biesinger
Nickolay Ponomarev wrote:
> (so people will be able to
> *gasp* view malformed XHTML documents, at least partially).

It's not exactly clear to me that this is desirable.  Is it?

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
> I mean a thing like the missing plug-ins alert that is shown between the
> toolbars and the content area. I hope there's a general purpose
> interface for requesting such a thing to be shown. Is there?

How will XML errors be presented in non-Firefox Gecko browsers?

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
> I wrote about my plans on incrementalizing the XML content sink (bug
> 18333):
> http://hsivonen.iki.fi/kesakoodi/content-sink/
>
> I would appreciate a sanity check. Does it look right?

I'm not completely convinced by the "Tearing down the document in mid-layout and
replacing it with the Yellow Screen of Death would make the user experience
unstable" part...  Some discussion of that (sicking?  peterv?  jst?) would be nice.

What happens if the error is inside a <script> tag?  Do we "partially render"
the script?   I feel we should not.

What happens with XSLT exactly?  That is, how is a well-formedness error in a
document that has an XSLT stylesheet handled?

 > Don’t be incremental with innerHTML.
 > Don’t be incremental with XHR.

Not an issue; that stuff isn't being rendered anyway.  So either behavior is ok
here; just do whatever is easiest.

 > Don’t be incremental with DOM LS.

I don't believe we implement that, do we?

 > Don’t be incremental with XUL—at least not when loading the local UI.

XUL doesn't use the XML content sink, so it's all ok.

 > Don’t be incremental with XBL when loading a binding.

Again, either behavior is fine here; do whatever is easiest.

 > Don’t be incremental with RDF when loading a graph.

RDF doesn't use the XML content sink.

 > I’d rather not factor anything out of SinkContext.

That's all the code that keeps track of what's been flushed, etc.  Is the plan
to just fork it all, then?

-Boris






_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Christian Biesinger
In reply to this post by Boris Zbarsky
Boris Zbarsky wrote:
> Nickolay Ponomarev wrote:
>> (so people will be able to
>> *gasp* view malformed XHTML documents, at least partially).
>
> It's not exactly clear to me that this is desirable.  Is it?

Yeah, I don't think so either. Plus, what's the point? Users will never
see invalid XML documents anyway, and authors ought to get pointed to
their bugs visibly.
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Laurens Holst-2
In reply to this post by Boris Zbarsky
Boris Zbarsky schreef:
> Henri Sivonen wrote:
>> I mean a thing like the missing plug-ins alert that is shown between
>> the toolbars and the content area. I hope there's a general purpose
>> interface for requesting such a thing to be shown. Is there?
>
> How will XML errors be presented in non-Firefox Gecko browsers?

I believe Opera does not show the document, but it does continue to
evaluate it past the first error to be able to show the developer all
the errors at once if they exist.

Or at least, that’s what I recall reading somewhere.


~Grauw

--
Ushiko-san! Kimi wa doushite, Ushiko-san!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laurens Holst, student, university of Utrecht, the Netherlands.
Website: www.grauw.nl. Backbase employee; www.backbase.com.

_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Boris Zbarsky
In article <[hidden email]>,
 Boris Zbarsky <[hidden email]> wrote:

> Henri Sivonen wrote:
> > I wrote about my plans on incrementalizing the XML content sink (bug
> > 18333):
> > http://hsivonen.iki.fi/kesakoodi/content-sink/
> >
> > I would appreciate a sanity check. Does it look right?

> What happens if the error is inside a <script> tag?  Do we "partially render"
> the script?   I feel we should not.

Probably not. The HTML side has a malformed flag.

> What happens with XSLT exactly?  That is, how is a well-formedness error in a
> document that has an XSLT stylesheet handled?
>
>  > Don¹t be incremental with innerHTML.
>  > Don¹t be incremental with XHR.
>
> Not an issue; that stuff isn't being rendered anyway.  So either behavior is
> ok
> here; just do whatever is easiest.

Great.

>  > Don¹t be incremental with DOM LS.
>
> I don't believe we implement that, do we?

What's nsLoadSaveContentSink for?

>  > Don¹t be incremental with XBL when loading a binding.
>
> Again, either behavior is fine here; do whatever is easiest.

Excellent.

>  > I¹d rather not factor anything out of SinkContext.
>
> That's all the code that keeps track of what's been flushed, etc.  Is the
> plan
> to just fork it all, then?

Perhaps forking it isn't a good idea after all. Would it be smart to
move SinkContext into a separate .cpp/h file pair and inherit an
nsHTMLSinkContext and an nsXMLSinkContext so that the XML side would
only have one context?

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Boris Zbarsky
In article <[hidden email]>,
 Boris Zbarsky <[hidden email]> wrote:

> Henri Sivonen wrote:
> > I mean a thing like the missing plug-ins alert that is shown between the
> > toolbars and the content area. I hope there's a general purpose
> > interface for requesting such a thing to be shown. Is there?
>
> How will XML errors be presented in non-Firefox Gecko browsers?

I don't know. Do they have any mechanism for the plug-in alert?

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Laurens Holst-2
In article <[hidden email]>,
 Laurens Holst <[hidden email]> wrote:

> Boris Zbarsky schreef:
> > Henri Sivonen wrote:
> >> I mean a thing like the missing plug-ins alert that is shown between
> >> the toolbars and the content area. I hope there's a general purpose
> >> interface for requesting such a thing to be shown. Is there?
> >
> > How will XML errors be presented in non-Firefox Gecko browsers?
>
> I believe Opera does not show the document

However, if offers to reparse the document as HTML.

Safari, on the other hand, builds the DOM up to the first error and then
inserts the error message as the first child of the root element.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Christian Biesinger
In article <[hidden email]>,
 Christian Biesinger <[hidden email]> wrote:

> Boris Zbarsky wrote:
> > Nickolay Ponomarev wrote:
> >> (so people will be able to
> >> *gasp* view malformed XHTML documents, at least partially).
> >
> > It's not exactly clear to me that this is desirable.  Is it?
>
> Yeah, I don't think so either. Plus, what's the point? Users will never
> see invalid XML documents anyway,

Really? I've seen the Yellow Screen of Death on sites of well-known
smart XML-aware people (I'm not naming names), because they produce
their XHTML with text-based templating rather than tools designed for
XML.

> and authors ought to get pointed to
> their bugs visibly.

An error banner would be quite visible.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
>>  > Don¹t be incremental with DOM LS.
>>
>> I don't believe we implement that, do we?
>
> What's nsLoadSaveContentSink for?

DOM LS.  But if you note, it's not actually compiled.  ;)

> Perhaps forking it isn't a good idea after all. Would it be smart to
> move SinkContext into a separate .cpp/h file pair and inherit an
> nsHTMLSinkContext and an nsXMLSinkContext so that the XML side would
> only have one context?

Hmm... That might be a reasonable approach...  Run that by sicking and peterv?

-Boris

_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
> I don't know. Do they have any mechanism for the plug-in alert?

Not really.  In Firefox it's triggered via random DOM events, as I understand.
Other Gecko-based browsers don't necessarily have an equivalent notification
mechanism.

We could start requiring such an out-of-band mechanism from all Gecko embeddors
and introduce a notification that gets sent when there's an XML parse error, I
guess...

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Christian Biesinger
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
> An error banner would be quite visible.

I disagree, an error banner is just some small text at the top, where
people don't look much.
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Boris Zbarsky
In article <[hidden email]>,
 Boris Zbarsky <[hidden email]> wrote:

> Henri Sivonen wrote:
> >>  > Don©–t be incremental with DOM LS.
> >>
> >> I don't believe we implement that, do we?
> >
> > What's nsLoadSaveContentSink for?
>
> DOM LS.  But if you note, it's not actually compiled.  ;)

OK. :-)

> > Perhaps forking it isn't a good idea after all. Would it be smart to
> > move SinkContext into a separate .cpp/h file pair and inherit an
> > nsHTMLSinkContext and an nsXMLSinkContext so that the XML side would
> > only have one context?
>
> Hmm... That might be a reasonable approach...

I started doing that today. Now I am having serious second thoughs.

First, the SinkContext is very HTML-specific--the HTMLness all over
it so that it is hard to factor out without breaking the HTML side.
Second, spreading the use of SinkContext would make it
more entrenched and would probably raise the barrier of getting the
eight-year-old HTML parser/sink combo replaced with a line-by-line
implementation of the HTML5 parsing spec. And the more I read the code,
the more I'd like to see an HTML5-compliant rewrite. Third, the code of
the XML content sink is a lot cleaner to begin with than the code of the
HTML content sink, so it would be a shame to make the XML side more
convoluted just to share code that isn't particularly shareable.

I think I'll roll my tree back and return to my plan of picking lines of code
to imitate on the XML side.

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Henri Sivonen
In reply to this post by Boris Zbarsky
In article <[hidden email]>,
 Boris Zbarsky <[hidden email]> wrote:

> Henri Sivonen wrote:
> > I don't know. Do they have any mechanism for the plug-in alert?
>
> Not really.  In Firefox it's triggered via random DOM events, as I
> understand.  Other Gecko-based browsers don't necessarily have
> an equivalent notification mechanism.

I see. Then it would be pragmatic to either flash to the Yellow Screen
of Death or to do what WebCore does (insert the error into the document).

--
Henri Sivonen
[hidden email]
http://hsivonen.iki.fi/
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Boris Zbarsky
In reply to this post by Henri Sivonen
Henri Sivonen wrote:
> Second, spreading the use of SinkContext would make it
> more entrenched and would probably raise the barrier of getting the
> eight-year-old HTML parser/sink combo replaced with a line-by-line
> implementation of the HTML5 parsing spec. And the more I read the code,
> the more I'd like to see an HTML5-compliant rewrite.

As long as we're sure the HTML5 thing won't break any sites... ;)

I do think that it would be nice if a lot of the magic that happens in the HTML
content sink would go away.

> Third, the code of the XML content sink is a lot cleaner to begin with than the code of the
> HTML content sink, so it would be a shame to make the XML side more
> convoluted just to share code that isn't particularly shareable.

That I agree with.

> I think I'll roll my tree back and return to my plan of picking lines of code
> to imitate on the XML side.

OK.  If it's not easy to factor out, this sounds like the way to go, with
comments added to both impls about fixing the other if the one is fixed and so on.

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|

Re: Feedback on XML content sink plans

Ian Hickson
On Mon, 12 Jun 2006, Boris Zbarsky wrote:
>
> Henri Sivonen wrote:
> > Second, spreading the use of SinkContext would make it more entrenched
> > and would probably raise the barrier of getting the eight-year-old
> > HTML parser/sink combo replaced with a line-by-line implementation of
> > the HTML5 parsing spec. And the more I read the code, the more I'd
> > like to see an HTML5-compliant rewrite.
>
> As long as we're sure the HTML5 thing won't break any sites... ;)

I'm still working on verifying this. Please do not implement HTML5's
parsing model yet. However, I would like all browsers to converge in due
course, and that likely will involve a rewrite of the parser, so it's not
a bad idea to get things ready for that. :-)

--
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
12