#include "core/dom/Range.h"
#include "core/editing/FindOptions.h"
+#include "platform/heap/Handle.h"
#include "wtf/Vector.h"
namespace WebCore {
};
typedef unsigned TextIteratorBehaviorFlags;
-// FIXME: Can't really answer this question correctly without knowing the white-space mode.
-// FIXME: Move this somewhere else in the editing directory. It doesn't belong here.
-inline bool isCollapsibleWhitespace(UChar c)
-{
- switch (c) {
- case ' ':
- case '\n':
- return true;
- default:
- return false;
- }
-}
-
String plainText(const Range*, TextIteratorBehaviorFlags = TextIteratorDefaultBehavior);
-PassRefPtr<Range> findPlainText(const Range*, const String&, FindOptions);
-PassRefPtr<Range> findPlainText(const Position& start, const Position& end, const String&, FindOptions);
+PassRefPtrWillBeRawPtr<Range> findPlainText(const Range*, const String&, FindOptions);
+void findPlainText(const Position& inputStart, const Position& inputEnd, const String&, FindOptions, Position& resultStart, Position& resultEnd);
class BitStack {
public:
}
}
- PassRefPtr<Range> range() const;
+ PassRefPtrWillBeRawPtr<Range> range() const;
Node* node() const;
static int rangeLength(const Range*, bool spacesForReplacedElements = false);
- static PassRefPtr<Range> subrange(Range* entireRange, int characterOffset, int characterCount);
+ static PassRefPtrWillBeRawPtr<Range> subrange(Range* entireRange, int characterOffset, int characterCount);
private:
enum IterationProgress {
m_textContainer.prependTo(output, m_textOffset, m_textLength);
}
- PassRefPtr<Range> range() const;
+ PassRefPtrWillBeRawPtr<Range> range() const;
private:
void exitNode();
void appendTextTo(BufferType& output) { m_textIterator.appendTextTo(output, m_runOffset); }
int characterOffset() const { return m_offset; }
- PassRefPtr<Range> range() const;
+ PassRefPtrWillBeRawPtr<Range> range() const;
private:
void initialize();
bool atEnd() const { return m_textIterator.atEnd(); }
- PassRefPtr<Range> range() const;
+ PassRefPtrWillBeRawPtr<Range> range() const;
private:
int m_offset;
// Very similar to the TextIterator, except that the chunks of text returned are "well behaved",
// meaning they never end split up a word. This is useful for spellcheck or (perhaps one day) searching.
class WordAwareIterator {
+ STACK_ALLOCATED();
public:
explicit WordAwareIterator(const Range*);
~WordAwareIterator();
Vector<UChar> m_buffer;
// Did we have to look ahead in the textIterator to confirm the current chunk?
bool m_didLookAhead;
- RefPtr<Range> m_range;
+ RefPtrWillBeMember<Range> m_range;
TextIterator m_textIterator;
};