[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#774808: debsources: line number undefined



Hello!

On 08/01/15 10:31 AM, Matthieu Caneill wrote:
> On 7 January 2015 at 20:43, Reiner Herrmann <reiner@reiner-h.de> wrote:
>> I'm using Iceweasel 34.0, and when I'm viewing a source file
>> on sources.debian.net and click on a line number, it jumps
>> to the current URL with #Lundefined appended (instead of e.g. #L123).
>>
>> It is working correctly with konqueror, but it occurs even with
>> a new iceweasel profile (i.e. no addons installed).
> 
> Hi,
> Thanks for the report.
> I can reproduce this bug. As it works fine when I manually enter such
> an URL, I believe the bug is due to the new javascript module
> (debsources.js) which automatically highlights lines with internal
> links (#L42).
> Jason: any idea where this comes from?
> 

I will need to have a more closer look tonight after work, but at first
sight what I can notice is that there is a javascript error in the page
(in debsources.js at line 35). This part of the file was added by this
commit [1]

---
33: var msgbox = document.getElementById('messages');
34: var index = document.getElementById('sourceslinenumbers');
35: var divHeight = msgbox.offsetHeight;
---

If msgbox is null (because there are no elements with an ID of
'messages', then msgbox.offsetHeight will error out.


Sometimes a javascript error like this can lead to weird behaviors,
similar to what Reiner reported. But I will test a bit more tonight to
confirm if that's the case or not (and try to submit a patch for the
little issue I pointed above).



> Cheers,
> --
> Matthieu
> 

Thanks

Jason

[1]:
http://anonscm.debian.org/cgit/qa/debsources.git/commit/debsources/app/static/javascript/debsources.js?id=e246fcfeb7f20dde3f026d2c4ff8f7e71fc8e303


Reply to: