KHTML: handling of invalid <a> tags

Allan Sandfeld Jensen kde at carewolf.com
Mon May 23 10:49:39 BST 2005


On Monday 23 May 2005 11:39, kae verens wrote:
> Dawit Alemayehu wrote:
> >I cannot click on links @ my Citibank online account. It seems that KHTML
> > can properly handle the following invalid HTML:
> >
> ><a href="javascript:alert('Hello World!')">
> ><big>Click Here</big>
> >
> >but not this one
> >
> ><a href="javascript:alert('Hello World!')"/>
> ><big>Click Here</big>
> >
> >Notice the no close tag, i.e. </a>. Does dealing with the last case
> > require special work ? FWIW it works fine in Mozilla/Firefox...
>
> It's strange that it would work in Mozilla/Firefox, as the HTML of the
> second one is actually correct, but does not apply the href to the <big>
> element.
>
> <a href="javascript:alert('Hello World!')"/><big>Click Here</big>
> is equivalent to
> <a href="javascript:alert('Hello World!')"></a><big>Click Here</big>
>
> (see the W3C XHTML specs to undestand usage of '/' for closing elements)
>
> In this case, it is actually Mozilla which should have a bug filed with
> it. No browser should apply a link in this case to the <big> element.
>
That is only true in XHTML. In HTML the ending / is just ignored. It is a 
general problem in KHTML that we do not ignore it.

`Allan




More information about the kfm-devel mailing list