MantisBT - NetSurf
View Issue Details
0002339NetSurfRISC OS-specificpublic2015-08-02 12:202016-02-16 14:13
ReporterHarriet Bazley 
Assigned ToDave Higton 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformARMOSRISC OSOS Version5.19
Product Version3.4 
Target VersionFixed in Version3.4 
Fixed in CI build #3251
Reported in CI build #2817
URL of problem pagehttps://en.wikipedia.org/wiki/Primogeniture
Summary0002339: F4 search can ignore case sensitivity settings
DescriptionWhen searching the text of a web page, selecting the 'case sensitive' option often seems to have no effect.

RISC OS 5.21 on ARMini
Steps To ReproduceThis doesn't always seem to happen. An example that I managed to use to trigger it was to visit https://en.wikipedia.org/wiki/Primogeniture, press F4 and type 'Fr' into the 'Find text' dialogue box. The first string found is the 'Fr' in "From Wikipedia, the free encyclopedia".
If I now select the 'Case sensitive' radio icon, the selected text jumps to the 'fr' in "free encyclopedia", which is clearly incorrect (this does not match 'Fr' in a case-sensitive match), and clicking on the 'Next' button then takes us to matches in "the free dictionary", "the higher nobility and free families alike" and many more before reaching the first true match in "France" (which is what I was looking for).
 
Additional InformationIf I select the 'Case sensitive' radio icon before typing any search string rather than as a subsequent modification to the search, I seem to get the expected results (in this test case at any rate).

This bug has been around through many versions - I first noticed it a long time ago but have only just pursued it to source.
TagsNo tags attached.
Attached Fileshtm index.htm (801) 2015-11-29 21:31
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=391&type=bug
txt patch.txt (479) 2015-12-24 19:45
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=394&type=bug

Notes
(0000937)
Vincent Sanders   
2015-08-24 14:11   
We have no RISC OS maintainer so it is unlikely this will get addressed but i will leave it open for now.
(0001024)
Dave Higton   
2015-11-04 14:42   
Last night I chased the flags through, and out of the RISC OS specific part. The flags are correctly passed to the search function. The search only appears to obey the case sensitivity flag's value that was set before a search string was typed in.

We need somebody else to look at another platform and see if it fails equally.

How does search work? Does it create a list of all matches, then simply step through the list?
(0001027)
Dave Higton   
2015-11-04 22:15   
(Last edited: 2015-11-04 22:19)
If the content of the search text box is changed in mid-search, two things happen:

1) The caret leaps back to the first occurrence.

2) The case sensitivity flag's value is now honoured.

I'm puzzled.

I downloaded the latest Windows CI version today at work, but I couldn't see a search box open, so I was unable to try it on a different platform.

I've uploaded a test file, index.html, which is a quick and easy source of data to search.

(0001124)
Dave Higton   
2015-11-29 21:37   
(Last edited: 2015-11-29 21:43)
I've updated the test file index.html so that the content is on separate lines.

Using "Show all" is very illuminating - all the matching entries are highlighted, showing that the list of targets has been pre-calculated. Toggling case sensitivity doesn't change the highlighted entries, but editing the search text changes the list immediately.

I can't see, from the code, why the two operations produce a different result. One elementary difficulty is that they both call a function named "search", which is too generic a name to trawl the code for.

Is the search term cached, and does this result in the match list not being updated if the search term is the same when search is called next?

Edit: Yes, it does. I've made the toggle case sensitivity button call a dummy search for " " prior to calling the search for the real string. This causes the search list to be updated immediately the case sensitivity is toggled.

(0001130)
Dave Higton   
2015-12-24 19:45   
patch.txt is a patch that fixes it.
(0001248)
Vincent Sanders   
2016-02-16 14:12   
Confirmed fixed in 3.4 release

Issue History
2015-08-02 12:20Harriet BazleyNew Issue
2015-08-24 14:11Vincent SandersNote Added: 0000937
2015-08-24 14:11Vincent SandersStatusnew => acknowledged
2015-08-24 14:11Vincent SandersProduct Version => 3.4
2015-08-24 14:11Vincent SandersDescription Updatedbug_revision_view_page.php?rev_id=1538#r1538
2015-08-24 14:11Vincent SandersSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1540#r1540
2015-08-24 14:11Vincent SandersAdditional Information Updatedbug_revision_view_page.php?rev_id=1542#r1542
2015-11-04 14:42Dave HigtonNote Added: 0001024
2015-11-04 22:15Dave HigtonNote Added: 0001027
2015-11-04 22:15Dave HigtonFile Added: index.htm
2015-11-04 22:18Dave HigtonNote Edited: 0001027bug_revision_view_page.php?bugnote_id=1027#r1664
2015-11-04 22:19Dave HigtonNote Edited: 0001027bug_revision_view_page.php?bugnote_id=1027#r1665
2015-11-04 22:20Dave HigtonReproducibilitysometimes => always
2015-11-04 22:20Dave HigtonDescription Updatedbug_revision_view_page.php?rev_id=1666#r1666
2015-11-04 22:20Dave HigtonSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1667#r1667
2015-11-04 22:20Dave HigtonAdditional Information Updatedbug_revision_view_page.php?rev_id=1668#r1668
2015-11-29 21:30Dave HigtonFile Deleted: index.htm
2015-11-29 21:31Dave HigtonFile Added: index.htm
2015-11-29 21:37Dave HigtonNote Added: 0001124
2015-11-29 21:43Dave HigtonNote Edited: 0001124bug_revision_view_page.php?bugnote_id=1124#r1729
2015-12-24 19:45Dave HigtonNote Added: 0001130
2015-12-24 19:45Dave HigtonFile Added: patch.txt
2016-01-06 16:02Dave HigtonFixed in CI build # => 3251
2016-01-06 16:02Dave HigtonAssigned To => Dave Higton
2016-01-06 16:02Dave HigtonStatusacknowledged => resolved
2016-01-06 16:02Dave HigtonResolutionopen => fixed
2016-01-06 16:02Dave HigtonFixed in Version => 3.4
2016-02-16 14:12Vincent SandersNote Added: 0001248
2016-02-16 14:12Vincent SandersDescription Updatedbug_revision_view_page.php?rev_id=1809#r1809
2016-02-16 14:12Vincent SandersSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1810#r1810
2016-02-16 14:12Vincent SandersAdditional Information Updatedbug_revision_view_page.php?rev_id=1811#r1811
2016-02-16 14:13Vincent SandersStatusresolved => closed