By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,725 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,725 IT Pros & Developers. It's quick & easy.

DOM-2/HTML vs. HTML-4

P: n/a

Taking the BODY element as an example, all of its style attributes
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01,
a fact noted in the DOM Level 2 HTML specification.

The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.

Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in the
HTML specification is ipso facto also deprecated in the DOM specification?
[For those doubting the relevance of these questions to this group: Note
that while this question could be put to groups that discuss the HTML
specification, script writers must be aware of both the HTML and DOM
specification, and thus the questions here are relevant to this group.]
Nov 7 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to avoid
confusion with the `style' attribute and interface attributes related to
that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,
Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.
Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me. Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML DOM's
case, the DOM API is a representation of attributes of HTML elements
that can be accessed an modified through object properties that are
implementations of attributes of the interface. At least that was the
original idea, taking into account that proprietary DOM implementations
(DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in
the HTML specification is ipso facto also deprecated in the DOM
specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"
PointedEars
Nov 7 '05 #2

P: n/a
Patient Guy wrote:
Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in
the HTML specification is ipso facto also deprecated in the DOM
specification?


Not as such, but it does say:

The transitional or frameset DTD for HTML 4.01, or the XHTML 1.0 DTDs are
assumed. Interoperability between implementations is only guaranteed for
elements and attributes that are specified in the HTML 4.01 and XHTML 1.0
DTDs.

http://www.w3.org/TR/2003/REC-DOM-Le...-ID-1176245063

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Nov 7 '05 #3

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in
news:21****************@PointedEars.de:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element and
makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>

That use of language says to me that these element node attributes are
deprecated for the 'document' element and not expressly for the 'body'
element, until we move along to a reading of the 'body' element....

As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it. I am looking for a remark in the
DOM-2/HTML specification that states, "any element or attribute or
attribute value deprecated in the HTML 4.01 specification should be
considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.
Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML
DOM's case, the DOM API is a representation of attributes of HTML
elements that can be accessed an modified through object properties
that are implementations of attributes of the interface. At least
that was the original idea, taking into account that proprietary DOM
implementations (DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that
the DOM specification yields to or otherwise is fully dependent on
the HTML specification, and that deprecated use of elements and/or
attributes in the HTML specification is ipso facto also deprecated in
the DOM specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"


Okay, if by that reading there is an implicit indication or
interpretation that anything forbidden/deprecated in the underlying
specifications is something forbidden/deprecated in the supported
specification, then so be it.
Nov 8 '05 #4

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in
news:21****************@PointedEars.de:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element and
makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>

That use of language says to me that these element node attributes are
deprecated for the 'document' element and not expressly for the 'body'
element, until we move along to a reading of the 'body' element....

As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it. I am looking for a remark in the
DOM-2/HTML specification that states, "any element or attribute or
attribute value deprecated in the HTML 4.01 specification should be
considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.
Do not confuse the term "attributes" used in
the DOM Specification with the term "attributes" used in the HTML
Specification. The former refers to attributes of the interface; the
latter refers to attributes of the element. However, in the HTML
DOM's case, the DOM API is a representation of attributes of HTML
elements that can be accessed an modified through object properties
that are implementations of attributes of the interface. At least
that was the original idea, taking into account that proprietary DOM
implementations (DOM Level 0) did exactly this before.
Is there text in the DOM specification that states specifically that
the DOM specification yields to or otherwise is fully dependent on
the HTML specification, and that deprecated use of elements and/or
attributes in the HTML specification is ipso facto also deprecated in
the DOM specification?


Yes.

"1.1 Introduction

This section extends the DOM Level 2 Core API [DOM Level 2 Core] to
describe objects and methods specific to HTML documents [HTML 4.01],
and XHTML documents [XHTML 1.0] [...]"


Okay, if by that reading there is an implicit indication or
interpretation that anything forbidden/deprecated in the underlying
specifications is something forbidden/deprecated in the supported
specification, then so be it.
Nov 8 '05 #5

P: n/a
VK
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01,
a fact noted in the DOM Level 2 HTML specification.

The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition section I
read.

Is there text in the DOM specification that states specifically that the
DOM specification yields to or otherwise is fully dependent on the HTML
specification, and that deprecated use of elements and/or attributes in the
HTML specification is ipso facto also deprecated in the DOM specification?
[For those doubting the relevance of these questions to this group: Note
that while this question could be put to groups that discuss the HTML
specification, script writers must be aware of both the HTML and DOM
specification, and thus the questions here are relevant to this group.]
You question arises from the mixture of the HTML which is HiperText
*Markup* Language - and DOM which is Document Object Model. W3C is not
perfectly clear in this domain neither - but they always had problems
to express their thoughts in a common human language.

HTML specification deals *exclusively* with what tags have some
predefined markup associated with them and what attributes in these
tags have additional markup meaning. This way both of markups below has
the same *documented* meaning in HTML 4:

<font color="red">Text</font>
<foo bar="Hello!">Text</foo>

The first one is deprecated, so browser is not obligated to render the
text in red color.
The second one is not defined in the default tags' set so should be
ignored.
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.
From the other hand DOM specifies which element have, gonna have or

someday maybe will have open interfaces for element manipulations.

This way the answer on your question is: while scripting only DOM
interfaces are important.
For page design you can use (but it doesn't mean that you should) any
tags starting from Netscape 3 set (except <blink> maybe) and do not
worry that they will be ignored by some browser. The chances are that
some browser ever exclude <alink> or <font> from its parsing engine
equal to about 0,001 % or less.

Nov 8 '05 #6

P: n/a
Patient Guy wrote:
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote [...]:
Patient Guy wrote:
Taking the BODY element as an example, all of its style attributes Those are called "presentational" or "format(ting) attributes" to
avoid confusion with the `style' attribute and interface attributes
related to that.
('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
4.01,


Yes, indeed.
a fact noted in the DOM Level 2 HTML specification.


Specified in the HTML 4.01 Specification.
The DOM specification does not explicitly itself deprecate the use of
attributes however for the element in the interface definition
section I read.


<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268>
and
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-62018039>

are pretty clear to me.


As to http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268, how
is that language clear to you? This discusses the DOCUMENT element


Actually, it discusses the HTMLDocument interface. There is no DOCUMENT
element.
and makes a reference to the BODY element as follows:

<quote>
The following properties have been deprecated in favor of the
corresponding ones for the BODY element:

* alinkColor
* background
* bgColor
* fgColor
* linkColor
* vlinkColor
</quote>
[...]
Yes. And if you access the second URI, you can read

| Interface HTMLBodyElement
|
| The HTML document body. This element is always present in the DOM API,
| even if the tags are not present in the source document. See the BODY
| element definition in HTML 4.01.
As to the other referenced section, the EXPRESS mention here is that the
HTML 4.01 specification deprecates it.
Yes, exactly.
I am looking for a remark in the DOM-2/HTML specification that states,
"any element or attribute or attribute value deprecated in the HTML 4.01
specification should be considered to be a deprecated use of these
elements/node/attributes/attribute values in DOM-2/HTML as well." I
suppose there is text to that effect.


And I quoted it. The W3C DOM Level 2 HTML Specification is explicitly based
on the W3C HTML 4.01 Specification and the W3C XHTML 1.0 Specification.
PointedEars
Nov 8 '05 #7

P: n/a
VK wrote:
Patient Guy wrote:
You question arises from the mixture of the HTML which is HiperText
H_y_perText -- beyond text
*Markup* Language - and DOM which is Document Object Model. W3C is not
perfectly clear in this domain neither - but they always had problems
to express their thoughts in a common human language.
Nonsense. They are almost always pretty clear, but many people often
don't bother to understand.
HTML specification deals *exclusively* with what tags have some
predefined markup associated with them and what attributes in these
tags have additional markup meaning. This way both of markups below
has the same *documented* meaning in HTML 4:

<font color="red">Text</font>
<foo bar="Hello!">Text</foo>

The first one is deprecated, so browser is not obligated to render the
text in red color.
Nonsense.

,-<http://www.w3.org/TR/html4/conform.html#h-4.1>
|
| Deprecated
| A deprecated element or attribute is one that has been outdated by newer
| constructs. Deprecated elements are defined in the reference manual in
| appropriate locations, but are clearly marked as deprecated. Deprecated
| elements may become obsolete in future versions of HTML.
|
| User agents should continue to support deprecated elements for reasons
| of backward compatibility.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
| Definitions of elements and attributes clearly indicate which are
| deprecated.
|
| This specification includes examples that illustrate how to avoid using
| deprecated elements. In most cases these depend on user agent support
| for style sheets. In general, authors should use style sheets to achieve
| stylistic and formatting effects rather than HTML presentational
| attributes. HTML presentational attributes have been deprecated when
| style sheet alternatives exist (see, for example, [CSS1]).
The second one is not defined in the default tags' set so should be
ignored.
No.

,-<http://www.w3.org/TR/html4/appendix/notes.html#h-B.1
|
| The following notes are informative, not normative. Despite the
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
| appearance of words such as "must" and "should", all requirements
| in this section appear elsewhere in the specification.
|
| B.1 Notes on invalid documents
|
| However, to facilitate experimentation and interoperability between
| implementations of various versions of HTML, we recommend the following
| behavior:
|
| [...]
| - If a user agent encounters an element it does not recognize, it should
| try to render the element's content.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
| - If a user agent encounters an attribute it does not recognize, it should
| ignore the entire attribute specification (i.e., the attribute and its
| value).
| [...]
| Since user agents may vary in how they handle error conditions, authors
| and users must not rely on specific error recovery behavior.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.


Nonsense. The HTMLFontElement interface is defined in W3C DOM Level 2
HTML, and even if using the latter `foo' element would not result in HTML,
DOM interfaces can be used to access it, just not W3C DOM Level 2 HTML
interfaces but those of W3C DOM Level 2+ Core.

<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43943847>
<http://www.w3.org/TR/DOM-Level-2-Core/>
<http://www.w3.org/TR/DOM-Level-3-Core/>
PointedEars
Nov 8 '05 #8

P: n/a
Thomas 'PointedEars' Lahn wrote:
VK wrote:
Neither of both have any DOM interfaces to be scripted except brute
force innerHTML replacement.


Nonsense. The HTMLFontElement interface is defined in W3C DOM Level 2
HTML, and even if using the latter `foo' element would not result in HTML,
DOM interfaces can be used to access it, just not W3C DOM Level 2 HTML
interfaces but those of W3C DOM Level 2+ Core.

<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43943847>
<http://www.w3.org/TR/DOM-Level-2-Core/>
<http://www.w3.org/TR/DOM-Level-3-Core/>


and, of course, any proprietary DOM the UA may provide.
The term "DOM" is _not_ restricted to the W3C DOM.
PointedEars, JFTR
Nov 8 '05 #9

P: n/a
VK
<FLUD>
VK wrote:
You question arises from the mixture of the HTML which is HiperText
Thomas 'PointedEars' Lahn wrote:
H_y_perText -- beyond text


OK. you've got me on this one, indeed a stupid typo. Go get some beer
to celebrate, it's your day.
;-)

</FLUD>

Nov 8 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.