Changeset 72989 in webkit
- Timestamp:
- Nov 30, 2010, 5:48:07 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r72987 r72989 1 2010-11-30 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Text search should treat all matches as word-start matches when the target begins with a separator character 6 https://bugs.webkit.org/show_bug.cgi?id=50302 7 8 * editing/text-iterator/findString.html: 9 * editing/text-iterator/findString-expected.txt: 10 * platform/mac-leopard/editing/text-iterator: Removed. 11 * platform/mac-leopard/editing/text-iterator/findString-expected.txt: Removed. 12 1 13 2010-11-30 Martin Robinson <mrobinson@igalia.com> 2 14 -
trunk/LayoutTests/editing/text-iterator/findString-expected.txt
r72887 r72989 53 53 54 54 Searching for ‘.org’ in ‘webkit.org’ with options [AtWordStarts]: 55 PASS: Got a match at 6,10 as expected. 55 56 PASS: Got no match as expected. 56 57 … … 147 148 PASS: Got no match as expected. 148 149 150 Searching for ‘ ’ in ‘Spaces, the final frontier’ with options [AtWordStarts]: 151 PASS: Got a match at 7,8 as expected. 152 PASS: Got a match at 11,12 as expected. 153 PASS: Got a match at 17,18 as expected. 154 PASS: Got no match as expected. 149 155 156 Searching for ‘@’ in ‘Use an @import rule’ with options [AtWordStarts]: 157 PASS: Got a match at 7,8 as expected. 158 PASS: Got no match as expected. 159 160 Searching for ‘(x’ in ‘If ((x + 5) * 2) = 14, then x = 2’ with options [AtWordStarts]: 161 PASS: Got a match at 4,6 as expected. 162 PASS: Got no match as expected. 163 164 -
trunk/LayoutTests/editing/text-iterator/findString.html
r72887 r72989 52 52 53 53 testFindString("webkit.org", "org", ["AtWordStarts"], [[]]); 54 testFindString("webkit.org", ".org", ["AtWordStarts"], [[ ]]);54 testFindString("webkit.org", ".org", ["AtWordStarts"], [[6, 10], []]); 55 55 56 56 testFindString("webkit.org", "rg", ["AtWordStarts", "TreatMedialCapitalAsWordStart"], [[]]); … … 102 102 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize - 3) + " " + thaiWords[4] + bufferSizedString, thaiWords[2], ["AtWordStarts"], [[]]); 103 103 104 testFindString("Spaces, the final frontier", " ", ["AtWordStarts"], [[7, 8], [11, 12], [17, 18], []]); 105 testFindString("Use an @import rule", "@", ["AtWordStarts"], [[7, 8], []]); 106 testFindString("If ((x + 5) * 2) = 14, then x = 2", "(x", ["AtWordStarts"], [[4, 6], []]); 107 104 108 document.getElementById("console").style.removeProperty("visibility"); 105 109 </script> -
trunk/WebCore/ChangeLog
r72988 r72989 1 2010-11-30 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Text search should treat all matches as word-start matches when the target begins with a separator character 6 https://bugs.webkit.org/show_bug.cgi?id=50302 7 8 * editing/TextIterator.cpp: 9 (WebCore::SearchBuffer::SearchBuffer): Disable the AtWordStarts option if it was specified and 10 the target string begins with one of the "separator" characters. 11 1 12 2010-11-30 Pavel Feldman <pfeldman@chromium.org> 2 13 -
trunk/WebCore/editing/TextIterator.cpp
r72968 r72989 1893 1893 m_overlap = m_buffer.capacity() / 4; 1894 1894 1895 if ((m_options & AtWordStarts) && targetLength) { 1896 UChar32 targetFirstCharacter; 1897 U16_GET(m_target.characters(), 0, 0, targetLength, targetFirstCharacter); 1898 // Characters in the separator category never really occur at the beginning of a word, 1899 // so if the target begins with such a character, we just ignore the AtWordStart option. 1900 if (isSeparator(targetFirstCharacter)) { 1901 m_options &= ~AtWordStarts; 1902 m_needsMoreContext = false; 1903 } 1904 } 1905 1895 1906 // Grab the single global searcher. 1896 1907 // If we ever have a reason to do more than once search buffer at once, we'll have
Note:
See TracChangeset
for help on using the changeset viewer.