File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed 
src/librustdoc/html/static/js Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,12 @@ function preLoadCss(cssUrl) {
370370                        item  =>  { 
371371                            const  numbered  =  / ( [ ^ - ] + ) - ( [ 0 - 9 ] + ) / . exec ( item . id ) ; 
372372                            if  ( item . id  ===  assocId  ||  ( numbered  &&  numbered [ 1 ]  ===  assocId ) )  { 
373-                                 expandSection ( item . id ) ; 
374-                                 window . location  =  "#"  +  item . id ; 
373+                                 openParentDetails ( item ) ; 
374+                                 item . scrollIntoView ( ) ; 
375+                                 // Let the section expand itself before trying to highlight 
376+                                 setTimeout ( ( )  =>  { 
377+                                     window . location . replace ( "#"  +  item . id ) ; 
378+                                 } ,  0 ) ; 
375379                            } 
376380                        } 
377381                    ) ; 
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ wait-for: "#impl-ZyxwvutMethodDisambiguation"
2020assert-document-property: ({
2121    "URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation"
2222}, ENDS_WITH)
23+ assert: "section:target"
2324
2425goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
2526
@@ -39,3 +40,4 @@ wait-for: "#impl-ZyxwvutMethodDisambiguation"
3940assert-document-property: ({
4041    "URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation-1"
4142}, ENDS_WITH)
43+ assert: "section:target"
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments