missing ) after argument list

M

Michael Winter

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.
[snip]

<!> tag has nothing to do with comments,

Where, above, did I say it did?
it's a tag like any others:

No it isn't. It is a markup declaration open delimiter, immediately
followed by a markup declaration close delimiter. In the SGML grammar,
that matches a comment declaration (the actual comment is optional).
it has name "!", it can have attributes.

Utter nonsense.

[snip]

Mike
 
V

VK

Michael Winter wrote:
Where, above, did I say it did?

That's gonna be my MD work "Philosophie of Comments in Modern Browsers"
:)

<!> *is* an equivalent of comment tag - no "--" needed. I don't know
when did it happen by I guess it was made to keep the display out of
ASP / JSP / PHP tags
Tested on IE 6.0, FF 1.5, Opera 8.51

// CODE FOR FUN BELOW //

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Comment</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

<script type="text/javascript">
function test() {
var out = document.forms[0].elements[0];
out.value = '';
var coms = document.getElementsByTagName('!');
for (p in coms[1]) {out.value+= p+' = '+coms[1][p]+'\n';}
}
</script>

</head>

<body onload="test()">
<form method="post" action="">
<textarea name="out" cols="64" rows="16"></textarea>
</form>
<! My comment />
</body>
</html>

Also please note that parser still swallow two chars from each end: as
if "--" still there. Therefore
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

becomes nodeValue and data:

CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dt

(try coms[0] instead of coms[1] in the code above).

which means that at least in IE it's impossible to set proper DTD and
the browser must be looking for some formal signs (like "w3.org"
substring?) while choosing compatible vs. strict mode.

Thomas! Some *serious* job to you.
 
V

VK

Tested on IE 6.0, FF 1.5, Opera 8.51

By "tested" I mean the same treatment of <! My comment /> as a
comment.

As comments have tagName in IE only, the script will work only for IE.
For FF use DOM Inspector to check.
 
T

Thomas 'PointedEars' Lahn

Michael said:
Michael said:
[...] 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.

[1] Document Type _Definition_
The phrases 'future use' and 'placeholder' don't appear in
five different locations for the fun of it.

I beg your pardon?
There was no attempt at a definition.

Besides of [1], there is:

,-<URL:http://www.w3.org/TR/REC-html32#script>
|
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

That is not only a more detailed definition than the DTD already
provides --

| <!ELEMENT STYLE - - CDATA -- placeholder for style info -->
| <!ELEMENT SCRIPT - - CDATA -- placeholder for script statements -->

-- it is also the part of the specification that renders attempts
at "commenting out" `script' element content using empty markup
declarations nonsensical.
I know what the point is.

No, you don't:
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.

I do not argue over irrelevant specifics.
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.

You snipped what brought meaning to this sentence in the context of
my counter-argument against your counter-argument. JFYI, you stated
that

,-[news:[email protected]]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2, so following your recommendation would create invalid markup
when declaring HTML 3.2 (which is the earliest possible valid version),
which cannot qualify as being the "best solution [...] always was, and
still is" -- a contradiction:

,-[news:[email protected]]
|
| n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| 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.
^^^^^^^^^^^^^^^^^^^^^^^^^^^

And my counter-argument was that this argumentation of yours contains
a contradiction in context of the reasoning for not using "comments":

,-[news:[email protected]]
| [...]
| [...] 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
 
T

Thomas 'PointedEars' Lahn

VK said:
By "tested" I mean the same treatment of <! My comment /> as a
comment.

That is not Valid markup, of whatever SGML-based markup language. A user
agent that recognizes that as a comment is badly b0rken. What really
happens is that IE probably does not care and FF ignores it because it
cannot make any sense of it; that does not make it any more a comment
than any other invalid markup ignored by the parsers of these UAs.

<URL:http://validator.w3.org/>

Would you please recognize the syntax for markup declarations in those
languages? Thanks in advance.


PointedEars
 
V

VK

Thomas said:
That is not Valid markup, of whatever SGML-based markup language. A user
agent that recognizes that as a comment is badly b0rken. What really
happens is that IE probably does not care and FF ignores it because it
cannot make any sense of it; that does not make it any more a comment
than any other invalid markup ignored by the parsers of these UAs.

Did you run the test script in IE? It is not an ignored tag - it is
fully qualified #comment with all appropriate properties (as well as
DTD declaration)

Did you use DOM Inspector in Firefox? Tools > DOM Inspector (if
installed)
It is a fully valid #comment node.

Thomas! *Explain* the reality - do not *negate* it! ;-)
 
M

Michael Winter

On 22/12/2005 13:40, Thomas 'PointedEars' Lahn wrote:

[snip]
[1] Document Type _Definition_

I would place the emphasis on "Document Type". The DTD does not define
elements themselves - that is what the prose of the specification is
meant to do - but rather which elements (and attributes) are included in
that 'version' of HTML.

[snip]
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you consider that to be a definition, so be it. I do not. To me, the
first sentence reads that the SCRIPT and STYLE elements are simply being
declared, but will not be defined until a future version. As such, "user
agents should hide the contents of these elements" because they should
be considered known and not subject to error correction procedures.

As for their presence in the DTD, it would be necessary to include them
for the benefit of an SGML parser.

[snip]
JFYI, you stated that

,-[news:[email protected]]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2 [...]

You seem to have completely ignored the fact that I amended my statement
in a follow-up.

[snip]
,-[news:[email protected]]
|
| n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| 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.
^^^^^^^^^^^^^^^^^^^^^^^^^^^


It was not a counter-argument, just a statement. In HTML 3.2, the SCRIPT
element did not have a src attribute, but then the intent of HTML 3.2
was to "capture recommended practice", which essentially meant to
document then-current features in existing implementations (such as the
SCRIPT and STYLE elements).

At that time, the use of comments would have been necessary to prevent
then-older (now obsolete) browsers from rendering SCRIPT element
content. However, since the introduction of the src attribute, its
implementation, and the general recognition of the SCRIPT element
(regardless of the ability to execute its contents), the use of comments
is not necessary, and has been so for many years.
And my counter-argument was that this argumentation of yours contains
a contradiction in context of the reasoning for not using "comments":

I was not, at any point, reasoning for using comments.

[snip]

Now hopefully no continuation of this discussion will be necessary.

Mike
 
T

Thomas 'PointedEars' Lahn

Michael said:
[1] Document Type _Definition_

I would place the emphasis on "Document Type". The DTD does not define
elements themselves -

So a definition does not define things.
that is what the prose of the specification is meant to do -
Rubbish.
[...]
| These are place holders for the introduction of style sheets and
| client-side scripts in future versions of HTML. User agents should
^^^^^^^^^^^^^^^^^^
| hide the contents of these elements.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you consider that to be a definition, so be it. I do not. [...]

You are free to think so.
JFYI, you stated that

,-[news:[email protected]]
|
| The best solution to the problem always was, and still is, what is
^^^^^^^^^^^^^^^^^^^^^^^^
| written in the second paragraph of that section.

with which you referred to:

,-<URL:http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2>
|
| [...]
| Another solution to the problem is to keep scripts in external
| documents and refer to them with the src attribute.

I commented that there was no `src' attribute for the `script' element
in HTML 3.2 [...]

You seem to have completely ignored the fact that I amended my statement
in a follow-up.

Fair enough.
[snip]
,-[news:[email protected]]
|
| n HTML 3.2 the `script' element has no attributes at all.

Your counter-argument was that

| 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.
^^^^^^^^^^^^^^^^^^^^^^^^^^^


It was not a counter-argument, just a statement.


Now come on, you used that for your argumentation, despite your "amendment".
I was not, at any point, reasoning for using comments.

And I did not say so.
Now hopefully no continuation of this discussion will be necessary

Hopefully.


PointedEars
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top