Subject: bug#22075: 24.5; [EWW] eww handle link anchor not correctly

From: Alexis <[email-masked]>
Date: Sat, 05 Dec 2015 15:08:19 +1100

刘李进 <[email-masked]> writes:

> I found that the eww seems handle link anchor not 
> correctly. Reproduce step:
>
> 1. download the html file in attachment (comes from dash lua5.1 
> docset).  2. eww open the link: 
> file:///path-to/file#//apple_ref/func/string%2Esub 3. eww cannot 
> navigate to the correct position.  4. open the same link in 
> chrome/safari, works fine.

i'm able to reproduce this on 24.5.3 manually compiled on Debian 
Jessie x86_64.

`eww' eventually calls `eww-display-html', which contains:

    (cond 
     (point 
      (goto-char point)) 
     (shr-target-id 
      (goto-char (point-min)) (let ((point 
      (next-single-property-change 
                    (point-min) 'shr-target-id))) 
        (when point 
          (goto-char point))))

Stepping through this, `shr-target-id' correctly contains 
"//apple-ref/func/string%2Esub", so that `cond' branch is 
taken. However, the call to `next-single-property-change' returns 
nil, suggesting that the relevant anchor hasn't been properly 
propertised, resulting in the `when point' test failing.