Index: Source/core/html/forms/TextFieldInputType.cpp |
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp |
index 1794ee257b71fb8ed582fb0e81a60406cb94ab21..67866290bfacd113fe0f8324473eed59a8d82005 100644 |
--- a/Source/core/html/forms/TextFieldInputType.cpp |
+++ b/Source/core/html/forms/TextFieldInputType.cpp |
@@ -419,7 +419,7 @@ void TextFieldInputType::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* |
// Selected characters will be removed by the next text event. |
unsigned baseLength = oldLength - selectionLength; |
- unsigned maxLength = static_cast<unsigned>(isTextType() ? element().maxLength() : HTMLInputElement::maximumLength); // maxLength can never be negative. |
+ unsigned maxLength = static_cast<unsigned>(this->maxLength()); // maxLength can never be negative. |
unsigned appendableLength = maxLength > baseLength ? maxLength - baseLength : 0; |
// Truncate the inserted text to avoid violating the maxLength and other constraints. |