Re: PHP code only allowed in XHTML 5?

Thomas Broyer On 09-07-23 09.45:

> On Thu, Jul 23, 2009 at 2:06 AM, Leif Halvard Silli wrote:
>> Thomas Broyer On 09-07-22 23.45:
>>> See this Live DOM viewer demo [1] (compare the second and first
>>> paragraphs, in WebKit; this sample doesn't demo this behavior in IE)
>> Your demo [1] confirms that it is the unpaired quote character that is the
>> problem, both in IE and in Webkit. Both IE and expects the PI to end at the
>> first ">". However, the unpaired quote character means gets IE and Webkit to
>> postpone looking for the ">", and send them on search for the pairing quote
>> character instead. Thus, they do not, as I think you said somewhere earlier,
>> prefer "?>" over ">". For instance, this explains the treatment of the 2nd
>> and 3rd paragraph in IE.
> 
> Actually, WebKit (tested in Safari 4 and Chrome 3) looks for either
> the pairing quote character *or* "?>" (see how the second paragraph is
> parsed in [1] compared to e.g. the fourth; also, change the demo to
> end the <!--comment--> with ?> and see how "R" now appears in the DOM)
> 
>>> [1] http://software.hixie.ch/utilities/js/live-dom-viewer/saved/182

So, the most browser compatible way is actually to say that one 
should use "<? ?>" and not "<? >" ?!

So what about the draft? How is it in line w.r.t. the real world 
parsing? Doesn't the draft merely tell that "<? ... >" should be 
parsed as a "bogus comment"? It doesn't mention "<? ... ?>", does 
it? It doesn't go into the details that we have discussed/discovered?

I doubt that browser vendors have much interest in coming together 
about a fully predictable behavior for something called a "bogus 
comment". E.g. in Webkit and Gecko they are not even treated as 
comments - as such. They're invisible in the DOM.

What would be Ian's motivation for saying that, 'actually, we 
should change the PI syntax to be "<? ... ?>" and not "<? ... >"'? 
What motivation could he possibly have to do that if he only sees 
them as "bogus comments"? And which programming language would 
feel tempted to make use of "HTML 5's bogus comments feature" in 
order to achieve something? (FrontPage did not support <?php ?> 
initially, thus PHP also introduced <script 
language="php"></script> as a possible syntax, just to help 
FrontPage. They would never have implemented <?php ?> if it was 
known as a "bogus comments".)

Btw, I think it is a big difference between having validators 
showing a warning and having them saying that something is an error.

So I suggest that

  1) PIs should principally remain valid - though could create 
warnings in validators.
  2) The justifcation and the syntax should remain roughly the 
same as in HTML 4, though perhaps be modified a little .
  3) The should retain the HTML 4 name  and not be mixed together 
with other "bogus features" that HTML 5 may have. The purpose of 
PIs should be stated clearly and positively.
--
leif halvard silli

Received on Wednesday, 29 July 2009 02:29:44 UTC