Changeset 166507 in webkit
- Timestamp:
- Mar 31, 2014 9:32:25 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166506 r166507 1 2014-03-31 Alexey Proskuryakov <ap@apple.com> 2 3 Remove special handling of soft hyphens in search code 4 https://bugs.webkit.org/show_bug.cgi?id=130940 5 6 Reviewed by Anders Carlsson. 7 8 ICU knows to ignore soft hyphens, so we don't need to replace them before searching. 9 10 Covered by existing tests. 11 12 * editing/TextIterator.cpp: 13 (WebCore::foldQuoteMark): 14 (WebCore::foldQuoteMarks): 15 (WebCore::SearchBuffer::SearchBuffer): 16 (WebCore::SearchBuffer::append): 17 (WebCore::foldQuoteMarkOrSoftHyphen): Deleted. 18 (WebCore::foldQuoteMarksAndSoftHyphens): Deleted. 19 1 20 2014-03-31 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WebCore/editing/TextIterator.cpp
r166134 r166507 1622 1622 // -------- 1623 1623 1624 static inline UChar foldQuoteMark OrSoftHyphen(UChar c)1624 static inline UChar foldQuoteMark(UChar c) 1625 1625 { 1626 1626 switch (c) { … … 1633 1633 case rightSingleQuotationMark: 1634 1634 return '\''; 1635 case softHyphen:1636 // Replace soft hyphen with an ignorable character so that their presence or absence will1637 // not affect string comparison.1638 return 0;1639 1635 default: 1640 1636 return c; … … 1645 1641 // of doing it in a separate replacement pass here, but ICU doesn't offer a way 1646 1642 // to add tailoring on top of the locale-specific tailoring as of this writing. 1647 static inline String foldQuoteMarks AndSoftHyphens(String string)1643 static inline String foldQuoteMarks(String string) 1648 1644 { 1649 1645 string.replace(hebrewPunctuationGeresh, '\''); … … 1653 1649 string.replace(rightDoubleQuotationMark, '"'); 1654 1650 string.replace(rightSingleQuotationMark, '\''); 1655 1656 // Replace soft hyphens with an ignorable character so that presence or absence will not affect string comparison.1657 string.replace(softHyphen, 0);1658 1651 1659 1652 return string; … … 1941 1934 1942 1935 inline SearchBuffer::SearchBuffer(const String& target, FindOptions options) 1943 : m_target(foldQuoteMarks AndSoftHyphens(target))1936 : m_target(foldQuoteMarks(target)) 1944 1937 , m_targetCharacters(StringView(m_target).upconvertedCharacters()) 1945 1938 , m_options(options) … … 2031 2024 m_buffer.grow(oldLength + usableLength); 2032 2025 for (unsigned i = 0; i < usableLength; ++i) 2033 m_buffer[oldLength + i] = foldQuoteMark OrSoftHyphen(text[i]);2026 m_buffer[oldLength + i] = foldQuoteMark(text[i]); 2034 2027 return usableLength; 2035 2028 } … … 2268 2261 ASSERT(!m_target.isEmpty()); 2269 2262 m_target.replace(noBreakSpace, ' '); 2270 foldQuoteMarks AndSoftHyphens(m_target);2263 foldQuoteMarks(m_target); 2271 2264 } 2272 2265 … … 2288 2281 inline void SearchBuffer::append(UChar c, bool isStart) 2289 2282 { 2290 m_buffer[m_cursor] = c == noBreakSpace ? ' ' : foldQuoteMark OrSoftHyphen(c);2283 m_buffer[m_cursor] = c == noBreakSpace ? ' ' : foldQuoteMark(c); 2291 2284 m_isCharacterStartBuffer[m_cursor] = isStart; 2292 2285 if (++m_cursor == m_target.length()) {
Note: See TracChangeset
for help on using the changeset viewer.