W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2000

Re: Duplicate attribute names

From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
Date: Wed, 8 Nov 2000 17:13:02 +1300 (NZDT)
Message-Id: <200011080413.RAA07515@atlas.otago.ac.nz>
To: derhoermi@gmx.net, garyp@firstech.com, html-tidy@w3.org
Concerning tags with duplicated attributes,
the example being <td valign=top valign=top>

"Bjoern Hoehrmann" <derhoermi@gmx.net> wrote:
	What else should tidy do?  Which value should tidy keep?  Or
	should tidy remove both?  I think it's up to the author to
	decide what to do with those dups.  Yes, this may cause
	problems, but it was the author who created this problem, tidy
	could not fix it in an appropriate way.

The problem here is that a lot of us use Tidy on HTML that we did not
write and do not have ready access to the author of.  Sometimes when
we *do* have access to the author, s/he snarls that it works fine in
IE5 on a Win2k system so it should be good enough for anyone as is.
(Ok, it was Win95, but this is otherwise a real situation.)

When both copies of the attribute have the *same* value, it doesn't
*matter* which value Tidy keeps.

In other cases, it would make sense to keep the copy that browsers use.
I've just done a test with <p align=X align=Y> for each combination of
left/center/right, and it appears that

    Netscape uses the first value
    Amaya uses the second value
    ICab uses the first value
    WebTk uses the second value
    Emacs/W3 uses the second value

Maybe someone else can say what IE5 or Opera or Lynx do.

It's a pity there isn't a common convention, but it is precisely that
which tells us there is a real problem that Tidy can help with.  Add

    drop-duplicate-attributes: (never|keep-first|keep-last|if-equal)

so to preserve the behaviour you see in Netscape or ICab:

    drop-duplicate-attributes: keep-first

or to preserve the behaviour you see in Amaya, Emacs/W3, or WebTk:

    drop-duplicate-attributes: keep-last

or to play it safe:

    drop-duplicate-attributes: if-equal

or to do what Tidy does now:

    drop-duplicate-attributes: never

which would be the default.
Received on Tuesday, 7 November 2000 23:13:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:49 UTC