[omnibox] Fix SuggestResult::ClassifyMatchContents edge case
This function has a truly weird contract that I didn't completely understand initially, so I caused a regression. Regression here: https://chromium-review.googlesource.com/c/chromium/src/+/1955787 The weird contract is - it recalculates the match's classifications, except in the case where we pass in a flag to forbid bold-all, and the reclassification would otherwise bold-all. Then the function is supposed to leave the existing classifications alone. It's weird, but it's necessary for flicker-free search queries as the user types with punctuation. This CL fixes it. It also adds some tests to prevent future regressions, as well as to explicitly document the edge case. I'll make a followup CL to do the same fix and test for NavigationResult separately. Bug: 1043440 Change-Id: Ieb4a9b6fd901eff9df553ce846c53e4ae11c0455 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2021316Reviewed-by:manuk hovanesian <manukh@chromium.org> Commit-Queue: Tommy Li <tommycli@chromium.org> Cr-Commit-Position: refs/heads/master@{#735472}
Showing
Please register or sign in to comment