[Webkit-unassigned] [Bug 22599] New: Setting window.location.hash to "#id_some_div" does not set focus to that div.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 2 13:28:03 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=22599

           Summary: Setting window.location.hash to "#id_some_div" does not
                    set focus to that div.
           Product: WebKit
           Version: 525.x (Safari 3.1)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ivan at liberix.net


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='#div_id';).  It
should set focus to the target div and allow keyboard scrolling of the content.
 It also doesn'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, <a href="#id_some_div"> does work correctly, but I
need to use javascript (in strict html, I'm simulating an iFrame by hiding and
unhiding div'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'm doing is fairly widespread with
Firefox and IE, together the majority of end users.

FYI, I'm seeing this with Safari 3.2.1 (525.27.1).

I'd give a link, but it's on an Intranet.  If you really need one, I can put a
page outside the firewall.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list