I beleive I've found a bug while rendering the xhtml transitional document by WebKit nightly (28.11.2008), Safari 3.2.1 and the latest Chrome affected as well. Here is the simple test case: test.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>test</title> <link rel="stylesheet" href="default.css" type="text/css" /> </head> <body> <table border="1"> <tr><td> <a name="top" /> <table> <tr><td> <a name="23" /> <table border="1"> <tr> <td>text1</td> <td>text2</td> </tr> <tr><td colspan="2"><a href="#top">top</a></td></tr> </table> </td></tr> <tr><td> <a name="12" /> <table border="1"> <tr> <td>text3</td> <td>text4</td> </tr> <tr><td colspan="2"><a href="#top">top</a></td></tr> </table> </td></tr> </table> </td></tr> </table> </body> </html> default.css: a:link, a:active, a:visited { color: #006699; text-decoration:none; } a:hover { text-decoration:none; color: #EE4000; } The document passes the validation by w3c online at http://validator.w3.org/ Actual behaviour: Text in table cells change its color by mouse hovering on it as if it surrounded by <a> tag. Expected behaviour: Text in table cells stay black.
While trying to reproduce the bug, I noticed something with your test case. I made the mistake of serving it with a Content-Type of text/html and I could definitely reproduce the bug. However if I served it with a Content-Type of application/xhtml+xml, the behaviour is correct. Could you confirm that you fell into the same pitfall so that we can update the bug and reduce the test case a bit more?
When I saw this behavior the Content-Type was set to 'text/html'. Sorry, can't test it using the Content-Type set to 'application/xhtml+xml' but I believe that it would work as expected. And one more thing: when I created the test case I loaded it into browser directly using file: proto (not using http-server) and the error persisted.
Thanks for your reply. I have tweaked the bug information with your comment and to reflect my research on this. FYI the Inspector suggests strongly an HTML DOM bug as the empty <a> tags seem to contain other elements.
Created attachment 27586 [details] Reduction (based on Alexander Mitin's example)
I am not able to get expected result from the reduction attached test case in Safari 15.6 on macOS 12.5 and text in table cell change color based on text-decoration. It is same in Chrome Canary 106. Although for some reason, Firefox is extending text-decoration to table borders as well and changing table border color accordingly. Is it web-spec clarity issue or is Firefox is doing right? I am not sure but just wanted to share latest results. Thanks!
Wow, it's almost 14 years passed since I reported this bug so I just forgot about it. :) Probably, the WebKit code base has been significantly changed since then, and this issue has been fixed by itself or someone silently or accidentally fixed it. Sorry, no any idea about Firefox.
Self closing anchor tag isn't really a thing in HTML as you can see in Web Inspector. All browsers match in their behaviors. -> Config Changed