Bug 14721 - links randomly don't end properly
Summary: links randomly don't end properly
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-23 04:38 PDT by Derk-Jan Hartman
Modified: 2007-08-03 05:45 PDT (History)
2 users (show)

See Also:


Attachments
screenshot (26.92 KB, image/png)
2007-07-23 04:39 PDT, Derk-Jan Hartman
no flags Details
Test CSS (27 bytes, text/css)
2007-07-29 16:15 PDT, David Kilzer (:ddkilzer)
no flags Details
Test JavaScript (97 bytes, text/javascript)
2007-07-29 16:18 PDT, David Kilzer (:ddkilzer)
no flags Details
Test case (608.20 KB, text/html)
2007-07-29 16:20 PDT, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derk-Jan Hartman 2007-07-23 04:38:27 PDT
For the problem see the screenshot.

This is with Safari 3.0.2 on 10.4.10

I used inspect element, and it seems that the DOM was incorrectly loaded because whereas the page source shows:

<td><a href="/wiki/Wikipedia:Today%27s_featured_article/July_22%2C_2007" title="Wikipedia:Today's featured article/July 22, 2007">TFA</a></td>
<td><a href="/wiki/Wikipedia:Today%27s_featured_article/July_23%2C_2007" title="Wikipedia:Today's featured article/July 23, 2007">TFA</a></td>
<td><a href="/wiki/Wikipedia:Today%27s_featured_article/July_24%2C_2007" title="Wikipedia:Today's featured article/July 24, 2007">TFA</a></td>

Inspect element shows:
<td><a href="http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured<link rel=">
With textcontent: _article/July_22%2C_2007" title="Wikipedia:Today's featured article/July 22, 2007">TFA

A page reload usually fixes it, and I see it very rarely at all. (once every 100 or so pageloads). It seems completely random
Comment 1 Derk-Jan Hartman 2007-07-23 04:39:26 PDT
Created attachment 15646 [details]
screenshot

shot of an occurrence of this problem
Comment 2 Alexey Proskuryakov 2007-07-23 05:41:51 PDT
Can you reproduce this on the original page using "clone slowly" bookmarklet from <http://www.squarefree.com/bookmarklets/testbrowsers.html> (drag and drop it to the bookmarks bar to use)?

I have tried cloning your HTML snippet using several parameter values, but the clone was always correct.
Comment 3 Derk-Jan Hartman 2007-07-23 08:19:37 PDT
i have a suspicion that this may be a document.write from a javascript of a <link> ending up in a random place within my page. I'll try to get more details
Comment 4 Derk-Jan Hartman 2007-07-29 14:07:00 PDT
I can confirm that this is caused by a document.write from a .js in the <head> of this page. Apparently Safari 3 introduces a great randomness factor whenever you use document.write from non-inline .js 

Since this is quite common however (i have seen this in many scripts), some safeguarding might be appropriate... 
Comment 5 David Kilzer (:ddkilzer) 2007-07-29 15:55:29 PDT
A (reproducible) reduced test case (or a URL to an example page) would be very helpful!

Comment 6 David Kilzer (:ddkilzer) 2007-07-29 16:15:59 PDT
Created attachment 15732 [details]
Test CSS
Comment 7 David Kilzer (:ddkilzer) 2007-07-29 16:18:54 PDT
Created attachment 15733 [details]
Test JavaScript
Comment 8 David Kilzer (:ddkilzer) 2007-07-29 16:20:41 PDT
Created attachment 15734 [details]
Test case

Sample test case which writes a <link> element from an external JavaScript file.

NOTE: I have not been able to reproduce the issue using this test case locally.