2024-04-20 13:28 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002339NetSurfRISC OS-specificpublic2016-02-16 14:13
ReporterHarriet Bazley 
Assigned ToDave Higton 
SeverityminorReproducibilityalways 
StatusclosedResolutionfixed 
PlatformARMOSRISC OSOS Version5.19
Product Version3.4 
Target VersionFixed in Version3.4 
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.
Fixed in CI build #3251
Reported in CI build #2817
URL of problem pagehttps://en.wikipedia.org/wiki/Primogeniture
Attached Files
  • htm file icon index.htm (801 bytes) 2015-11-29 21:31
  • txt file icon patch.txt (479 bytes) 2015-12-24 19:45 -
    diff --git a/riscos/search.c b/riscos/search.c
    index 60b3716..9c438bf 100644
    --- a/riscos/search.c
    +++ b/riscos/search.c
    @@ -173,6 +173,8 @@ bool ro_gui_search_click(wimp_pointer *pointer)
     		case ICON_SEARCH_CASE_SENSITIVE:
     			flags = SEARCH_FLAG_FORWARDS |
     					ro_gui_search_update_flags();
    +			browser_window_search_clear(
    +					search_data.search_window);
     			browser_window_search(search_data.search_window, NULL,
     					flags,
     					ro_gui_get_icon_string(dialog_search,
    
    txt file icon patch.txt (479 bytes) 2015-12-24 19:45 +

-Relationships
+Relationships

-Notes
Vincent Sanders

~0000937

Vincent Sanders (administrator)

We have no RISC OS maintainer so it is unlikely this will get addressed but i will leave it open for now.
Dave Higton

~0001024

Dave Higton (developer)

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?
Dave Higton

~0001027

Dave Higton (developer)

Last edited: 2015-11-04 22:19

View 3 revisions

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.

Dave Higton

~0001124

Dave Higton (developer)

Last edited: 2015-11-29 21:43

View 2 revisions

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.

Dave Higton

~0001130

Dave Higton (developer)

patch.txt is a patch that fixes it.
Vincent Sanders

~0001248

Vincent Sanders (administrator)

Confirmed fixed in 3.4 release
+Notes

-Issue History
Date Modified Username Field Change
2015-08-02 12:20 Harriet Bazley New Issue
2015-08-24 14:11 Vincent Sanders Note Added: 0000937
2015-08-24 14:11 Vincent Sanders Status new => acknowledged
2015-08-24 14:11 Vincent Sanders Product Version => 3.4
2015-08-24 14:11 Vincent Sanders Description Updated View Revisions
2015-08-24 14:11 Vincent Sanders Steps to Reproduce Updated View Revisions
2015-08-24 14:11 Vincent Sanders Additional Information Updated View Revisions
2015-11-04 14:42 Dave Higton Note Added: 0001024
2015-11-04 22:15 Dave Higton Note Added: 0001027
2015-11-04 22:15 Dave Higton File Added: index.htm
2015-11-04 22:18 Dave Higton Note Edited: 0001027 View Revisions
2015-11-04 22:19 Dave Higton Note Edited: 0001027 View Revisions
2015-11-04 22:20 Dave Higton Reproducibility sometimes => always
2015-11-04 22:20 Dave Higton Description Updated View Revisions
2015-11-04 22:20 Dave Higton Steps to Reproduce Updated View Revisions
2015-11-04 22:20 Dave Higton Additional Information Updated View Revisions
2015-11-29 21:30 Dave Higton File Deleted: index.htm
2015-11-29 21:31 Dave Higton File Added: index.htm
2015-11-29 21:37 Dave Higton Note Added: 0001124
2015-11-29 21:43 Dave Higton Note Edited: 0001124 View Revisions
2015-12-24 19:45 Dave Higton Note Added: 0001130
2015-12-24 19:45 Dave Higton File Added: patch.txt
2016-01-06 16:02 Dave Higton Fixed in CI build # => 3251
2016-01-06 16:02 Dave Higton Assigned To => Dave Higton
2016-01-06 16:02 Dave Higton Status acknowledged => resolved
2016-01-06 16:02 Dave Higton Resolution open => fixed
2016-01-06 16:02 Dave Higton Fixed in Version => 3.4
2016-02-16 14:12 Vincent Sanders Note Added: 0001248
2016-02-16 14:12 Vincent Sanders Description Updated View Revisions
2016-02-16 14:12 Vincent Sanders Steps to Reproduce Updated View Revisions
2016-02-16 14:12 Vincent Sanders Additional Information Updated View Revisions
2016-02-16 14:13 Vincent Sanders Status resolved => closed
+Issue History