missing ) after argument list

J

John W. Kennedy

Lasse said:
Actually, the official name for the language used by the Netscape
browsers and inheriteed by the Mozilla based browsers, including the
Spidermonkey engine, is "JavaScript". This is also the name that is
trademarked by Sun Microsystems, Inc.

By /Sun/?

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
 
T

Thomas 'PointedEars' Lahn

John said:
By /Sun/?

Yes, indeed by Sun. The programming language developed by Brendan Eich,
previously of Netscape Communications Corp., now working for the Mozilla
Foundation, formerly known as Mocha or LiveScript, was renamed to
"JavaScript" in a joint marketing effort of Netscape Communications Corp.
and Sun Microsystems, Inc.

<URL:http://www.sun.com/suntrademarks/#J>
<URL:http://wp.netscape.com/newsref/pr/newsrelease67.html>
<URL:http://en.wikipedia.org/wiki/JavaScript>


PointedEars
 
M

Matt Kruse

Thomas said:

Try this:
http://www.w3.org/TR/html401/interact/scripts.html#h-18.3.2

The most recent HTML 4.01 specs say this:

"User agents that don't recognize the SCRIPT element will likely render that
element's contents as text. Some scripting engines, including those for
languages JavaScript, VBScript, and Tcl allow the script statements to be
enclosed in an SGML comment. User agents that don't recognize the SCRIPT
element will thus ignore the comment while smart scripting engines will
understand that the script in comments should be executed."

Good enough for you?
 
M

Michael Winter


Not particularly. It's an informative statement on the state of things
as the W3C saw them at the time of publishing. It in no way implies that
that's the way things /should/ be, and all that it confirms is what we
already know: most user agents will ignore the comments if they surround
code. However, what it doesn't say is what you wrote above.

The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.

Mike
 
T

Thomas 'PointedEars' Lahn

Matt said:

FYI: You were stating that `<!--' is _documented_ as being a single-line
comment in a documentation for _"JavaScript/JScript/etc."_. It is not
the W3C that sets the standard for the former, and as I already pointed
out that section of the HTML 4.01 Specification, which is not normative
regarding ECMAScript implementations at all, was written and issued
before RFC2854 was issued, which obsoleted all HTML versions this section
was intended to create backwards compatibility to.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Michael said:
Thomas said:
Matt Kruse wrote:
They have Javascript/JScript/etc. In these implementations
of ECMAScript, I've not seen one yet that didn't treat
<!--
as a single-line comment. In fact, they document it as so.
Where?
Try this:
http://www.w3.org/TR/html401/interact/scripts.html#h-18.3.2
[snip]

Good enough for you?

Not particularly. [...]
The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.

Where it is to be noted that in HTML 3.2 the `script' element has no
attributes at all.

<URL:http://www.w3.org/TR/REC-html32#script>


PointedEars
 
M

Michael Winter

Michael Winter wrote:
[snip]
The best solution to the problem always was, and still is, what is
written in the second paragraph of that section.

'Always' is a little misleading. However, the time frame should be at
least seven years, which is certainly long enough.

[snip]
n HTML 3.2 the `script' element has no attributes at all.


In HTML 3.2, the SCRIPT element was nothing more than a placeholder,
though NN2 was using it. It wasn't defined until HTML 4.0, along with
STYLE elements. Both IE (3.022) and NN (3.0?) had support for the src
attribute before that time.

[snip]

Mike
 
T

Thomas 'PointedEars' Lahn

Michael said:
Michael Winter wrote:
n HTML 3.2 the `script' element has no attributes at all.


In HTML 3.2, the SCRIPT element was nothing more than a placeholder,


It is declared as an element in the HTML 3.2 Document Type Definition.
[...] It wasn't defined until HTML 4.0, along with STYLE elements.

Wrong. Both were already declared and defined as an element without
any attribute before HTML 4.0, in HTML 3.2.
Both IE (3.022) and NN (3.0?) had support for the src attribute before
that time.

The point is that we are trying to use Valid Markup and the argument for
obsolete "comments" is HTML 3.2. So there is no point in stating that
HTML 3.2 already supported the element and only now-obsolete or then-tagsoup
parsers require the "comment", but despite HTML 3.2 did not support the
`src' attribute, we use it anyway because some tagsoup parsers did.


PointedEars
 
V

VK

If you decided to be pin-point accurate in everything then be it
please.

Let's us take HTML markup block like:
<!-- Some comment -->
or
<!--
Some comment
-->

1) First of all it doesn't consist of <!-- and --> tags: there are not
such tags and W3C clearly state it and all browsers agree on it.

It consists of <! %content > tag which could be called
(non-academically but more visually) "non-rendering surprise". Thusly
it is not directly rendered but it may contain all kind of data which
can be treated very differently depending on the data type. Parser
determines what kind of surprise is waiting for by reading *the first
character* after the tag name - after the exclamation sign. It can be
DTD declaration, ASP tag, HTML comment, SSI tag and much more. If the
first character is score "-", parser read the next char to see if it's
a begin of comment block "--".

Double scores *are not* parts of tag syntacs. They denote comment
blocks withing the tag: <!-- Comment 1 -- Comment 2 -- Comment 3 -->
should be treated by specs as three comment blocks
Comment 1 --
Comment 2 --
Comment 3 --
where opening scores must be omitted and closing scores included into
comment block value. On practice I did not find any browser yet which
would follow this part of specification. All of them see one comment
block "Comment 1 -- Comment 2 -- Comment 3 --"

Also it is interesting (?is it really? well, just form of speach) that
IE properly reports tagName as "!" while Firefox reports something
strange: this tag has no name (undefined).
But all browsers agree that this is nodeName "#comment" and nodeType 8.

Because one have to place opening comment block declaration "--" right
after the tag name and also because no one is using multiple comment
blocks within one tag (because it's simply never was implemented):-
because of that everyone used to see comments as:
<!-- Comment --> and used to say "<!-- and --> comment tags" which is
nothing but convenience shortcut of more complicated picture.

2) About HTML comment within <script> tag.
W3C takes any authourity out from anything what could/should happen
after the opening <script> tag and up to the closing </script> tag
At the same time ECMA takes any authourity out from anything
browser-specific.
Therefore <script><!-- ... //--></script> question is out of any
official authority. What happens with <!-- ... //--> decided by the
particular browser producer and there are not *any* normative documents
which could be used to argue with the browser producer decision.
We may quote each other to death but no quote from any any source would
be relevant.

In this situation the legacy becomes the only autority, therefore <!--
.... //--> will work fine forever - which *again* doesn't mean that one
must/should use it.
 
T

Thomas 'PointedEars' Lahn

VK said:
If you decided to be pin-point accurate in everything then be it
please.

Let's us take HTML markup block like:
<!-- Some comment -->
or
<!--
Some comment
-->

1) First of all it doesn't consist of <!-- and --> tags: there are not
such tags and W3C clearly state it and all browsers agree on it.

Finally you got that, did you not?
It consists of <! %content > tag

That is a markup declaration, not a tag. In SGML-based markup languages,
tags are part of elements. Got that?
which could be called (non-academically but more visually) "non-rendering
surprise".

True, a declaration itself is never rendered. Only the markup
it declares may be rendered visually, and is parsed always.
Double scores *are not* parts of tag syntacs. They denote comment
blocks withing the tag: <!-- Comment 1 -- Comment 2 -- Comment 3 -->
^^^^ ^^ ^^^^^^^^^ ^^ ^^^
[0] [1] [2] [3] [4] [5][6]

[0] Markup Declaration Open (MDO) delimiter: <!
[1] start of comment: --
[2] end of comment: --
[3] invalid declaration keyword: Comment
[4] start of comment: --
[5] end of comment: --
[6] Markup Declaration Close (MDC) delimiter: >
should be treated by specs as three comment blocks
Comment 1 --
Comment 2 --
Comment 3 --

Wrong. Instead it is an SGML/XML _syntax error_, therefore also an (X)HTML
syntax error. To achieve what you falsely inferred, one needs to write

<!-- Comment 1 ---- Comment 2 ---- Comment 3 -->

That is why the HTML Specification makes the remark that `-' should not
occur in comments. Any sequence of `--' ends the comment previously
started (with `--').

Non sequitur.


HTH

PointedEars
 
T

Thomas 'PointedEars' Lahn

Thomas said:
VK said:
Double scores *are not* parts of tag syntacs. They denote comment
blocks withing the tag: <!-- Comment 1 -- Comment 2 -- Comment 3 -->
^^^^ ^^ ^^^^^^^^^ ^^ ^^^
[0] [1] [2] [3] [4] [5][6]

[0] Markup Declaration Open (MDO) delimiter: <!
[1] start of comment: --
[2] end of comment: --
[3] invalid declaration keyword: Comment
[4] start of comment: --
[5] end of comment: --
[6] Markup Declaration Close (MDC) delimiter: >
should be treated by specs as three comment blocks
Comment 1 --
Comment 2 --
Comment 3 --

Wrong. Instead it is an SGML/XML _syntax error_, therefore also an
(X)HTML
syntax error. To achieve what you falsely inferred, one needs to write

<!-- Comment 1 ---- Comment 2 ---- Comment 3 -->

That is wrong as it is. The "comment blocks" would be " Comment 1 ",
" Comment 2 " and " Comment 3 " in that case. ISTM that because `--'
starts and ends comments, it is not possible to define a comment that
includes it. Maybe the rather ugly

<!ENTITY % doublehyphen "--">
<!-- Comment 1 %doublehyphen;---- Comment 2 %doublehyphen;-- Comment 3
%doublehyphen;-->

works, but I have not validated that yet.

Sorry for causing confusion.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Thomas said:
VK said:
Double scores *are not* parts of tag syntacs. They denote comment
blocks withing the tag: <!-- Comment 1 -- Comment 2 -- Comment 3 -->
^^^^ ^^ ^^^^^^^^^ ^^ ^^^
[0] [1] [2] [3] [4] [5][6]

[0] Markup Declaration Open (MDO) delimiter: <!
[1] start of comment: --
[2] end of comment: --
[3] invalid declaration keyword: Comment
[4] start of comment: --
[5] end of comment: --
[6] Markup Declaration Close (MDC) delimiter: >
should be treated by specs as three comment blocks
Comment 1 --
Comment 2 --
Comment 3 --

Wrong. Instead it is an SGML/XML _syntax error_, therefore also an
(X)HTML
syntax error. To achieve what you falsely inferred, one needs to write

<!-- Comment 1 ---- Comment 2 ---- Comment 3 -->

That is wrong as it is. The "comment blocks" would be " Comment 1 ",
" Comment 2 " and " Comment 3 " in that case. ISTM that because `--'
starts and ends comments, it is not possible to define a comment that
includes it. Maybe the rather ugly

<!ENTITY % doublehyphen "--">
<!-- Comment 1 %doublehyphen;---- Comment 2 %doublehyphen;---- Comment 3
%doublehyphen;-->

works, but I have not validated that yet.

Sorry for causing confusion.


PointedEars
 
V

VK

Thomas said:
That is wrong as it is. The "comment blocks" would be " Comment 1 ",
" Comment 2 " and " Comment 3 " in that case. ISTM that because `--'
starts and ends comments, it is not possible to define a comment that
includes it. Maybe the rather ugly

Read the specs please ;-)

Comment block value starts from the opening mark and up to *and
including* the closing mark.

<!--Comment 1-- --Comment 2-- --Comment 3-->
defines three comment blocks:
"Comment 1--"
"Comment 2--"
"Comment 3--"

But as I said this part of specification was never implemented by
anyone. Even W3C's "mission statement browser" Amaya fails on it.

So it is only for an abstract interest. Plus I'm feeling sadistic today
:)
 
M

Michael Winter

Michael Winter wrote:
[snip]
In HTML 3.2, the SCRIPT element was nothing more than a placeholder,

It is declared as an element in the HTML 3.2 Document Type Definition.

Precisely. It is a declaration. The intent was to ensure that future
user agents would recognise a SCRIPT element. There were no defined
attributes or semantics, just an attempt to make sure that new user
agents wouldn't attempt to render the content as they should with
unknown elements.
[...] It wasn't defined until HTML 4.0, along with STYLE elements.

Wrong. Both were already declared and defined as an element without
any attribute before HTML 4.0, in HTML 3.2.

Defined? No. The phrases 'future use' and 'placeholder' don't appear in
five different locations for the fun of it. There was no attempt at a
definition.
The point is

I know what the point is.
that we are trying to use Valid Markup and the argument for
obsolete "comments" is HTML 3.2.

The argument for the behaviour regards (in principle, at least) pre-3.2
user agents and anyone should (and in this thread, does) agree that this
argument has no merit any more. Why you want to argue over irrelevant
specifics is beyond me.
So there is no point in stating that HTML 3.2 already supported the
element [...]

I would like to remind you that I was not the one that introduced the
matter of, or initiated any reference to, HTML 3.2. If you feel that
there is no point in discussing it, you might want to ask yourself why
you decided to bring it up.

[snip]

Mike
 
M

Michael Winter

On 21/12/2005 11:27, VK wrote:

[snip]
Comment block value starts from the opening mark and up to *and
including* the closing mark.

I don't know where you read that, and you could well be right, but it
seems odd to me.
<!--Comment 1-- --Comment 2-- --Comment 3-->
defines three comment blocks:
[snip]

But as I said this part of specification was never implemented by
anyone.

Not true. I recently came across a Microsoft document that contained
something like:

<!------->

and Firefox promptly ignored everything after that until it came across
something similar later.

In any case, it is undoubtely safer to take the XML approach: comments
start with '<!--', end with '-->' ('--->' is forbidden), and should
never include paired hyphens ('--').

[snip]

Mike
 
M

Michael Winter

On 21/12/2005 10:19, VK wrote:

[snip]
Also it is interesting (?is it really? well, just form of speach) that
IE properly reports tagName as "!" while Firefox reports something
strange: this tag has no name (undefined).

No, as usual Firefox is correct (as far as the W3C DOM is concerned).
The tagName property is defined only for elements (objects implementing
the Element interface). Whilst a Comment is a Node (it inherits from
CharacterData), it is not an Element and therefore possesses only the
node* properties.
But all browsers agree that this is nodeName "#comment" and nodeType 8.

It might be worth noting that IE 5.x doesn't. A comment has values '!'
and 1, respectively.

[snip]

Mike
 
V

VK

Michael said:
I don't know where you read that, and you could well be right, but it
seems odd to me.

<http://www.w3.org/MarkUp/html-spec/html-spec_3.html#SEC3.2.5>
<quote>
To include comments in an HTML document, use a comment declaration.
A comment declaration consists of `<!' followed by zero or more
comments followed by `>'.
Each comment starts with `--' and includes all text up to and including

the next occurrence of `--'.
In a comment declaration, white space is allowed after each comment,
but not before the first comment.
The entire comment declaration is ignored.
I recently came across a Microsoft document that contained
something like:
<!------->
and Firefox promptly ignored everything after that until it came across
something similar later.

Uuhm.... What Firefox did you use? Firefox 1.5 DOM Inspector shows
correctly #comment node with value "---" (should be "-----" including
the closing comment block mark - see above).

Truthfully I don't understand why anyone would try to insert "--" into
comment block. One cannot use "<" inside tag and no big deal but
impossibility to use "--" makes people all upset :)
In any case, it is undoubtely safer to take the XML approach: comments
start with '<!--', end with '-->' ('--->' is forbidden), and should
never include paired hyphens ('--').

There is not XML approach: there is SGML approach common for both HTML
and XML and commonly half-a** implemented by everyone including Her
holly standard crazyness Amaya.
You use <!> tag, start comment block with "--" where the first block
declaration has to be immediately after the tag name: <!-- and ends up
and includes the closing declaration.

Therefore <!-- Comment 1-- -- Comment 2-- -- Comment 3--
id="myComment"> in any SGML-based subset should produce three comment
blocks
Comment 1--
Comment 2--
Comment 3--
and named attribute "id" (comments are allowed to have attributes btw -
but because of broken implementation one cannot use this ability).

All this question is not really important for practical development. It
is enough to remember the "explanation shortcut": comment tag starts
with <!-- and ends with -->
This "explanation shortcut" is wrong from the first to the last word,
but it's easy to remember and it guarantees the oops protection.

But if one decided to have a profound evangelism discussion, let's talk
to the last dot over "i". :)
 
V

VK

VK said:
There is not XML approach: there is SGML approach common for both HTML
and XML and commonly half-a** implemented by everyone including Her
holly standard crazyness Amaya.

Thinking over it again - I'm filing right now non-standard behavior bug
report to www.w3.org about their browser.
Amaya clearly acts in violation of
<<http://www.w3.org/MarkUp/html-spec/html-spec_3.html#SEC3.2.5> and
must be fixed immediately.

PointedEars - your're a real a** rather often ;-) but this is a great
Christmas present I've got as a side issue of this discussion.
 
V

VK

Michael said:
No, as usual Firefox is correct (as far as the W3C DOM is concerned).
The tagName property is defined only for elements (objects implementing
the Element interface). Whilst a Comment is a Node (it inherits from
CharacterData), it is not an Element and therefore possesses only the
node* properties.

I guess PointedEars has moved something in my unstable brains so I
become like a documentation fighter :) Just for a while! :)

<!> tag has nothing to do with comments, it's a tag like any others: it
has name "!", it can have attributes.

--Comment block inside-- *is* #comment node with the node properties
only (no element properties).
 
M

Michael Winter

On 21/12/2005 20:51, VK wrote:

[snip]

HTML 2.0 is obsolete, so it shouldn't be considered a normative
reference. Unless SGML states that a comment value includes the closing
delimiter (and I don't own a copy of ISO 8879), then I'll assume that
the idea was revised.

In any case, as far as the W3C DOM is concerned, a comment is delimited
by, but does not include, a pair of hyphens.

[snip]
Uuhm.... What Firefox did you use?

Fx 1.0.7, but that hardly matters. Not all user agents take a simple
approach to comments.

From some quick further reading[1], it seems that this is a 'Quirks'
versus 'Standards' mode issue, which I can confirm.
Firefox 1.5 DOM Inspector shows correctly
Correctly?

#comment node [...]

Because your test triggered 'Quirks' mode, perhaps?

[snip]
In any case, it is undoubtely safer to take the XML approach: comments
start with '<!--', end with '-->' ('--->' is forbidden), and should
never include paired hyphens ('--').

There is not XML approach: there is SGML approach common for both HTML
and XML [...]

You misunderstand both my point, and the facts. As we know, SGML
delimits comments with '--' inside many types of markup declaration.
However in XML, comments may /only/ appear as I described above. My
point: it is a safe formulation to use, so that's what I'd recommend.

[snip]
Therefore <!-- Comment 1-- -- Comment 2-- -- Comment 3--
id="myComment">
[snip]

(comments are allowed to have attributes btw - but because of broken
implementation one cannot use this ability).

Absolute rubbish. Try validating that with an SGML parser.

[snip]

Mike


[1] <http://www.howtocreate.co.uk/sgml/doctypeSGML.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top