Bug 40192 - AX: link won't return linked element if URL contains #
Summary: AX: link won't return linked element if URL contains #
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: chris fleizach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 17:37 PDT by chris fleizach
Modified: 2010-06-13 21:01 PDT (History)
5 users (show)

See Also:


Attachments
Patch (8.93 KB, patch)
2010-06-11 10:57 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (10.40 KB, patch)
2010-06-11 11:25 PDT, chris fleizach
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2010-06-04 17:37:43 PDT
If you click on an internal link, so that the document URL contains a frament in it, subsequent calls to ask for linkedElements will not work
Comment 1 chris fleizach 2010-06-04 17:47:32 PDT
So i don't forget

Index: WebCore/accessibility/AccessibilityRenderObject.cpp
===================================================================
--- WebCore/accessibility/AccessibilityRenderObject.cpp	(revision 230881)
+++ WebCore/accessibility/AccessibilityRenderObject.cpp	(working copy)
@@ -1247,7 +1247,9 @@ AccessibilityObject* AccessibilityRender
     
     // check if URL is the same as current URL
     linkURL.removeFragmentIdentifier();
-    if (m_renderer->document()->url() != linkURL)
+    KURL documentURL = m_renderer->document()->url();
+    documentURL.removeFragmentIdentifier();
+    if (documentURL != linkURL)
         return 0;
Comment 2 chris fleizach 2010-06-11 10:57:23 PDT
Created attachment 58486 [details]
Patch
Comment 3 WebKit Review Bot 2010-06-11 11:08:14 PDT
Attachment 58486 [details] did not build on gtk:
Build output: http://webkit-commit-queue.appspot.com/results/3222217
Comment 4 chris fleizach 2010-06-11 11:25:19 PDT
Created attachment 58489 [details]
Patch
Comment 5 WebKit Review Bot 2010-06-11 11:32:29 PDT
Attachment 58486 [details] did not build on win:
Build output: http://webkit-commit-queue.appspot.com/results/3238275
Comment 6 Darin Adler 2010-06-12 19:13:37 PDT
Comment on attachment 58489 [details]
Patch

>      linkURL.removeFragmentIdentifier();
> -    if (m_renderer->document()->url() != linkURL)
> +    KURL documentURL = m_renderer->document()->url();
> +    documentURL.removeFragmentIdentifier();
> +    if (documentURL != linkURL)
>          return 0;

There's also a equalIgnoringFragmentIdentifier function in KURL.h that can be used for cases like this.
Comment 7 chris fleizach 2010-06-13 21:01:30 PDT
http://trac.webkit.org/changeset/61103