<?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>22599</bug_id>
          
          <creation_ts>2008-12-02 13:28:03 -0800</creation_ts>
          <short_desc>Setting window.location.hash to &quot;#id_some_div&quot; does not set focus to that div.</short_desc>
          <delta_ts>2015-08-18 17:33:53 -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>WebCore JavaScript</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>ivan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jcraig</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101058</commentid>
    <comment_count>0</comment_count>
    <who name="">ivan</who>
    <bug_when>2008-12-02 13:28:03 -0800</bug_when>
    <thetext>Setting window.location.hash with javascript does nothing when set to the id of a div in the current document (e.g. window.location.hash=&apos;#div_id&apos;;).  It should set focus to the target div and allow keyboard scrolling of the content.  It also doesn&apos;t work when #id is assigned to window.location.href or just window.location.  All of these variants work perfectly with Firefox (and even IE7) but not with Safari or Google Chrome (which is why I perceive the problem to be in Webkit itself).

Interestingly, an html link, &lt;a href=&quot;#id_some_div&quot;&gt; does work correctly, but I need to use javascript (in strict html, I&apos;m simulating an iFrame by hiding and unhiding div&apos;s within a containing, positioned div and then re-locating to the newly unhidden div by setting window.location).

I am well aware the location object is not standardized, but this is an important cross browser issue, because what I&apos;m doing is fairly widespread with Firefox and IE, together the majority of end users.

FYI, I&apos;m seeing this with Safari 3.2.1 (525.27.1).

I&apos;d give a link, but it&apos;s on an Intranet.  If you really need one, I can put a page outside the firewall.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1118488</commentid>
    <comment_count>1</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2015-08-18 01:11:26 -0700</bug_when>
    <thetext>Please include a link to the part of the HTML spec that defines this as expected behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1118738</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Rebert">webkit</who>
    <bug_when>2015-08-18 17:33:53 -0700</bug_when>
    <thetext>I can&apos;t reproduce.
The focusing works fine in Safari 8.0.8 AFAICT.
Testcase: http://jsfiddle.net/cvrebert/8z9xyo1z/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>