DOM-2/HTML vs. HTML-4

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patient Guy

    DOM-2/HTML vs. HTML-4


    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.]
  • Thomas 'PointedEars' Lahn

    #2
    Re: DOM-2/HTML vs. HTML-4

    Patient Guy wrote:
    [color=blue]
    > Taking the BODY element as an example, all of its style attributes[/color]

    Those are called "presentational " or "format(tin g) attributes" to avoid
    confusion with the `style' attribute and interface attributes related to
    that.
    [color=blue]
    > ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
    > 4.01,[/color]

    Yes, indeed.
    [color=blue]
    > a fact noted in the DOM Level 2 HTML specification.[/color]

    Specified in the HTML 4.01 Specification.
    [color=blue]
    > The DOM specification does not explicitly itself deprecate the use of
    > attributes however for the element in the interface definition section I
    > read.[/color]

    <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.
    [color=blue]
    > 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?[/color]

    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

    Comment

    • David Dorward

      #3
      Re: DOM-2/HTML vs. HTML-4

      Patient Guy wrote:
      [color=blue]
      > 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?[/color]

      Not as such, but it does say:

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



      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
      Home is where the ~/.bashrc is

      Comment

      • Patient Guy

        #4
        Re: DOM-2/HTML vs. HTML-4

        Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote in
        news:2174611.mM ohNT64To@Pointe dEars.de:
        [color=blue]
        > Patient Guy wrote:
        >[color=green]
        >> Taking the BODY element as an example, all of its style attributes[/color]
        >
        > Those are called "presentational " or "format(tin g) attributes" to
        > avoid confusion with the `style' attribute and interface attributes
        > related to that.
        >[color=green]
        >> ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
        >> 4.01,[/color]
        >
        > Yes, indeed.
        >[color=green]
        >> a fact noted in the DOM Level 2 HTML specification.[/color]
        >
        > Specified in the HTML 4.01 Specification.
        >[color=green]
        >> The DOM specification does not explicitly itself deprecate the use of
        >> attributes however for the element in the interface definition
        >> section I read.[/color]
        >
        > <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.[/color]

        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.
        [color=blue]
        > 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.
        >[color=green]
        >> 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?[/color]
        >
        > 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] [...]"[/color]

        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.

        Comment

        • Patient Guy

          #5
          Re: DOM-2/HTML vs. HTML-4

          Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote in
          news:2174611.mM ohNT64To@Pointe dEars.de:
          [color=blue]
          > Patient Guy wrote:
          >[color=green]
          >> Taking the BODY element as an example, all of its style attributes[/color]
          >
          > Those are called "presentational " or "format(tin g) attributes" to
          > avoid confusion with the `style' attribute and interface attributes
          > related to that.
          >[color=green]
          >> ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
          >> 4.01,[/color]
          >
          > Yes, indeed.
          >[color=green]
          >> a fact noted in the DOM Level 2 HTML specification.[/color]
          >
          > Specified in the HTML 4.01 Specification.
          >[color=green]
          >> The DOM specification does not explicitly itself deprecate the use of
          >> attributes however for the element in the interface definition
          >> section I read.[/color]
          >
          > <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.[/color]

          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.
          [color=blue]
          > 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.
          >[color=green]
          >> 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?[/color]
          >
          > 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] [...]"[/color]

          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.

          Comment

          • VK

            #6
            Re: DOM-2/HTML vs. HTML-4

            Patient Guy wrote:[color=blue]
            > 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.][/color]

            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">Tex t</font>
            <foo bar="Hello!">Te xt</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.
            [color=blue]
            >From the other hand DOM specifies which element have, gonna have or[/color]
            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.

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: DOM-2/HTML vs. HTML-4

              Patient Guy wrote:
              [color=blue]
              > Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote [...]:[color=green]
              >> Patient Guy wrote:[color=darkred]
              >>> Taking the BODY element as an example, all of its style attributes[/color]
              >> Those are called "presentational " or "format(tin g) attributes" to
              >> avoid confusion with the `style' attribute and interface attributes
              >> related to that.
              >>[color=darkred]
              >>> ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML
              >>> 4.01,[/color]
              >>
              >> Yes, indeed.
              >>[color=darkred]
              >>> a fact noted in the DOM Level 2 HTML specification.[/color]
              >>
              >> Specified in the HTML 4.01 Specification.
              >>[color=darkred]
              >>> The DOM specification does not explicitly itself deprecate the use of
              >>> attributes however for the element in the interface definition
              >>> section I read.[/color]
              >>
              >> <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.[/color]
              >
              > 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[/color]

              Actually, it discusses the HTMLDocument interface. There is no DOCUMENT
              element.
              [color=blue]
              > 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>
              > [...][/color]

              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.
              [color=blue]
              > As to the other referenced section, the EXPRESS mention here is that the
              > HTML 4.01 specification deprecates it.[/color]

              Yes, exactly.
              [color=blue]
              > 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.[/color]

              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

              Comment

              • Thomas 'PointedEars' Lahn

                #8
                Re: DOM-2/HTML vs. HTML-4

                VK wrote:
                [color=blue]
                > Patient Guy wrote:
                > You question arises from the mixture of the HTML which is HiperText[/color]

                H_y_perText -- beyond text
                [color=blue]
                > *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.[/color]

                Nonsense. They are almost always pretty clear, but many people often
                don't bother to understand.
                [color=blue]
                > 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">Tex t</font>
                > <foo bar="Hello!">Te xt</foo>
                >
                > The first one is deprecated, so browser is not obligated to render the
                > text in red color.[/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]).
                [color=blue]
                > The second one is not defined in the default tags' set so should be
                > ignored.[/color]

                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 interoperabilit y 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.
                ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^
                [color=blue]
                > Neither of both have any DOM interfaces to be scripted except brute
                > force innerHTML replacement.[/color]

                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

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: DOM-2/HTML vs. HTML-4

                  Thomas 'PointedEars' Lahn wrote:
                  [color=blue]
                  > VK wrote:[color=green]
                  >> Neither of both have any DOM interfaces to be scripted except brute
                  >> force innerHTML replacement.[/color]
                  >
                  > 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/>[/color]

                  and, of course, any proprietary DOM the UA may provide.
                  The term "DOM" is _not_ restricted to the W3C DOM.


                  PointedEars, JFTR

                  Comment

                  • VK

                    #10
                    Re: DOM-2/HTML vs. HTML-4

                    <FLUD>
                    [color=blue][color=green]
                    >> VK wrote:
                    >> You question arises from the mixture of the HTML which is HiperText[/color][/color]
                    [color=blue]
                    > Thomas 'PointedEars' Lahn wrote:
                    > H_y_perText -- beyond text[/color]

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

                    </FLUD>

                    Comment

                    Working...