summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/InputElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/InputElement.cpp')
-rw-r--r--WebCore/dom/InputElement.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index 13bb0b2..52812f9 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -151,7 +151,7 @@ String InputElement::sanitizeUserInputValue(const InputElement* inputElement, co
string.replace('\r', ' ');
string.replace('\n', ' ');
- unsigned newLength = string.numCharactersInGraphemeClusters(maxLength);
+ unsigned newLength = numCharactersInGraphemeClusters(string, maxLength);
for (unsigned i = 0; i < newLength; ++i) {
const UChar current = string[i];
if (current < ' ' && current != '\t') {
@@ -170,10 +170,10 @@ void InputElement::handleBeforeTextInsertedEvent(InputElementData& data, InputEl
// We use RenderTextControlSingleLine::text() instead of InputElement::value()
// because they can be mismatched by sanitizeValue() in
// RenderTextControlSingleLine::subtreeHasChanged() in some cases.
- unsigned oldLength = toRenderTextControlSingleLine(element->renderer())->text().numGraphemeClusters();
+ unsigned oldLength = numGraphemeClusters(toRenderTextControlSingleLine(element->renderer())->text());
// selection() may be a pre-edit text.
- unsigned selectionLength = plainText(element->document()->frame()->selection()->selection().toNormalizedRange().get()).numGraphemeClusters();
+ unsigned selectionLength = numGraphemeClusters(plainText(element->document()->frame()->selection()->selection().toNormalizedRange().get()));
ASSERT(oldLength >= selectionLength);
// Selected characters will be removed by the next text event.