This is also in Radar as: <rdar://problem/4402375> REGRESSION (417.8 - TOT): finding text sometimes also selects previous image In certain cases, after performing a Find, the resulting selection highlights both the found text and a preceding image element. This did not happen on the last released version of WebKit/Safari. I'll attach a test case with steps that are appropriate to that test case momentarily.
Created attachment 5570 [details] A few test cases that show this bug. To reproduce with this test page: 1. Load the test page 2. Command-F in Safari to bring up Find UI 3. Type "Throw" and hit Return to find first instance of Throw Note that the text "Throw" has the selection highlight, and the image right before the text also has the selection highlight. If you search for more instances with Find Next (command-G) the same thing occurs for the other test cases.
From <rdar://problem/4402375>: This bug does not occur in Safari-417.8, so it's a regression in TOT. The bug is probably in KWQKHTMLPart::findString, perhaps in this line: setSelection(SelectionController(resultRange.get(), DOWNSTREAM, VP_UPSTREAM_IF_POSSIBLE));
It's possible that I introduced this bug at some point since I did some work in findString a while back, but I suspect that the regression is instead caused by some other change, perhaps editing-related.
Mitz points out that this looks very similar to bug 5127, and I agree.
Yep, it seems extremely likely that this is the same as 5127 (and thus not directly related to findString).
*** This bug has been marked as a duplicate of 5127 ***