Re: error code when insering a video using video tag

Laurent Carcone, Sun, 06 Jan 2013 22:46:58 +0100:
> Le 06/01/13 21:01, Leif Halvard Silli a écrit :
>> I’m not sure it adds them in the DOM tree: My impression is that they
>> are not possible to style, in Amaya.
> 
> The saved file is generated from the internal tree (what I called dom 
> tree), an element must have been added in it to be saved.

OK.

>> Also, "less strict" doesn’t seem like the correct word — I’m not sure
>> it can be justified that it delete anything when using the XHTML parser
>> - that seems like a bug too.
> 
> I agree, maybe not the correct word. What I meant is that the xml 
> parser we use in Amaya for xhtml documents checks that the document 
> is well-formed and valid according to the xhtml dtd of the document. 
> As Amaya is mainly an editor and we didn't want to generate invalid 
> documents, invalid elements/attributes are deleted.

*Removing* things is nevertheless destructive - it seems like a bad 
decision to make it do that without *always* warning first. 

>> Btw, for the HTML4 mode, it is even possible to change the DOCTYPE
>> (manually, in the source view) to the HTML5 doctype - <!DOCTYPE html>.
> 
> Yes, the source view acts as a text editor.

What I meant was that Amaya doesn't restore the doctype despite that 
the doctype is unknown to it. By contrast, for the XHTML mode, then 
Amaya will - when you leave the source editor, restore the DOCTYPE if 
it feels for it.

PS: Do you know if the group that looks at making Amaya 
HTML5-compatible is going to implement both a text/html mode and a 
xhtml mode? Or if they perhaps are aiming for a polyglot mode? 
(http://www.w3.org/TR/html-polyglot/)

PPS: Currently, the <?xml version="1.0" encoding="UTF-8"?> declaration 
is used as an XHTML mode trigger, it seems. This is bad, as it prevents 
us from making polyglot HTML (as the XML declaration is invalid in 
text/html). Plus that there is no need to declare the encoding for XML 
as long as one uses UTF-8.

If the team decides to implement HTML5 as a polyglot mode, then 
something that separates HTML and XHTML mode isn't really needed. But 
if it *does* need a trigger at the beginning of the document for this, 
then I suggest that they utilize the HTML5 doctype, like so:

a) <!doctype html> is only text/html compatible and could thus
   trigger that mode. (It causes fatal XML error.)
b) <!DOCTYPE html> is both text/html and XHTML-compatible, and
   could thus trigger XHTML mode.

Leif H Silli

> Thanks,
> Laurent
>> 
>> LH
>> 
>> Laurent Carcone, Sun, 06 Jan 2013 14:03:43 +0100:
>>> Indeed, the HTML4 parser used in Amaya is less strict than the XML
>>> parser, it reports an error for the unknown elements (the red bottom
>>> right corner button), but let these elements be added in the DOM tree
>>> so that they can be generated at save (the missing quote marks is a
>>> bug).
>>> 
>>> Thanks,
>>> Laurent
>>> 
>>> Le 06/01/13 12:46, Leif Halvard Silli a écrit :
>>>> Cristiano Guglielmetti, Sun, 6 Jan 2013 11:16:12 +0100:
>>>>> With Amaya 11.4.4 under Win7 with this code:
>>>>> 
>>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>>>>>         "http://www.w3.org/TR/html4/loose.dtd">
>>>>> <html xmlns="http://www.w3.org/1999/xhtml">
>>>>> <head>
>>>>>     <meta http-equiv="content-type" content="text/html;
>>>>> charset=iso-8859-1">
>>>>>     <title>Nuovo</title>
>>>>>     <meta name="generator" content="Amaya, see 
>>>>> http://www.w3.org/Amaya/">
>>>>> </head>
>>>>> 
>>>>> <body>
>>>>> <video width="320" height="240" controls>
>>>>>     <source src="movie.mp4" type="video/mp4">
>>>>>     <source src="movie.ogg" type="video/ogg">
>>>>>     <source src="movie.webm" type="video/webm">
>>>>>     <object data="movie.mp4" width="320" height="240">
>>>>>       <embed src="movie.swf" width="320" height="240">
>>>>>     </object>
>>>>> </video>
>>>>> 
>>>>> </body>
>>>>> </html>
>>>>> 
>>>>> I get no errors by Amaya (also saving and reloading)
>>>> Hm. You are right. However, a few things *do* happen:
>>>> 
>>>> 1) Though you don't get errors, you do get warnings (the button in the
>>>> bottom right corner becomes red)
>>>> 
>>>> 2) For the new elements, then Amaya removes the quote marks once you
>>>> save the document. (The quote marks stay intact as long as the source
>>>> code view is open - and active, but if you move the cursor to the
>>>> WYSIWYG window, then they are removed.)
>>>> 
>>>> Btw, you can also use the HTML4 *strict* doctype — that will work as
>>>> well, and is thus recommended since the strict doctype triggers
>>>> no-quirks (or "standards") mode.
> 

Received on Sunday, 6 January 2013 22:47:44 UTC