<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>11042</bug_id>
          
          <creation_ts>2006-09-26 01:21:56 -0700</creation_ts>
          <short_desc>navigationController is borked</short_desc>
          <delta_ts>2023-09-18 08:13:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>ggaren</cc>
    
    <cc>mitz</cc>
    
    <cc>tonikitoo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>56516</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-09-26 01:21:56 -0700</bug_when>
    <thetext>navigationController is borked

Trying to use it just hangs DRT.

See attached test case:

&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; height=&quot;400&quot; width=&quot;400&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
  circle { fill: maroon; }
  a:visited circle { fill: green; }
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  &lt;![CDATA[
    if (window.layoutTestController) {
      layoutTestController.waitUntilDone();
      navigationController.evalAfterBackForwardNavigation(&quot;layoutTestController.notiftyDone()&quot;);
    }
  ]]&gt;
&lt;/script&gt;
&lt;a xlink:href=&quot;002.xml&quot; xlink:type=&quot;simple&quot;&gt;&lt;circle cx=&quot;200&quot; cy=&quot;200&quot; r=&quot;100&quot; fill=&quot;red&quot;/&gt;&lt;/a&gt;
&lt;/svg&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56517</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-09-26 01:22:46 -0700</bug_when>
    <thetext>Hum.. maybe it was my use of &quot;notiftyDone&quot; instead of notifyDone... I&apos;ll have to check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56653</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-09-27 13:39:07 -0700</bug_when>
    <thetext>Even after fixing my typo, the test still seems to hang.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56709</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-09-28 04:01:53 -0700</bug_when>
    <thetext>The script is executing again as a result of loading the test again (DRT doesn&apos;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 &quot;reentrancy&quot; - simply don&apos;t do anything in -evaluateWebScript:afterBackForwardNavigation: if pendingAction != None. (You&apos;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&apos;t loop endlessly, and found only one such test, which is currently disabled. When enabled it also loops).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1977866</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-16 15:29:08 -0700</bug_when>
    <thetext>I think Comment 03 is referring to following code snippet:

Link - https://github.com/WebKit/WebKit/blob/c58d1fdfb592147cbe5dc6cc04add73c405be63c/Tools/DumpRenderTree/mac/NavigationController.m#L67

- (void)evaluateWebScript:(NSString *)script afterBackForwardNavigation:(NSString *)navigation
{
    // Allow both arguments to be optional
    if (![script isKindOfClass:[NSString class]])
        script = @&quot;&quot;;
    if (![navigation isKindOfClass:[NSString class]])
        navigation = @&quot;about:blank&quot;;
    
    [self setPendingScript:script];
    [self setPendingRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:navigation]]];
    pendingAction = Load;
}


______

I haven&apos;t tried this test locally but don&apos;t know whether it is available in our tree or not but just wanted to share latest stuff to see whether we need to do anything or not.

CCing - @Alexey - since I don&apos;t know who would be right person to look into it to fix or close it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1978038</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-09-18 08:13:07 -0700</bug_when>
    <thetext>Yes, we do have navigationController in DumpRenderTree. But not in WebKitTestRunner.

And it is still true that there is only one test attempting to use it, and it&apos;s skipped. Can probably as well delete the test and the code after all these years.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>