Bug 13933

Summary: REGRESSION: fast/history/clicked-link-is-visited is failing
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: HistoryAssignee: Beth Dakin <bdakin>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, bdakin
Priority: P1 Keywords: InRadar, LayoutTestFailure, Regression
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://build.webkit.org/results/post-commit-powerpc-mac-os-x/6871/fast/history/clicked-link-is-visited-diffs.txt
Attachments:
Description Flags
Fix Adele's test to reload through DRT adele: review+

Adam Roben (:aroben)
Reported 2007-05-30 11:00:23 PDT
fast/history/clicked-link-is-visited is failing on the buildbot.
Attachments
Fix Adele's test to reload through DRT (1.38 KB, patch)
2007-06-10 15:06 PDT, Beth Dakin
adele: review+
Adam Roben (:aroben)
Comment 1 2007-05-30 11:02:11 PDT
Beth Dakin
Comment 2 2007-06-08 15:15:09 PDT
This does not seem to reproduce outside of DumpRenderTree.
Beth Dakin
Comment 3 2007-06-08 16:17:52 PDT
Beth Dakin
Comment 4 2007-06-08 16:54:27 PDT
Working on this.
Beth Dakin
Comment 5 2007-06-08 19:09:37 PDT
This is difficult to debug because it only happens within DRT and only when you run the entire fast directory, but I have re-arranged the code a bit to get some clues, and I think that this is failing because of the reliance on having a page in the EventHandler::focusDocumentView(), which does seems a bit hard to believe, but it seems like that is the problem.
Beth Dakin
Comment 6 2007-06-08 20:33:59 PDT
Actually, that last assessment was incorrect, but what is actually going on is even crazier. This failure has nothing to do with Adele's code change. Instead, it has to do with the test that she added! Deleting that test makes this test pass every time! One I discovered this, I tried to run the two tests back-to-back to see if the failure would reproduce, and it would not. After a lot of testing and reducing, I cam up with a reduced case, which is to run the following three tests in DRT in order: fast/frames/empty.html fast/frames/frame-display-none-focus.html (This is the test Adele added) fast/history/clicked-link-is-visited.html fast/frames/empty.html is not a real test. And it really is empty. For some reason, though, some test, any test!, needs to run before Adele's test to see the bug. So, with THIS reduction, I discovered that the problematic part of Adele's test is: if (parent.location.href.indexOf('?') == -1) { parent.location.href= parent.location.href + "?"; } Removing that part of the test, also makes this other test succeed. I have NO idea how adding a "?" to the parent href would end up affecting history in a later test. I have not figured this out yet at all. But I am also curious about why that is needed for the test anyway. I may test if removing those lines will still make the test a valid layout test for the original issue, but I doubt that Adele would have left it in if it were not necessary.
Adele Peterson
Comment 7 2007-06-08 21:14:25 PDT
The whole '?' thing is to avoid getting in an infinite loop of reloading the page. You need to change the href to trigger a reload, but you only want to do it once.
Beth Dakin
Comment 8 2007-06-10 12:33:46 PDT
I re-wrote the test to reload in a different way, and it still caused the other test to fail. So there is something about reloading this page that causes the history/link-coloring test to fail.
Beth Dakin
Comment 9 2007-06-10 15:06:52 PDT
Created attachment 14926 [details] Fix Adele's test to reload through DRT I have a fix! Having the test reload through DRT's queueReload mechanism fixes the problem. I confirmed that this is still a valid test for the bug it originally fixed by rolling Adele's patch out of my tree. And sure enough, with Adele's patch gone, this new test also crashes. (Meaning it's valid!) My totally-pulled-out-of-my-ass threory is that reloading through JS got DRT's history all messed up. Maybe off-by-one? So DRT did not color the link the visited color because it did not make it into the history list yet. Or something.
Beth Dakin
Comment 10 2007-06-10 15:08:13 PDT
By the way, we should probably fix this problem in DRT. But right now, it is more important to have a green bot. And this is the fastest path to a green bot.
Adele Peterson
Comment 11 2007-06-10 15:20:55 PDT
Comment on attachment 14926 [details] Fix Adele's test to reload through DRT dear beth, you rock. from, adele
Beth Dakin
Comment 12 2007-06-10 15:30:14 PDT
Dear Adele, YOU TOOOO! From, Beth p.s. Fixed with r22087 p.p.s. adeleandbethrock.com
Note You need to log in before you can comment on or make changes to this bug.