+2009-01-01 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Turn on the regression test for ICU search on Mac OS X Tiger too.
+ It was already on for Windows (by accident, failing), but now WebCore has been changed
+ so it should work fine on all platforms using ICU, which includes both of those.
+
+ * platform/mac-tiger/editing/execCommand: Removed.
+ * platform/mac-tiger/editing/execCommand/findString-diacriticals-expected.txt: Removed.
+
2009-01-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler, Oliver Hunt
+2009-01-01 Darin Adler <darin@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Bug 23071: REGRESSION (r39536): New test failures after committing patch in bug 23051 (ICU search)
+ https://bugs.webkit.org/show_bug.cgi?id=23071
+
+ Also fix some things that Dan suggested during review of the ICU search patch that I forgot
+ the first time around.
+
+ * editing/TextIterator.cpp: Use ICU search on all platforms that use ICU, now that
+ we've double checked it works everywhere, removing HAVE_ICU_SEARCH entirely.
+ Removed unused m_atBreak data member from the non-ICU code path.
+ (WebCore::TextIterator::TextIterator): Move null check up.
+ (WebCore::TextIterator::handleTextBox): Fix mistake that made the iterator include
+ collapsed whitespace. This was left over from an earlier version of the patch.
+ (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
+ Move null check up.
+
2009-01-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler, Oliver Hunt
#include "RenderTextControl.h"
#include "visible_units.h"
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)
-#define HAVE_ICU_SEARCH 1
-#endif
-
-#if HAVE(ICU_SEARCH)
+#if USE(ICU_UNICODE)
#include <unicode/usearch.h>
#endif
-using namespace std;
using namespace WTF::Unicode;
+using namespace std;
namespace WebCore {
size_t search(size_t& startOffset);
bool atBreak() const;
-#if HAVE(ICU_SEARCH)
+#if USE(ICU_UNICODE)
private:
String m_target;
bool m_isBufferFull;
size_t m_cursor;
- bool m_atBreak;
-
#endif
};
// get and validate the range endpoints
Node* startContainer = r->startContainer();
+ if (!startContainer)
+ return;
int startOffset = r->startOffset();
Node* endContainer = r->endContainer();
int endOffset = r->endOffset();
- if (!startContainer)
- return;
// Callers should be handing us well-formed ranges. If we discover that this isn't
// the case, we could consider changing this assertion to an early return.
unsigned spaceRunStart = runStart - 1;
while (spaceRunStart > 0 && str[spaceRunStart - 1] == ' ')
--spaceRunStart;
- emitText(m_node, spaceRunStart, runStart);
+ emitText(m_node, spaceRunStart, spaceRunStart + 1);
} else
emitCharacter(' ', m_node, 0, runStart, runStart);
return;
return;
Node* startNode = r->startContainer();
+ if (!startNode)
+ return;
Node* endNode = r->endContainer();
int startOffset = r->startOffset();
int endOffset = r->endOffset();
- if (!startNode)
- return;
if (!startNode->offsetInCharacters()) {
if (startOffset >= 0 && startOffset < static_cast<int>(startNode->childNodeCount())) {
// --------
-#if HAVE(ICU_SEARCH)
+#if USE(ICU_UNICODE)
static const size_t minimumSearchBufferSize = 8192;
return usearch_getMatchedLength(searcher);
}
-#else
+#else // !ICU_UNICODE
inline SearchBuffer::SearchBuffer(const String& target, bool isCaseSensitive)
: m_target(isCaseSensitive ? target : target.foldCase())
return length;
}
-#endif
+#endif // !ICU_UNICODE
// --------