Bug 11042

Summary: navigationController is borked
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ggaren, mitz, tonikitoo
Priority: P3    
Version: 420+   
Hardware: Macintosh   
OS: OS X 10.4   

Description Eric Seidel (no email) 2006-09-26 01:21:56 PDT
navigationController is borked

Trying to use it just hangs DRT.

See attached test case:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="400" width="400">
<style type="text/css">
  circle { fill: maroon; }
  a:visited circle { fill: green; }
</style>
<script type="text/javascript">
  <![CDATA[
    if (window.layoutTestController) {
      layoutTestController.waitUntilDone();
      navigationController.evalAfterBackForwardNavigation("layoutTestController.notiftyDone()");
    }
  ]]>
</script>
<a xlink:href="002.xml" xlink:type="simple"><circle cx="200" cy="200" r="100" fill="red"/></a>
</svg>
Comment 1 Eric Seidel (no email) 2006-09-26 01:22:46 PDT
Hum.. maybe it was my use of "notiftyDone" instead of notifyDone... I'll have to check.
Comment 2 Eric Seidel (no email) 2006-09-27 13:39:07 PDT
Even after fixing my typo, the test still seems to hang.
Comment 3 mitz 2006-09-28 04:01:53 PDT
The script is executing again as a result of loading the test again (DRT doesn't use the back/forward cache), so evalAfterBackForwardNavigation is getting called repeatedly without ever finishing.

I think you can patch NavigationController to prevent this kind of "reentrancy" - simply don't do anything in -evaluateWebScript:afterBackForwardNavigation: if pendingAction != None. (You'll also need to reset the pendingAction from runTest() in case the previous test bailed before completing).

(I was wondering how all the other tests that use navigationController don't loop endlessly, and found only one such test, which is currently disabled. When enabled it also loops).