When an anchor tag is not closed but its containing element closes, WebKit continues to treat all text afterwards as a link regardless. From my understanding of the HTML spec, the anchor tag should be implicitly closed when its containing block ends, and this behaviour is thus incorrect.
Created attachment 4725 [details] Testcase for bug 5771, the unclosing link bug
Related to 3905 They don't really depend, but there is no other good way to show relations in bugzilla.
We actually go out of our way to re-open the anchor tag, using the "residual style" mechanism. It should be possible to change the rules around.
Created attachment 10141 [details] test case 2 This bug has been responsible for some weirdness over at http://pecl.php.net/ : http://pear.php.net/bugs/bug.php?id=7183 The original test case attached to this bug looks the same to me in Safari and Firefox, so I don't know how wrong the behavior is. But I have a test case which shows how Safari is behaving differently from Firefox, attached as "test case 2." In Safari, the entire document is red, but in Firefox, the text "not a link 1" is shown in black, because Firefox has auto-closed the open anchor before going into the table. And presumably Safari should do the same.
The bug is now that 'not a link 1' in test case 2 displays red but with no underline. So close, but no cigar.
Testcase 2 still shows "not a link 1" as not underlined, while Firefox and Chrome show with an underline.
<rdar://problem/96543957>
Created attachment 468048 [details] STP179, WebKit ToT, Chrome Canary 119 and FX120 All matching each other.