[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tkent at chromium.org tkent at chromium.org
Wed Dec 22 15:51:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2f714945e17ada2c45c3f45ca2889e6899ea875c
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 15 05:40:02 2010 +0000

    2010-11-14  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Improve API for form validation message strings
            https://bugs.webkit.org/show_bug.cgi?id=34945
    
            This change introduces three new functions;
            validationMessageTypeMismatchFor*Text(). The implementation for each
            platform is just a call to validationMessageTypeMismatchText().
    
            Some validationMessage*() functions have new parameters.  The parameters
            are ignored in all platforms for now.
    
            This change doesn't change any behavior. However a platform can add
            additional information to validation messages.  e.g. Changing "type
            mismatch" to "Please specify an e-mail address" for <input type=email>.
    
            * html/EmailInputType.cpp:
            (WebCore::EmailInputType::typeMismatchText): Call validationMessageTypeMismatchForEmailText()
              or validationMessageTypeMismatchForMultipleEmailText().
            * html/EmailInputType.h:
            * html/HTMLFormControlElement.h: Add maxLength() and value() to access them from ValidityState.
            * html/HTMLInputElement.cpp: Add the following functions to pass extra
              information to validation message string functions.
            (WebCore::HTMLInputElement::minimumString):
            (WebCore::HTMLInputElement::maximumString):
            (WebCore::HTMLInputElement::stepBaseString):
            (WebCore::HTMLInputElement::stepString):
            (WebCore::HTMLInputElement::typeMismatchText):
            * html/HTMLInputElement.h:
            * html/HTMLTextAreaElement.h:
            * html/InputType.cpp:
            (WebCore::InputType::typeMismatchText): Call validationMessageTypeMismatchText().
            * html/InputType.h:
            * html/URLInputType.cpp:
            (WebCore::URLInputType::typeMismatchText): Call validationMessageTypeMismatchForURLText().
            * html/URLInputType.h:
            * html/ValidityState.cpp:
            (WebCore::ValidityState::validationMessage):
            * platform/LocalizedStrings.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
            * platform/LocalizedStrings.h:
              - Add validationMessageTypeMismatchForEmailText(),
                validationMessageTypeMismatchForMultipleEmailText() and
                validationMessageTypeMismatchForURLText()
              - Add length parameters to validationMessageTooLongText().
              - Add the minimum value parameter to validationMessageRangeUnderflowText()
              - Add the maximum value parameter to validationMessageRangeOverflowText()
              - Add parameters of the base value and the step value to validationMessageStepMismatchText()
            * platform/android/LocalizedStringsAndroid.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
            * platform/brew/LocalizedStringsBrew.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
            * platform/efl/LocalizedStringsEfl.cpp:
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageStepMismatchText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            * platform/gtk/LocalizedStringsGtk.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
            * platform/haiku/LocalizedStringsHaiku.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
            * platform/wx/LocalizedStringsWx.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
    2010-11-14  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Improve API for form validation message strings
            https://bugs.webkit.org/show_bug.cgi?id=34945
    
            * public/WebLocalizedString.h:
            * src/LocalizedStrings.cpp:
            (WebCore::validationMessageTypeMismatchForEmailText):
            (WebCore::validationMessageTypeMismatchForMultipleEmailText):
            (WebCore::validationMessageTypeMismatchForURLText):
            (WebCore::validationMessageTooLongText):
            (WebCore::validationMessageRangeUnderflowText):
            (WebCore::validationMessageRangeOverflowText):
            (WebCore::validationMessageStepMismatchText):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71996 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index effa8a1..c8e785e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,110 @@
 2010-11-14  Kent Tamura  <tkent at chromium.org>
 
+        Reviewed by Dimitri Glazkov.
+
+        Improve API for form validation message strings
+        https://bugs.webkit.org/show_bug.cgi?id=34945
+        
+        This change introduces three new functions;
+        validationMessageTypeMismatchFor*Text(). The implementation for each
+        platform is just a call to validationMessageTypeMismatchText().
+
+        Some validationMessage*() functions have new parameters.  The parameters
+        are ignored in all platforms for now.
+
+        This change doesn't change any behavior. However a platform can add
+        additional information to validation messages.  e.g. Changing "type
+        mismatch" to "Please specify an e-mail address" for <input type=email>.
+
+        * html/EmailInputType.cpp:
+        (WebCore::EmailInputType::typeMismatchText): Call validationMessageTypeMismatchForEmailText()
+          or validationMessageTypeMismatchForMultipleEmailText().
+        * html/EmailInputType.h:
+        * html/HTMLFormControlElement.h: Add maxLength() and value() to access them from ValidityState.
+        * html/HTMLInputElement.cpp: Add the following functions to pass extra
+          information to validation message string functions.
+        (WebCore::HTMLInputElement::minimumString):
+        (WebCore::HTMLInputElement::maximumString):
+        (WebCore::HTMLInputElement::stepBaseString):
+        (WebCore::HTMLInputElement::stepString):
+        (WebCore::HTMLInputElement::typeMismatchText):
+        * html/HTMLInputElement.h:
+        * html/HTMLTextAreaElement.h:
+        * html/InputType.cpp:
+        (WebCore::InputType::typeMismatchText): Call validationMessageTypeMismatchText().
+        * html/InputType.h:
+        * html/URLInputType.cpp:
+        (WebCore::URLInputType::typeMismatchText): Call validationMessageTypeMismatchForURLText().
+        * html/URLInputType.h:
+        * html/ValidityState.cpp:
+        (WebCore::ValidityState::validationMessage):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        * platform/LocalizedStrings.h:
+          - Add validationMessageTypeMismatchForEmailText(),
+            validationMessageTypeMismatchForMultipleEmailText() and
+            validationMessageTypeMismatchForURLText()
+          - Add length parameters to validationMessageTooLongText().
+          - Add the minimum value parameter to validationMessageRangeUnderflowText()
+          - Add the maximum value parameter to validationMessageRangeOverflowText()
+          - Add parameters of the base value and the step value to validationMessageStepMismatchText()
+        * platform/android/LocalizedStringsAndroid.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        * platform/brew/LocalizedStringsBrew.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageStepMismatchText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        * platform/haiku/LocalizedStringsHaiku.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+        * platform/wx/LocalizedStringsWx.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+
+2010-11-14  Kent Tamura  <tkent at chromium.org>
+
         Reviewed by Andreas Kling.
 
         KeyboardEvent::keyIdentifier() should return "const String&"
diff --git a/WebCore/html/EmailInputType.cpp b/WebCore/html/EmailInputType.cpp
index 78bda9c..e61129e 100644
--- a/WebCore/html/EmailInputType.cpp
+++ b/WebCore/html/EmailInputType.cpp
@@ -25,6 +25,7 @@
 #include "EmailInputType.h"
 
 #include "HTMLInputElement.h"
+#include "LocalizedStrings.h"
 #include "RegularExpression.h"
 #include <wtf/PassOwnPtr.h>
 
@@ -79,4 +80,9 @@ bool EmailInputType::typeMismatch() const
     return typeMismatchFor(element()->value());
 }
 
+String EmailInputType::typeMismatchText() const
+{
+    return element()->multiple() ? validationMessageTypeMismatchForMultipleEmailText() : validationMessageTypeMismatchForEmailText();
+}
+
 } // namespace WebCore
diff --git a/WebCore/html/EmailInputType.h b/WebCore/html/EmailInputType.h
index b77a9ad..771715a 100644
--- a/WebCore/html/EmailInputType.h
+++ b/WebCore/html/EmailInputType.h
@@ -44,6 +44,7 @@ private:
     virtual const AtomicString& formControlType() const;
     virtual bool typeMismatchFor(const String&) const;
     virtual bool typeMismatch() const;
+    virtual String typeMismatchText() const;
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 8c98d91..568f63e 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -199,6 +199,9 @@ public:
     void setSelectionRange(int start, int end);
     PassRefPtr<Range> selection() const;
 
+    virtual int maxLength() const = 0;
+    virtual String value() const = 0;
+
 protected:
     HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*);
 
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index c683d49..0284ab5 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -251,6 +251,37 @@ bool HTMLInputElement::stepMismatch(const String& value) const
     return m_inputType->stepMismatch(value, step);
 }
 
+String HTMLInputElement::minimumString() const
+{
+    return m_inputType->serialize(minimum());
+}
+
+String HTMLInputElement::maximumString() const
+{
+    return m_inputType->serialize(maximum());
+}
+
+String HTMLInputElement::stepBaseString() const
+{
+    return m_inputType->serialize(m_inputType->stepBase());
+}
+
+String HTMLInputElement::stepString() const
+{
+    double step;
+    if (!getAllowedValueStep(&step)) {
+        // stepString() should be called only if stepMismatch() can be true.
+        ASSERT_NOT_REACHED();
+        return String();
+    }
+    return serializeForNumberType(step / m_inputType->stepScaleFactor());
+}
+
+String HTMLInputElement::typeMismatchText() const
+{
+    return m_inputType->typeMismatchText();
+}
+
 bool HTMLInputElement::getAllowedValueStep(double* step) const
 {
     return getAllowedValueStepWithDecimalPlaces(step, 0);
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 0acf21e..e9907d2 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -68,6 +68,11 @@ public:
     bool getAllowedValueStepWithDecimalPlaces(double*, unsigned*) const;
     // For ValidityState.
     bool stepMismatch(const String&) const;
+    String minimumString() const;
+    String maximumString() const;
+    String stepBaseString() const;
+    String stepString() const;
+    String typeMismatchText() const;
 
     // Implementations of HTMLInputElement::stepUp() and stepDown().
     void stepUp(int, ExceptionCode&);
@@ -171,7 +176,7 @@ public:
 
     KURL src() const;
 
-    int maxLength() const;
+    virtual int maxLength() const;
     void setMaxLength(int, ExceptionCode&);
 
     bool multiple() const;
diff --git a/WebCore/html/HTMLTextAreaElement.h b/WebCore/html/HTMLTextAreaElement.h
index d951c02..669fcd8 100644
--- a/WebCore/html/HTMLTextAreaElement.h
+++ b/WebCore/html/HTMLTextAreaElement.h
@@ -40,12 +40,12 @@ public:
 
     bool shouldWrapText() const { return m_wrap != NoWrap; }
 
-    String value() const;
+    virtual String value() const;
     void setValue(const String&);
     String defaultValue() const;
     void setDefaultValue(const String&);
     int textLength() const { return value().length(); }
-    int maxLength() const;
+    virtual int maxLength() const;
     void setMaxLength(int, ExceptionCode&);
     bool valueMissing(const String& value) const { return isRequiredFormControl() && !disabled() && !readOnly() && value.isEmpty(); }
     bool tooLong(const String&, NeedsToCheckDirtyFlag) const;
diff --git a/WebCore/html/InputType.cpp b/WebCore/html/InputType.cpp
index c0cc342..a0ea110 100644
--- a/WebCore/html/InputType.cpp
+++ b/WebCore/html/InputType.cpp
@@ -41,6 +41,7 @@
 #include "HiddenInputType.h"
 #include "ImageInputType.h"
 #include "IsIndexInputType.h"
+#include "LocalizedStrings.h"
 #include "MonthInputType.h"
 #include "NumberInputType.h"
 #include "PasswordInputType.h"
@@ -269,6 +270,11 @@ double InputType::acceptableError(double) const
     return 0;
 }
 
+String InputType::typeMismatchText() const
+{
+    return validationMessageTypeMismatchText();
+}
+
 RenderObject* InputType::createRenderer(RenderArena*, RenderStyle* style) const
 {
     return RenderObject::createObject(element(), style);
diff --git a/WebCore/html/InputType.h b/WebCore/html/InputType.h
index 78aab7c..dfa4fb0 100644
--- a/WebCore/html/InputType.h
+++ b/WebCore/html/InputType.h
@@ -96,6 +96,7 @@ public:
     virtual bool parsedStepValueShouldBeInteger() const;
     virtual bool scaledStepValeuShouldBeInteger() const;
     virtual double acceptableError(double) const;
+    virtual String typeMismatchText() const;
 
     // Miscellaneous functions
 
diff --git a/WebCore/html/URLInputType.cpp b/WebCore/html/URLInputType.cpp
index 517ffad..1b8f3da 100644
--- a/WebCore/html/URLInputType.cpp
+++ b/WebCore/html/URLInputType.cpp
@@ -32,6 +32,7 @@
 #include "URLInputType.h"
 
 #include "HTMLInputElement.h"
+#include "LocalizedStrings.h"
 #include "KURL.h"
 #include <wtf/PassOwnPtr.h>
 
@@ -57,4 +58,9 @@ bool URLInputType::typeMismatch() const
     return typeMismatchFor(element()->value());
 }
 
+String URLInputType::typeMismatchText() const
+{
+    return validationMessageTypeMismatchForURLText();
+}
+
 } // namespace WebCore
diff --git a/WebCore/html/URLInputType.h b/WebCore/html/URLInputType.h
index 82ab1b7..4a6522c 100644
--- a/WebCore/html/URLInputType.h
+++ b/WebCore/html/URLInputType.h
@@ -44,6 +44,7 @@ private:
     virtual const AtomicString& formControlType() const;
     virtual bool typeMismatchFor(const String&) const;
     virtual bool typeMismatch() const;
+    virtual String typeMismatchText() const;
 };
 
 } // namespace WebCore
diff --git a/WebCore/html/ValidityState.cpp b/WebCore/html/ValidityState.cpp
index 57fb438..84fc664 100644
--- a/WebCore/html/ValidityState.cpp
+++ b/WebCore/html/ValidityState.cpp
@@ -44,18 +44,45 @@ String ValidityState::validationMessage() const
         return m_customErrorMessage;
     if (valueMissing())
         return validationMessageValueMissingText();
-    if (typeMismatch())
-        return validationMessageTypeMismatchText();
     if (patternMismatch())
         return validationMessagePatternMismatchText();
-    if (tooLong())
-        return validationMessageTooLongText();
-    if (rangeUnderflow())
-        return validationMessageRangeUnderflowText();
-    if (rangeOverflow())
-        return validationMessageRangeOverflowText();
-    if (stepMismatch())
-        return validationMessageStepMismatchText();
+    bool isInputElement = m_control->hasTagName(inputTag);
+    bool isTextAreaElement = m_control->hasTagName(textareaTag);
+    if (typeMismatch()) {
+        if (isInputElement)
+            return static_cast<HTMLInputElement*>(m_control)->typeMismatchText();
+        return validationMessageTypeMismatchText();
+    }
+    if (tooLong()) {
+        if (!isInputElement && !isTextAreaElement) {
+            ASSERT_NOT_REACHED();
+            return String();
+        }
+        HTMLTextFormControlElement* text = static_cast<HTMLTextFormControlElement*>(m_control);
+        return validationMessageTooLongText(numGraphemeClusters(text->value()), text->maxLength());
+    }
+    if (rangeUnderflow()) {
+        if (!isInputElement) {
+            ASSERT_NOT_REACHED();
+            return String();
+        }
+        return validationMessageRangeUnderflowText(static_cast<HTMLInputElement*>(m_control)->minimumString());
+    }
+    if (rangeOverflow()) {
+        if (!isInputElement) {
+            ASSERT_NOT_REACHED();
+            return String();
+        }
+        return validationMessageRangeOverflowText(static_cast<HTMLInputElement*>(m_control)->maximumString());
+    }
+    if (stepMismatch()) {
+        if (!isInputElement) {
+            ASSERT_NOT_REACHED();
+            return String();
+        }
+        HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control);
+        return validationMessageStepMismatchText(input->stepBaseString(), input->stepString());
+    }
 
     return String();
 }
diff --git a/WebCore/platform/LocalizedStrings.cpp b/WebCore/platform/LocalizedStrings.cpp
index 012d90e..021205a 100644
--- a/WebCore/platform/LocalizedStrings.cpp
+++ b/WebCore/platform/LocalizedStrings.cpp
@@ -590,27 +590,42 @@ String validationMessageTypeMismatchText()
     return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     return platformStrategies()->localizationStrategy()->validationMessagePatternMismatchText();
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     return platformStrategies()->localizationStrategy()->validationMessageTooLongText();
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     return platformStrategies()->localizationStrategy()->validationMessageRangeUnderflowText();
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     return platformStrategies()->localizationStrategy()->validationMessageRangeOverflowText();
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     return platformStrategies()->localizationStrategy()->validationMessageStepMismatchText();
 }
diff --git a/WebCore/platform/LocalizedStrings.h b/WebCore/platform/LocalizedStrings.h
index a72eb8a..d332e45 100644
--- a/WebCore/platform/LocalizedStrings.h
+++ b/WebCore/platform/LocalizedStrings.h
@@ -167,11 +167,14 @@ namespace WebCore {
 
     String validationMessageValueMissingText();
     String validationMessageTypeMismatchText();
+    String validationMessageTypeMismatchForEmailText();
+    String validationMessageTypeMismatchForMultipleEmailText();
+    String validationMessageTypeMismatchForURLText();
     String validationMessagePatternMismatchText();
-    String validationMessageTooLongText();
-    String validationMessageRangeUnderflowText();
-    String validationMessageRangeOverflowText();
-    String validationMessageStepMismatchText();
+    String validationMessageTooLongText(int valueLength, int maxLength);
+    String validationMessageRangeUnderflowText(const String& minimum);
+    String validationMessageRangeOverflowText(const String& maximum);
+    String validationMessageStepMismatchText(const String& base, const String& step);
 
 }
 
diff --git a/WebCore/platform/android/LocalizedStringsAndroid.cpp b/WebCore/platform/android/LocalizedStringsAndroid.cpp
index fa4f86a..9278ad8 100644
--- a/WebCore/platform/android/LocalizedStringsAndroid.cpp
+++ b/WebCore/platform/android/LocalizedStringsAndroid.cpp
@@ -391,31 +391,49 @@ String validationMessageTypeMismatchText()
     return String();
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     notImplemented();
     return String();
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     notImplemented();
     return String();
diff --git a/WebCore/platform/brew/LocalizedStringsBrew.cpp b/WebCore/platform/brew/LocalizedStringsBrew.cpp
index 7c6c564..b044623 100644
--- a/WebCore/platform/brew/LocalizedStringsBrew.cpp
+++ b/WebCore/platform/brew/LocalizedStringsBrew.cpp
@@ -408,31 +408,49 @@ String validationMessageTypeMismatchText()
     return String();
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     notImplemented();
     return String();
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     notImplemented();
     return String();
diff --git a/WebCore/platform/efl/LocalizedStringsEfl.cpp b/WebCore/platform/efl/LocalizedStringsEfl.cpp
index a81434f..2935983 100644
--- a/WebCore/platform/efl/LocalizedStringsEfl.cpp
+++ b/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -435,22 +435,22 @@ String validationMessagePatternMismatchText()
     return String::fromUTF8("pattern mismatch");
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     return String::fromUTF8("range overflow");
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     return String::fromUTF8("range underflow");
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     return String::fromUTF8("step mismatch");
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     return String::fromUTF8("too long");
 }
@@ -460,6 +460,21 @@ String validationMessageTypeMismatchText()
     return String::fromUTF8("type mismatch");
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    return String::fromUTF8("type mismatch");
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    return String::fromUTF8("type mismatch");
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    return String::fromUTF8("type mismatch");
+}
+
 String validationMessageValueMissingText()
 {
     return String::fromUTF8("value missing");
diff --git a/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index 7851326..68c1598 100644
--- a/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -559,27 +559,45 @@ String validationMessageTypeMismatchText()
     return String::fromUTF8(_("type mismatch"));
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     return String::fromUTF8(_("pattern mismatch"));
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     return String::fromUTF8(_("too long"));
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     return String::fromUTF8(_("range underflow"));
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     return String::fromUTF8(_("range overflow"));
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     return String::fromUTF8(_("step mismatch"));
 }
diff --git a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp b/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
index 4c12cf3..e5ca001 100644
--- a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
+++ b/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
@@ -415,31 +415,49 @@ String validationMessageTypeMismatchText()
     return String();
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     notImplemented();
     return String();
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     notImplemented();
     return String();
diff --git a/WebCore/platform/wx/LocalizedStringsWx.cpp b/WebCore/platform/wx/LocalizedStringsWx.cpp
index 10ea435..1b46643 100644
--- a/WebCore/platform/wx/LocalizedStringsWx.cpp
+++ b/WebCore/platform/wx/LocalizedStringsWx.cpp
@@ -396,31 +396,49 @@ String validationMessageTypeMismatchText()
     return String();
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    notImplemented();
+    return validationMessageTypeMismatchText();
+}
+
 String validationMessagePatternMismatchText()
 {
     notImplemented();
     return String();
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
     notImplemented();
     return String();
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
     notImplemented();
     return String();
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index c70f8fd..242620b 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-14  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Improve API for form validation message strings
+        https://bugs.webkit.org/show_bug.cgi?id=34945
+
+        * public/WebLocalizedString.h:
+        * src/LocalizedStrings.cpp:
+        (WebCore::validationMessageTypeMismatchForEmailText):
+        (WebCore::validationMessageTypeMismatchForMultipleEmailText):
+        (WebCore::validationMessageTypeMismatchForURLText):
+        (WebCore::validationMessageTooLongText):
+        (WebCore::validationMessageRangeUnderflowText):
+        (WebCore::validationMessageRangeOverflowText):
+        (WebCore::validationMessageStepMismatchText):
+
 2010-11-13  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Kent Tamura.
diff --git a/WebKit/chromium/public/WebLocalizedString.h b/WebKit/chromium/public/WebLocalizedString.h
index bb45b6e..8ab5f8d 100644
--- a/WebKit/chromium/public/WebLocalizedString.h
+++ b/WebKit/chromium/public/WebLocalizedString.h
@@ -60,6 +60,9 @@ struct WebLocalizedString {
         KeygenMenuMediumGradeKeySize,
         ValidationValueMissing,
         ValidationTypeMismatch,
+        ValidationTypeMismatchForEmail,
+        ValidationTypeMismatchForMultipleEmail,
+        ValidationTypeMismatchForURL,
         ValidationPatternMismatch,
         ValidationTooLong,
         ValidationRangeUnderflow,
diff --git a/WebKit/chromium/src/LocalizedStrings.cpp b/WebKit/chromium/src/LocalizedStrings.cpp
index 614aac3..947e732 100644
--- a/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/WebKit/chromium/src/LocalizedStrings.cpp
@@ -304,28 +304,47 @@ String validationMessageTypeMismatchText()
     return query(WebLocalizedString::ValidationTypeMismatch);
 }
 
+String validationMessageTypeMismatchForEmailText()
+{
+    return query(WebLocalizedString::ValidationTypeMismatchForEmail);
+}
+
+String validationMessageTypeMismatchForMultipleEmailText()
+{
+    return query(WebLocalizedString::ValidationTypeMismatchForMultipleEmail);
+}
+
+String validationMessageTypeMismatchForURLText()
+{
+    return query(WebLocalizedString::ValidationTypeMismatchForURL);
+}
+
 String validationMessagePatternMismatchText()
 {
     return query(WebLocalizedString::ValidationPatternMismatch);
 }
 
-String validationMessageTooLongText()
+String validationMessageTooLongText(int, int)
 {
+    // FIXME: pass the arguments.
     return query(WebLocalizedString::ValidationTooLong);
 }
 
-String validationMessageRangeUnderflowText()
+String validationMessageRangeUnderflowText(const String&)
 {
+    // FIXME: pass the arguments.
     return query(WebLocalizedString::ValidationRangeUnderflow);
 }
 
-String validationMessageRangeOverflowText()
+String validationMessageRangeOverflowText(const String&)
 {
+    // FIXME: pass the arguments.
     return query(WebLocalizedString::ValidationRangeOverflow);
 }
 
-String validationMessageStepMismatchText()
+String validationMessageStepMismatchText(const String&, const String&)
 {
+    // FIXME: pass the arguments.
     return query(WebLocalizedString::ValidationStepMismatch);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list