[PATCH] D23277: [llvm-cov] Add the "Goto first zero count" feature.

Ying Yi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 16:09:22 PDT 2016

MaggieYi added a comment.

In https://reviews.llvm.org/D23277#526594, @vsk wrote:

> Thanks for splitting things up :).
> I'm not sure that the javascript bit is needed. It looks like a way to remove/disable a link, but I don't see any issue with leaving the link active.

If the link is removed, the user could easily know that this source file is fully covered. From this point, it is better to remove the link.

In addition, the JavaScript is also used by another patch. Following this patch, I want to submit another patch which provides easy navigation to find the previous and next source file report. For each source file view, three hyperlinks (index, prev and next links) are given below the report create time. By clicking the index link, the coverage report will go back to index.html page. The prev/next links will go to the previous/next source report. The prev link is disabled if the source file is the first source file link in the index page. The next link is disabled if the source file is the last source file link in the index page. The JavaScript of removing the link is also needed by the index/prev/next patch.

> I also don't think we need a 'zeroline' or 'zero' id. Every line already has an anchor: <a name='L$N'>. I think a "Jump to the first uncovered line" link which uses one of the line anchors would do the job.

I use the following way to implement “Goto first zero line” feature.

To create links to jump to the first uncovered line within the page, two HTML tags need to be used.

<a href="#zero">Goto first zero count</a>

This first tag is almost the same as any other HTML tag you would use to create a link to another page. However, to create a bookmark (anchor), I must start the link with a #, which represents a name statement, used in the next tag. When the user clicks on the "Goto first zero count" link, the computer would then go to the name tag, if found on the same page of the link.


This next piece of code is where the link will go to on the page when the link is clicked. The ID attribute is added to a <tr> tag.

<tr id="zero">

Since I also need an ID to remove the link by Javascript, the 'id="zeroline"'has been added to the first tag.

<a href="#zero" 'id="zeroline">Goto first zero count</a>

Both 'zeroline' and 'zero' are needed using this method. I am not sure the way you mentioned here. Could you please explain it by an example?



More information about the llvm-commits mailing list