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

darin at apple.com darin at apple.com
Wed Dec 22 13:35:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b587510f5e5f2f2f1c841d6c9f13e68c14ae93e4
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 01:06:08 2010 +0000

    2010-09-20  Kenneth Russell  <kbr at google.com>
    
            Reviewed by James Robinson.
    
            [chromium] Change compositor to use GraphicsContext3D rather than GLES2Context
            https://bugs.webkit.org/show_bug.cgi?id=45912
    
            Switched Chromium's compositor to use GraphicsContext3D to issue
            its OpenGL rendering calls rather than the Chromium-specific
            GLES2Context and command buffer OpenGL implementation.
    
            The in-process software rendering path for GraphicsContext3D does
            not yet work with the compositor, at least not on Mac OS X. This
            will be worked on in subsequent bugs.
    
            Tested manually with 3D CSS, WebGL and video content on Mac OS X
            and Linux. No new tests.
    
            * src/GraphicsContext3D.cpp:
            (WebCore::GraphicsContext3DInternal::initialize):
            (WebCore::GraphicsContext3DInternal::extractWebGraphicsContext3D):
            (WebCore::GraphicsContext3D::create):
            * src/GraphicsContext3DInternal.h:
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::resize):
            (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
            (WebKit::WebViewImpl::gles2Context):
            (WebKit::WebViewImpl::graphicsContext3D):
            * src/WebViewImpl.h:
    2010-09-20  Mihai Parparita  <mihaip at chromium.org>
    
            Unreviewed; an attempt to fix Windows build.
    
            * WebCore.vcproj/WebCore.vcproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d204fcf..0bc347b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1256,6 +1256,90 @@
 
 2010-09-17  Darin Adler  <darin at apple.com>
 
+        Reviewed by James Robinson.
+
+        Deprecate the inputType function on HTMLInputElement
+        https://bugs.webkit.org/show_bug.cgi?id=46023
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::HTMLInputElement): Use m_deprecatedTypeNumber.
+        (WebCore::HTMLInputElement::isValidValue): Use deprecatedInputType.
+        (WebCore::HTMLInputElement::typeMismatch): Ditto.
+        (WebCore::HTMLInputElement::valueMissing): Ditto.
+        (WebCore::HTMLInputElement::rangeUnderflow): Ditto.
+        (WebCore::HTMLInputElement::rangeOverflow): Ditto.
+        (WebCore::HTMLInputElement::minimum): Ditto.
+        (WebCore::HTMLInputElement::maximum): Ditto.
+        (WebCore::HTMLInputElement::stepBase): Ditto.
+        (WebCore::HTMLInputElement::stepMismatch): Ditto.
+        (WebCore::HTMLInputElement::getStepParameters): Ditto.
+        (WebCore::HTMLInputElement::getAllowedValueStep): Ditto.
+        (WebCore::HTMLInputElement::isKeyboardFocusable): Ditto.
+        (WebCore::HTMLInputElement::shouldUseInputMethod): Ditto.
+        (WebCore::HTMLInputElement::handleBlurEvent): Ditto.
+        (WebCore::HTMLInputElement::setType): Added a comment.
+        (WebCore::HTMLInputElement::updateType): Replaced the setInputType function
+        with this. The type is always the type attribute value, so there is no value
+        in passing the type string in, and this is an internal implementation detail,
+        not a public function.
+        (WebCore::createFormControlTypes): Use deprecatedNumberOfTypes.
+        (WebCore::HTMLInputElement::formControlType): Use deprecatedInputType.
+        (WebCore::HTMLInputElement::saveFormControlState): Ditto.
+        (WebCore::HTMLInputElement::restoreFormControlState): Ditto.
+        (WebCore::HTMLInputElement::accessKeyAction): Ditto.
+        (WebCore::HTMLInputElement::mapToEntry): Ditto.
+        (WebCore::HTMLInputElement::parseMappedAttribute): Ditto.
+        (WebCore::HTMLInputElement::rendererIsNeeded): Ditto.
+        (WebCore::HTMLInputElement::createRenderer): Ditto.
+        (WebCore::HTMLInputElement::attach): Ditto.
+        (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Ditto.
+        (WebCore::HTMLInputElement::appendFormData): Ditto.
+        (WebCore::HTMLInputElement::isTextField): Ditto.
+        (WebCore::HTMLInputElement::isTextType): Ditto.
+        (WebCore::HTMLInputElement::setChecked): Ditto.
+        (WebCore::HTMLInputElement::value): Ditto.
+        (WebCore::HTMLInputElement::valueWithDefault): Ditto.
+        (WebCore::HTMLInputElement::setSuggestedValue): Ditto.
+        (WebCore::HTMLInputElement::setValue): Ditto.
+        (WebCore::HTMLInputElement::parseToDouble): Ditto.
+        (WebCore::HTMLInputElement::valueAsDate): Ditto.
+        (WebCore::HTMLInputElement::setValueAsDate): Ditto.
+        (WebCore::HTMLInputElement::valueAsNumber): Ditto.
+        (WebCore::HTMLInputElement::setValueAsNumber): Ditto.
+        (WebCore::HTMLInputElement::serializeForDateTimeTypes): Ditto.
+        (WebCore::HTMLInputElement::serialize): Ditto.
+        (WebCore::HTMLInputElement::setValueFromRenderer): Ditto.
+        (WebCore::HTMLInputElement::storesValueSeparateFromAttribute): Ditto.
+        (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
+        (WebCore::HTMLInputElement::postDispatchEventHandler): Ditto.
+        (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
+        (WebCore::HTMLInputElement::handleBeforeTextInsertedEvent): Ditto.
+        (WebCore::HTMLInputElement::files): Ditto.
+        (WebCore::HTMLInputElement::isAcceptableValue): Ditto.
+        (WebCore::HTMLInputElement::sanitizeValue): Ditto.
+        (WebCore::HTMLInputElement::hasUnacceptableValue): Ditto.
+        (WebCore::HTMLInputElement::needsActivationCallback): Ditto.
+        (WebCore::HTMLInputElement::isRequiredFormControl): Ditto.
+        (WebCore::HTMLInputElement::recalcWillValidate): Ditto.
+        (WebCore::HTMLInputElement::parseToDateComponents): Ditto.
+        (WebCore::HTMLInputElement::dataList): Ditto.
+        (WebCore::HTMLInputElement::isSpeechEnabled): Ditto.
+
+        * html/HTMLInputElement.h: Renamed InputType to DeprecatedInputType since it
+        should not be used outside this class. Renamed numberOfTypes to
+        dprecatedNumberOfTypes for the same reason. Changed all code to use
+        deprecatedInputType function instead of m_type. Renamed inputType function
+        to deprecatedInputType. Replaced public setInputType function with private
+        updateType function. Renamed m_type data member to m_deprecatedTypeNumber.
+
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlInputElement::MediaControlInputElement):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::updateFromElement):
+        Use setType instead of setInputType.
+
+2010-09-17  Darin Adler  <darin at apple.com>
+
         Build fix for platforms that compile Touch.
 
         * dom/Touch.cpp:
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 3c94e81..baff6c4 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -151,7 +151,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
     , m_xPos(0)
     , m_yPos(0)
     , m_maxResults(-1)
-    , m_type(TEXT)
+    , m_deprecatedTypeNumber(TEXT)
     , m_checked(false)
     , m_defaultChecked(false)
     , m_useDefaultChecked(true)
@@ -241,7 +241,7 @@ bool HTMLInputElement::isValidValue(const String& value) const
 {
     // Should not call isValidValue() for the following types because
     // we can't set string values for these types.
-    if (inputType() == CHECKBOX || inputType() == FILE || inputType() == RADIO) {
+    if (deprecatedInputType() == CHECKBOX || deprecatedInputType() == FILE || deprecatedInputType() == RADIO) {
         ASSERT_NOT_REACHED();
         return false;
     }
@@ -256,7 +256,7 @@ bool HTMLInputElement::isValidValue(const String& value) const
 
 bool HTMLInputElement::typeMismatch(const String& value) const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case COLOR:
         return !isValidColorString(value);
     case NUMBER:
@@ -281,7 +281,7 @@ bool HTMLInputElement::typeMismatch(const String& value) const
     case MONTH:
     case TIME:
     case WEEK:
-        return !parseToDateComponents(inputType(), value, 0);
+        return !parseToDateComponents(deprecatedInputType(), value, 0);
     case BUTTON:
     case CHECKBOX:
     case FILE:
@@ -307,7 +307,7 @@ bool HTMLInputElement::valueMissing(const String& value) const
     if (!isRequiredFormControl() || readOnly() || disabled())
         return false;
 
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -379,7 +379,7 @@ bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check)
 bool HTMLInputElement::rangeUnderflow(const String& value) const
 {
     const double nan = numeric_limits<double>::quiet_NaN();
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -416,7 +416,7 @@ bool HTMLInputElement::rangeUnderflow(const String& value) const
 bool HTMLInputElement::rangeOverflow(const String& value) const
 {
     const double nan = numeric_limits<double>::quiet_NaN();
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -452,7 +452,7 @@ bool HTMLInputElement::rangeOverflow(const String& value) const
 
 double HTMLInputElement::minimum() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
         return parseToDouble(getAttribute(minAttr), DateComponents::minimumDate());
     case DATETIME:
@@ -492,7 +492,7 @@ double HTMLInputElement::minimum() const
 
 double HTMLInputElement::maximum() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
         return parseToDouble(getAttribute(maxAttr), DateComponents::maximumDate());
     case DATETIME:
@@ -539,7 +539,7 @@ double HTMLInputElement::maximum() const
 
 double HTMLInputElement::stepBase() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case RANGE:
         return minimum();
     case DATE:
@@ -578,7 +578,7 @@ bool HTMLInputElement::stepMismatch(const String& value) const
     double step;
     if (!getAllowedValueStep(&step))
         return false;
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case RANGE:
         // stepMismatch doesn't occur for RANGE. RenderSlider guarantees the
         // value matches to step on user input, and sanitation takes care
@@ -643,7 +643,7 @@ bool HTMLInputElement::getStepParameters(double* defaultStep, double* stepScaleF
 {
     ASSERT(defaultStep);
     ASSERT(stepScaleFactor);
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case NUMBER:
     case RANGE:
         *defaultStep = numberDefaultStep;
@@ -712,11 +712,11 @@ bool HTMLInputElement::getAllowedValueStep(double* step) const
         return true;
     }
     // For DATE, MONTH, WEEK, the parsed value should be an integer.
-    if (inputType() == DATE || inputType() == MONTH || inputType() == WEEK)
+    if (deprecatedInputType() == DATE || deprecatedInputType() == MONTH || deprecatedInputType() == WEEK)
         parsed = max(round(parsed), 1.0);
     double result = parsed * stepScaleFactor;
     // For DATETIME, DATETIMELOCAL, TIME, the result should be an integer.
-    if (inputType() == DATETIME || inputType() == DATETIMELOCAL || inputType() == TIME)
+    if (deprecatedInputType() == DATETIME || deprecatedInputType() == DATETIMELOCAL || deprecatedInputType() == TIME)
         result = max(round(result), 1.0);
     ASSERT(result > 0);
     *step = result;
@@ -774,14 +774,14 @@ bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
     if (!HTMLFormControlElementWithState::isKeyboardFocusable(event))
         return false;
 
-    if (inputType() == RADIO) {
+    if (deprecatedInputType() == RADIO) {
 
         // Never allow keyboard tabbing to leave you in the same radio group.  Always
         // skip any other elements in the group.
         Node* currentFocusedNode = document()->focusedNode();
         if (currentFocusedNode && currentFocusedNode->hasTagName(inputTag)) {
             HTMLInputElement* focusedInput = static_cast<HTMLInputElement*>(currentFocusedNode);
-            if (focusedInput->inputType() == RADIO && focusedInput->form() == form() && focusedInput->name() == name())
+            if (focusedInput->deprecatedInputType() == RADIO && focusedInput->form() == form() && focusedInput->name() == name())
                 return false;
         }
         
@@ -818,7 +818,7 @@ bool HTMLInputElement::shouldUseInputMethod() const
     // can access the underlying password and display it in clear text --
     // e.g. you can use it to access the stored password for any site 
     // with only trivial effort.
-    return isTextField() && inputType() != PASSWORD;
+    return isTextField() && deprecatedInputType() != PASSWORD;
 }
 
 void HTMLInputElement::handleFocusEvent()
@@ -828,7 +828,7 @@ void HTMLInputElement::handleFocusEvent()
 
 void HTMLInputElement::handleBlurEvent()
 {
-    if (inputType() == NUMBER) {
+    if (deprecatedInputType() == NUMBER) {
         // Reset the renderer value, which might be unmatched with the element value.
         setFormControlValueMatchesRenderer(false);
         // We need to reset the renderer value explicitly because an unacceptable
@@ -841,6 +841,10 @@ void HTMLInputElement::handleBlurEvent()
 
 void HTMLInputElement::setType(const String& t)
 {
+    // FIXME: This should just call setAttribute. No reason to handle the empty string specially.
+    // We should write a test case to show that setting to the empty string does not remove the
+    // attribute in other browsers and then fix this. Note that setting to null *does* remove
+    // the attribute and setAttribute implements that.
     if (t.isEmpty()) {
         int exccode;
         removeAttribute(typeAttr, exccode);
@@ -848,7 +852,7 @@ void HTMLInputElement::setType(const String& t)
         setAttribute(typeAttr, t);
 }
 
-typedef HashMap<String, HTMLInputElement::InputType, CaseFoldingHash> InputTypeMap;
+typedef HashMap<String, HTMLInputElement::DeprecatedInputType, CaseFoldingHash> InputTypeMap;
 static PassOwnPtr<InputTypeMap> createTypeMap()
 {
     OwnPtr<InputTypeMap> map = adoptPtr(new InputTypeMap);
@@ -879,15 +883,16 @@ static PassOwnPtr<InputTypeMap> createTypeMap()
     return map.release();
 }
 
-void HTMLInputElement::setInputType(const String& t)
+void HTMLInputElement::updateType()
 {
     static const InputTypeMap* typeMap = createTypeMap().leakPtr();
-    InputType newType = t.isNull() ? TEXT : typeMap->get(t);
+    const AtomicString& typeString = fastGetAttribute(typeAttr);
+    DeprecatedInputType newType = typeString.isEmpty() ? TEXT : typeMap->get(typeString);
 
     // IMPORTANT: Don't allow the type to be changed to FILE after the first
     // type change, otherwise a JavaScript programmer would be able to set a text
     // field's value to something like /etc/passwd and then change it to a file field.
-    if (inputType() != newType) {
+    if (deprecatedInputType() != newType) {
         if (newType == FILE && m_haveType)
             // Set the attribute back to the old value.
             // Useful in case we were called from inside parseMappedAttribute.
@@ -903,12 +908,12 @@ void HTMLInputElement::setInputType(const String& t)
                 detach();
 
             bool didStoreValue = storesValueSeparateFromAttribute();
-            bool wasPasswordField = inputType() == PASSWORD;
+            bool wasPasswordField = deprecatedInputType() == PASSWORD;
             bool didRespectHeightAndWidth = respectHeightAndWidthAttrs();
-            m_type = newType;
+            m_deprecatedTypeNumber = newType;
             setNeedsWillValidateCheck();
             bool willStoreValue = storesValueSeparateFromAttribute();
-            bool isPasswordField = inputType() == PASSWORD;
+            bool isPasswordField = deprecatedInputType() == PASSWORD;
             bool willRespectHeightAndWidth = respectHeightAndWidthAttrs();
 
             if (didStoreValue && !willStoreValue && !m_data.value().isNull()) {
@@ -950,13 +955,13 @@ void HTMLInputElement::setInputType(const String& t)
     }
     m_haveType = true;
 
-    if (inputType() != IMAGE && m_imageLoader)
+    if (deprecatedInputType() != IMAGE && m_imageLoader)
         m_imageLoader.clear();
 }
 
 static const AtomicString* createFormControlTypes()
 {
-    AtomicString* types = new AtomicString[HTMLInputElement::numberOfTypes];
+    AtomicString* types = new AtomicString[HTMLInputElement::deprecatedNumberOfTypes];
     // The values must be lowercased because they will be the return values of
     //  input.type and it must be lowercase according to DOM Level 2.
     types[HTMLInputElement::BUTTON] = "button";
@@ -989,12 +994,12 @@ static const AtomicString* createFormControlTypes()
 const AtomicString& HTMLInputElement::formControlType() const
 {
     static const AtomicString* formControlTypes = createFormControlTypes();
-    return formControlTypes[inputType()];
+    return formControlTypes[deprecatedInputType()];
 }
 
 bool HTMLInputElement::saveFormControlState(String& result) const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case BUTTON:
     case COLOR:
     case DATE:
@@ -1035,8 +1040,8 @@ bool HTMLInputElement::saveFormControlState(String& result) const
 
 void HTMLInputElement::restoreFormControlState(const String& state)
 {
-    ASSERT(inputType() != PASSWORD); // should never save/restore password fields
-    switch (inputType()) {
+    ASSERT(deprecatedInputType() != PASSWORD); // should never save/restore password fields
+    switch (deprecatedInputType()) {
     case BUTTON:
     case COLOR:
     case DATE:
@@ -1083,7 +1088,7 @@ bool HTMLInputElement::canHaveSelection() const
 
 void HTMLInputElement::accessKeyAction(bool sendToAnyElement)
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case BUTTON:
     case CHECKBOX:
     case FILE:
@@ -1130,7 +1135,7 @@ bool HTMLInputElement::mapToEntry(const QualifiedName& attrName, MappedAttribute
     } 
 
     if (attrName == alignAttr) {
-        if (inputType() == IMAGE) {
+        if (deprecatedInputType() == IMAGE) {
             // Share with <img> since the alignment behavior is the same.
             result = eReplaced;
             return false;
@@ -1163,7 +1168,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
                 unregisterForActivationCallbackIfNeeded();
         }
     } else if (attr->name() == typeAttr) {
-        setInputType(attr->value());
+        updateType();
     } else if (attr->name() == valueAttr) {
         // We only need to setChanged if the form is looking at the default value right now.
         if (m_data.value().isNull())
@@ -1183,10 +1188,10 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
     } else if (attr->name() == sizeAttr)
         InputElement::parseSizeAttribute(m_data, this, attr);
     else if (attr->name() == altAttr) {
-        if (renderer() && inputType() == IMAGE)
+        if (renderer() && deprecatedInputType() == IMAGE)
             toRenderImage(renderer())->updateAltText();
     } else if (attr->name() == srcAttr) {
-        if (renderer() && inputType() == IMAGE) {
+        if (renderer() && deprecatedInputType() == IMAGE) {
             if (!m_imageLoader)
                 m_imageLoader = adoptPtr(new HTMLImageLoader(this));
             m_imageLoader->updateFromElementIgnoringPreviousError();
@@ -1200,7 +1205,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
         addCSSLength(attr, CSSPropertyMarginLeft, attr->value());
         addCSSLength(attr, CSSPropertyMarginRight, attr->value());
     } else if (attr->name() == alignAttr) {
-        if (inputType() == IMAGE)
+        if (deprecatedInputType() == IMAGE)
             addHTMLAlignment(attr);
     } else if (attr->name() == widthAttr) {
         if (respectHeightAndWidthAttrs())
@@ -1226,7 +1231,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
         setNeedsStyleRecalc();
     else if (attr->name() == minAttr
              || attr->name() == maxAttr) {
-        if (inputType() == RANGE) {
+        if (deprecatedInputType() == RANGE) {
             // Sanitize the value.
             setValue(value());
             setNeedsStyleRecalc();
@@ -1255,14 +1260,14 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
 
 bool HTMLInputElement::rendererIsNeeded(RenderStyle *style)
 {
-    if (inputType() == HIDDEN)
+    if (deprecatedInputType() == HIDDEN)
         return false;
     return HTMLFormControlElementWithState::rendererIsNeeded(style);
 }
 
 RenderObject* HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle *style)
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case BUTTON:
     case RESET:
     case SUBMIT:
@@ -1306,13 +1311,13 @@ void HTMLInputElement::attach()
 {
     if (!m_inited) {
         if (!m_haveType)
-            setInputType(getAttribute(typeAttr));
+            updateType();
         m_inited = true;
     }
 
     HTMLFormControlElementWithState::attach();
 
-    if (inputType() == IMAGE) {
+    if (deprecatedInputType() == IMAGE) {
         if (!m_imageLoader)
             m_imageLoader = adoptPtr(new HTMLImageLoader(this));
         m_imageLoader->updateFromElement();
@@ -1328,7 +1333,7 @@ void HTMLInputElement::attach()
         }
     }
 
-    if (inputType() == RADIO)
+    if (deprecatedInputType() == RADIO)
         updateCheckedRadioButtons();
 
     if (document()->focusedNode() == this)
@@ -1361,7 +1366,7 @@ bool HTMLInputElement::isSuccessfulSubmitButton() const
 {
     // HTML spec says that buttons must have names to be considered successful.
     // However, other browsers do not impose this constraint. So we do likewise.
-    return !disabled() && (inputType() == IMAGE || inputType() == SUBMIT);
+    return !disabled() && (deprecatedInputType() == IMAGE || deprecatedInputType() == SUBMIT);
 }
 
 bool HTMLInputElement::isActivatedSubmit() const
@@ -1377,10 +1382,10 @@ void HTMLInputElement::setActivatedSubmit(bool flag)
 bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
 {
     // image generates its own names, but for other types there is no form data unless there's a name
-    if (name().isEmpty() && inputType() != IMAGE)
+    if (name().isEmpty() && deprecatedInputType() != IMAGE)
         return false;
 
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case COLOR:
     case DATE:
     case DATETIME:
@@ -1476,7 +1481,7 @@ void HTMLInputElement::reset()
 
 bool HTMLInputElement::isTextField() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case COLOR:
     case DATE:
     case DATETIME:
@@ -1510,7 +1515,7 @@ bool HTMLInputElement::isTextField() const
 
 bool HTMLInputElement::isTextType() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case EMAIL:
     case PASSWORD:
     case SEARCH:
@@ -1566,7 +1571,7 @@ void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
     // unchecked to match other browsers. DOM is not a useful standard for this
     // because it says only to fire change events at "lose focus" time, which is
     // definitely wrong in practice for these types of elements.
-    if (sendChangeEvent && inDocument() && (inputType() != RADIO || nowChecked))
+    if (sendChangeEvent && inDocument() && (deprecatedInputType() != RADIO || nowChecked))
         dispatchFormControlChangeEvent();
 }
 
@@ -1604,7 +1609,7 @@ void HTMLInputElement::copyNonAttributeProperties(const Element* source)
 
 String HTMLInputElement::value() const
 {
-    if (inputType() == FILE) {
+    if (deprecatedInputType() == FILE) {
         if (!m_fileList->isEmpty()) {
             // HTML5 tells us that we're supposed to use this goofy value for
             // file input controls.  Historically, browsers reveals the real
@@ -1625,9 +1630,9 @@ String HTMLInputElement::value() const
         // For Checkbox Types just use "on" or "" based off the checked() state of the control.
         // For a Range Input use the calculated default value.
         if (value.isNull()) {
-            if (inputType() == CHECKBOX || inputType() == RADIO)
+            if (deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO)
                 return checked() ? "on" : "";
-            if (inputType() == RANGE)
+            if (deprecatedInputType() == RANGE)
                 return serializeForNumberType(StepRange(this).defaultValue());
         }
     }
@@ -1639,7 +1644,7 @@ String HTMLInputElement::valueWithDefault() const
 {
     String v = value();
     if (v.isNull()) {
-        switch (inputType()) {
+        switch (deprecatedInputType()) {
         case BUTTON:
         case CHECKBOX:
         case COLOR:
@@ -1687,7 +1692,7 @@ const String& HTMLInputElement::suggestedValue() const
 
 void HTMLInputElement::setSuggestedValue(const String& value)
 {
-    if (inputType() != TEXT)
+    if (deprecatedInputType() != TEXT)
         return;
     setFormControlValueMatchesRenderer(false);
     m_data.setSuggestedValue(sanitizeValue(value));
@@ -1702,12 +1707,12 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
     // For security reasons, we don't allow setting the filename, but we do allow clearing it.
     // The HTML5 spec (as of the 10/24/08 working draft) says that the value attribute isn't applicable to the file upload control
     // but we don't want to break existing websites, who may be relying on this method to clear things.
-    if (inputType() == FILE && !value.isEmpty())
+    if (deprecatedInputType() == FILE && !value.isEmpty())
         return;
 
     setFormControlValueMatchesRenderer(false);
     if (storesValueSeparateFromAttribute()) {
-        if (inputType() == FILE)
+        if (deprecatedInputType() == FILE)
             m_fileList->clear();
         else {
             m_data.setValue(sanitizeValue(value));
@@ -1739,14 +1744,14 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent)
 
 double HTMLInputElement::parseToDouble(const String& src, double defaultValue) const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
     case TIME:
     case WEEK: {
         DateComponents date;
-        if (!parseToDateComponents(inputType(), src, &date))
+        if (!parseToDateComponents(deprecatedInputType(), src, &date))
             return defaultValue;
         double msec = date.millisecondsSinceEpoch();
         ASSERT(isfinite(msec));
@@ -1754,7 +1759,7 @@ double HTMLInputElement::parseToDouble(const String& src, double defaultValue) c
     }
     case MONTH: {
         DateComponents date;
-        if (!parseToDateComponents(inputType(), src, &date))
+        if (!parseToDateComponents(deprecatedInputType(), src, &date))
             return defaultValue;
         double months = date.monthsSinceEpoch();
         ASSERT(isfinite(months));
@@ -1793,7 +1798,7 @@ double HTMLInputElement::parseToDouble(const String& src, double defaultValue) c
 
 double HTMLInputElement::valueAsDate() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case TIME:
@@ -1801,7 +1806,7 @@ double HTMLInputElement::valueAsDate() const
         return parseToDouble(value(), DateComponents::invalidMilliseconds());
     case MONTH: {
         DateComponents date;
-        if (!parseToDateComponents(inputType(), value(), &date))
+        if (!parseToDateComponents(deprecatedInputType(), value(), &date))
             return DateComponents::invalidMilliseconds();
         double msec = date.millisecondsSinceEpoch();
         ASSERT(isfinite(msec));
@@ -1835,7 +1840,7 @@ double HTMLInputElement::valueAsDate() const
 
 void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec)
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case TIME:
@@ -1879,7 +1884,7 @@ void HTMLInputElement::setValueAsDate(double value, ExceptionCode& ec)
 double HTMLInputElement::valueAsNumber() const
 {
     const double nan = numeric_limits<double>::quiet_NaN();
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -1918,7 +1923,7 @@ void HTMLInputElement::setValueAsNumber(double newValue, ExceptionCode& ec)
         ec = NOT_SUPPORTED_ERR;
         return;
     }
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -1956,7 +1961,7 @@ String HTMLInputElement::serializeForDateTimeTypes(double value) const
 {
     bool success = false;
     DateComponents date;
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
         success = date.setMillisecondsSinceEpochForDate(value);
         break;
@@ -2013,7 +2018,7 @@ String HTMLInputElement::serialize(double value) const
 {
     if (!isfinite(value))
         return String();
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case DATE:
     case DATETIME:
     case DATETIMELOCAL:
@@ -2065,7 +2070,7 @@ bool HTMLInputElement::searchEventsShouldBeDispatched() const
 void HTMLInputElement::setValueFromRenderer(const String& value)
 {
     // File upload controls will always use setFileListFromRenderer.
-    ASSERT(inputType() != FILE);
+    ASSERT(deprecatedInputType() != FILE);
     m_data.setSuggestedValue(String());
     updatePlaceholderVisibility(false);
     InputElement::setValueFromRenderer(m_data, this, this, value);
@@ -2114,7 +2119,7 @@ void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
 
 bool HTMLInputElement::storesValueSeparateFromAttribute() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case BUTTON:
     case CHECKBOX:
     case HIDDEN:
@@ -2160,9 +2165,9 @@ void* HTMLInputElement::preDispatchEventHandler(Event* evt)
     // preventDefault or "return false" are used to reverse the automatic checking/selection we do here.
     // This result gives us enough info to perform the "undo" in postDispatch of the action we take here.
     void* result = 0; 
-    if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->type() == eventNames().clickEvent) {
+    if ((deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO) && evt->type() == eventNames().clickEvent) {
         OwnPtr<EventHandlingState> state = adoptPtr(new EventHandlingState(indeterminate(), checked()));
-        if (inputType() == CHECKBOX) {
+        if (deprecatedInputType() == CHECKBOX) {
             if (indeterminate())
                 setIndeterminate(false);
             else
@@ -2189,10 +2194,10 @@ void* HTMLInputElement::preDispatchEventHandler(Event* evt)
 
 void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
 {
-    if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->type() == eventNames().clickEvent) {
+    if ((deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO) && evt->type() == eventNames().clickEvent) {
         
         if (EventHandlingState* state = reinterpret_cast<EventHandlingState*>(data)) {
-            if (inputType() == CHECKBOX) {
+            if (deprecatedInputType() == CHECKBOX) {
                 // Reverse the checking we did in preDispatch.
                 if (evt->defaultPrevented() || evt->defaultHandled()) {
                     setIndeterminate(state->m_indeterminate);
@@ -2205,7 +2210,7 @@ void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
                     // Make sure it is still a radio button and only do the restoration if it still
                     // belongs to our group.
 
-                    if (input && input->form() == form() && input->inputType() == RADIO && input->name() == name()) {
+                    if (input && input->form() == form() && input->deprecatedInputType() == RADIO && input->name() == name()) {
                         // Ok, the old radio button is still in our form and in our group and is still a 
                         // radio button, so it's safe to restore selection to it.
                         input->setChecked(true);
@@ -2231,7 +2236,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
     if (isTextField() && evt->type() == eventNames().textInputEvent && evt->isTextEvent() && static_cast<TextEvent*>(evt)->data() == "\n")
         implicitSubmission = true;
 
-    if (inputType() == IMAGE && evt->isMouseEvent() && evt->type() == eventNames().clickEvent) {
+    if (deprecatedInputType() == IMAGE && evt->isMouseEvent() && evt->type() == eventNames().clickEvent) {
         // record the mouse position for when we get the DOMActivate event
         MouseEvent* me = static_cast<MouseEvent*>(evt);
         // FIXME: We could just call offsetX() and offsetY() on the event,
@@ -2272,7 +2277,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         return;
     }
 
-    if (inputType() == RADIO && evt->type() == eventNames().clickEvent) {
+    if (deprecatedInputType() == RADIO && evt->type() == eventNames().clickEvent) {
         evt->setDefaultHandled();
         return;
     }
@@ -2292,10 +2297,10 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
     // on the element, or presses enter while it is the active element. JavaScript code wishing to activate the element
     // must dispatch a DOMActivate event - a click event will not do the job.
     if (evt->type() == eventNames().DOMActivateEvent && !disabled()) {
-        if (inputType() == IMAGE || inputType() == SUBMIT || inputType() == RESET) {
+        if (deprecatedInputType() == IMAGE || deprecatedInputType() == SUBMIT || deprecatedInputType() == RESET) {
             if (!form())
                 return;
-            if (inputType() == RESET)
+            if (deprecatedInputType() == RESET)
                 form()->reset();
             else {
                 m_activeSubmit = true;
@@ -2309,7 +2314,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
                 }
                 m_activeSubmit = false;
             }
-        } else if (inputType() == FILE && renderer())
+        } else if (deprecatedInputType() == FILE && renderer())
             toRenderFileUploadControl(renderer())->click();
     }
 
@@ -2321,7 +2326,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         int charCode = static_cast<KeyboardEvent*>(evt)->charCode();
 
         if (charCode == '\r') {
-            switch (inputType()) {
+            switch (deprecatedInputType()) {
             case CHECKBOX:
             case COLOR:
             case DATE:
@@ -2354,7 +2359,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
                 break;
             }
         } else if (charCode == ' ') {
-            switch (inputType()) {
+            switch (deprecatedInputType()) {
             case BUTTON:
             case CHECKBOX:
             case FILE:
@@ -2381,7 +2386,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
 
         if (key == "U+0020") {
-            switch (inputType()) {
+            switch (deprecatedInputType()) {
             case BUTTON:
             case CHECKBOX:
             case FILE:
@@ -2398,7 +2403,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
             }
         }
 
-        if (inputType() == RADIO && (key == "Up" || key == "Down" || key == "Left" || key == "Right")) {
+        if (deprecatedInputType() == RADIO && (key == "Up" || key == "Down" || key == "Left" || key == "Right")) {
             // Left and up mean "previous radio button".
             // Right and down mean "next radio button".
             // Tested in WinIE, and even for RTL, left still means previous radio button (and so moves
@@ -2420,7 +2425,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
                         break;
                     if (n->hasTagName(inputTag)) {
                         HTMLInputElement* inputElt = static_cast<HTMLInputElement*>(n);
-                        if (inputElt->inputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) {
+                        if (inputElt->deprecatedInputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) {
                             inputElt->setChecked(true);
                             document()->setFocusedNode(inputElt);
                             inputElt->dispatchSimulatedClick(evt, false, false);
@@ -2439,7 +2444,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
 
         if (key == "U+0020") {
-            switch (inputType()) {
+            switch (deprecatedInputType()) {
             case BUTTON:
             case CHECKBOX:
             case FILE:
@@ -2502,7 +2507,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
 
         RefPtr<HTMLFormElement> formForSubmission = form();
         // If there is no form and the element is an <isindex>, then create a temporary form just to be used for submission.
-        if (!formForSubmission && inputType() == ISINDEX)
+        if (!formForSubmission && deprecatedInputType() == ISINDEX)
             formForSubmission = createTemporaryFormForIsIndex();
 
         // Form may never have been present, or may have been destroyed by code responding to the change event.
@@ -2533,7 +2538,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
     if (isTextField() && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent() || evt->type() == eventNames().blurEvent || evt->type() == eventNames().focusEvent))
         toRenderTextControlSingleLine(renderer())->forwardEvent(evt);
 
-    if (inputType() == RANGE && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent()))
+    if (deprecatedInputType() == RANGE && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent()))
         toRenderSlider(renderer())->forwardEvent(evt);
 
     if (!callBaseClassEarly && !evt->defaultHandled())
@@ -2542,7 +2547,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
 
 void HTMLInputElement::handleBeforeTextInsertedEvent(Event* event)
 {
-    if (inputType() == NUMBER) {
+    if (deprecatedInputType() == NUMBER) {
         BeforeTextInsertedEvent* textEvent = static_cast<BeforeTextInsertedEvent*>(event);
         unsigned length = textEvent->text().length();
         bool hasInvalidChar = false;
@@ -2661,21 +2666,21 @@ void HTMLInputElement::setAutofilled(bool b)
 
 FileList* HTMLInputElement::files()
 {
-    if (inputType() != FILE)
+    if (deprecatedInputType() != FILE)
         return 0;
     return m_fileList.get();
 }
 
 bool HTMLInputElement::isAcceptableValue(const String& proposedValue) const
 {
-    if (inputType() != NUMBER)
+    if (deprecatedInputType() != NUMBER)
         return true;
     return proposedValue.isEmpty() || parseToDoubleForNumberType(proposedValue, 0);
 }
 
 String HTMLInputElement::sanitizeValue(const String& proposedValue) const
 {
-    if (inputType() == NUMBER)
+    if (deprecatedInputType() == NUMBER)
         return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : String();
 
     if (isTextField())
@@ -2684,7 +2689,7 @@ String HTMLInputElement::sanitizeValue(const String& proposedValue) const
     // If the proposedValue is null than this is a reset scenario and we
     // want the range input's value attribute to take priority over the
     // calculated default (middle) value.
-    if (inputType() == RANGE && !proposedValue.isNull())
+    if (deprecatedInputType() == RANGE && !proposedValue.isNull())
         return serializeForNumberType(StepRange(this).clampValue(proposedValue));
 
     return proposedValue;
@@ -2692,12 +2697,12 @@ String HTMLInputElement::sanitizeValue(const String& proposedValue) const
 
 bool HTMLInputElement::hasUnacceptableValue() const
 {
-    return inputType() == NUMBER && renderer() && !isAcceptableValue(toRenderTextControl(renderer())->text());
+    return deprecatedInputType() == NUMBER && renderer() && !isAcceptableValue(toRenderTextControl(renderer())->text());
 }
 
 bool HTMLInputElement::needsActivationCallback()
 {
-    return inputType() == PASSWORD || m_autocomplete == Off;
+    return deprecatedInputType() == PASSWORD || m_autocomplete == Off;
 }
 
 void HTMLInputElement::registerForActivationCallbackIfNeeded()
@@ -2717,7 +2722,7 @@ bool HTMLInputElement::isRequiredFormControl() const
     if (!required())
         return false;
 
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case CHECKBOX:
     case DATE:
     case DATETIME:
@@ -2807,7 +2812,7 @@ void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
 
 bool HTMLInputElement::recalcWillValidate() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case CHECKBOX:
     case COLOR:
     case DATE:
@@ -2839,7 +2844,7 @@ bool HTMLInputElement::recalcWillValidate() const
     return false;
 }
 
-bool HTMLInputElement::parseToDateComponents(InputType type, const String& formString, DateComponents* out)
+bool HTMLInputElement::parseToDateComponents(DeprecatedInputType type, const String& formString, DateComponents* out)
 {
     if (formString.isEmpty())
         return false;
@@ -2881,7 +2886,7 @@ HTMLDataListElement* HTMLInputElement::dataList() const
     if (!m_hasNonEmptyList)
         return 0;
 
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     case COLOR:
     case DATE:
     case DATETIME:
@@ -2987,7 +2992,7 @@ void HTMLInputElement::setWapInputFormat(String& mask)
 #if ENABLE(INPUT_SPEECH)
 bool HTMLInputElement::isSpeechEnabled() const
 {
-    switch (inputType()) {
+    switch (deprecatedInputType()) {
     // FIXME: Add support for RANGE, EMAIL, URL, COLOR and DATE/TIME input types.
     case NUMBER:
     case PASSWORD:
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 245bedc..7e601ca 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -40,7 +40,7 @@ class VisibleSelection;
 
 class HTMLInputElement : public HTMLTextFormControlElement, public InputElement {
 public:
-    enum InputType {
+    enum DeprecatedInputType {
         TEXT = 0, // TEXT must be 0.
         PASSWORD,
         ISINDEX,
@@ -65,9 +65,9 @@ public:
         MONTH,
         TIME,
         WEEK,
-        // If you add new types or change the order of enum values, update numberOfTypes below.
+        // If you add new types or change the order of enum values, update deprecatedNumberOfTypes below.
     };
-    static const int numberOfTypes = WEEK + 1;
+    static const int deprecatedNumberOfTypes = WEEK + 1;
 
     static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*);
     virtual ~HTMLInputElement();
@@ -101,23 +101,28 @@ public:
     // stepUp()/stepDown() for user-interaction.
     void stepUpFromRenderer(int);
 
-    bool isTextButton() const { return m_type == SUBMIT || m_type == RESET || m_type == BUTTON; }
+    bool isTextButton() const { return deprecatedInputType() == SUBMIT || deprecatedInputType() == RESET || deprecatedInputType() == BUTTON; }
 
-    virtual bool isRadioButton() const { return m_type == RADIO; }
+    virtual bool isRadioButton() const { return deprecatedInputType() == RADIO; }
     virtual bool isTextField() const;
-    virtual bool isSearchField() const { return m_type == SEARCH; }
-    virtual bool isInputTypeHidden() const { return m_type == HIDDEN; }
-    virtual bool isPasswordField() const { return m_type == PASSWORD; }
-    virtual bool isCheckbox() const { return m_type == CHECKBOX; }
-
-    bool isText() const { return m_type == TEXT; }
-    bool isEmailField() const { return m_type == EMAIL; }
-    bool isFileUpload() const { return m_type == FILE; }
-    bool isImageButton() const { return m_type == IMAGE; }
-    bool isNumberField() const { return m_type == NUMBER; }
-    bool isSubmitButton() const { return m_type == SUBMIT; }
-    bool isTelephoneField() const { return m_type == TELEPHONE; }
-    bool isURLField() const { return m_type == URL; }
+    virtual bool isSearchField() const { return deprecatedInputType() == SEARCH; }
+    virtual bool isInputTypeHidden() const { return deprecatedInputType() == HIDDEN; }
+    virtual bool isPasswordField() const { return deprecatedInputType() == PASSWORD; }
+    virtual bool isCheckbox() const { return deprecatedInputType() == CHECKBOX; }
+
+    // FIXME: It's highly likely that any call site calling this function should instead
+    // be using a different one. Many input elements behave like text fields, and in addition
+    // any unknown input type is treated as text. Consider, for example, isTextField or
+    // isTextField && !isPasswordField.
+    bool isText() const { return deprecatedInputType() == TEXT; }
+
+    bool isEmailField() const { return deprecatedInputType() == EMAIL; }
+    bool isFileUpload() const { return deprecatedInputType() == FILE; }
+    bool isImageButton() const { return deprecatedInputType() == IMAGE; }
+    bool isNumberField() const { return deprecatedInputType() == NUMBER; }
+    bool isSubmitButton() const { return deprecatedInputType() == SUBMIT; }
+    bool isTelephoneField() const { return deprecatedInputType() == TELEPHONE; }
+    bool isURLField() const { return deprecatedInputType() == URL; }
 
 #if ENABLE(INPUT_SPEECH)
     virtual bool isSpeechEnabled() const;
@@ -171,8 +176,7 @@ public:
     virtual bool isActivatedSubmit() const;
     virtual void setActivatedSubmit(bool flag);
 
-    InputType inputType() const { return static_cast<InputType>(m_type); }
-    void setInputType(const String&);
+    DeprecatedInputType deprecatedInputType() const { return static_cast<DeprecatedInputType>(m_deprecatedTypeNumber); }
 
     String altText() const;
 
@@ -209,10 +213,10 @@ public:
     void addSearchResult();
     void onSearch();
 
-    // Parses the specified string as the InputType, and returns true if it is successfully parsed.
+    // Parses the specified string as the DeprecatedInputType, and returns true if it is successfully parsed.
     // An instance pointed by the DateComponents* parameter will have parsed values and be
     // modified even if the parsing fails.  The DateComponents* parameter may be 0.
-    static bool parseToDateComponents(InputType, const String&, DateComponents*);
+    static bool parseToDateComponents(DeprecatedInputType, const String&, DateComponents*);
 
 #if ENABLE(DATALIST)
     HTMLElement* list() const;
@@ -236,7 +240,7 @@ private:
 
     virtual bool isKeyboardFocusable(KeyboardEvent*) const;
     virtual bool isMouseFocusable() const;
-    virtual bool isEnumeratable() const { return inputType() != IMAGE; }
+    virtual bool isEnumeratable() const { return deprecatedInputType() != IMAGE; }
     virtual void updateFocusAppearance(bool restorePreviousSelection);
     virtual void aboutToUnload();
     virtual bool shouldUseInputMethod() const;
@@ -244,15 +248,15 @@ private:
     virtual const AtomicString& formControlName() const;
  
     // isChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
-    virtual bool isChecked() const { return checked() && (inputType() == CHECKBOX || inputType() == RADIO); }
+    virtual bool isChecked() const { return checked() && (deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO); }
     virtual bool isIndeterminate() const { return indeterminate(); }
     
     virtual bool isTextFormControl() const { return isTextField(); }
 
-    virtual bool hasSpinButton() const { return m_type == NUMBER || m_type == DATE || m_type == DATETIME || m_type == DATETIMELOCAL || m_type == MONTH || m_type == TIME || m_type == WEEK; }
+    virtual bool hasSpinButton() const { return deprecatedInputType() == NUMBER || deprecatedInputType() == DATE || deprecatedInputType() == DATETIME || deprecatedInputType() == DATETIMELOCAL || deprecatedInputType() == MONTH || deprecatedInputType() == TIME || deprecatedInputType() == WEEK; }
     virtual bool canTriggerImplicitSubmission() const { return isTextField(); }
 
-    bool allowsIndeterminate() const { return inputType() == CHECKBOX || inputType() == RADIO; }
+    bool allowsIndeterminate() const { return deprecatedInputType() == CHECKBOX || deprecatedInputType() == RADIO; }
 
     virtual const AtomicString& formControlType() const;
 
@@ -277,7 +281,7 @@ private:
     virtual bool isSuccessfulSubmitButton() const;
 
     // Report if this input type uses height & width attributes
-    bool respectHeightAndWidthAttrs() const { return inputType() == IMAGE || inputType() == HIDDEN; }
+    bool respectHeightAndWidthAttrs() const { return deprecatedInputType() == IMAGE || deprecatedInputType() == HIDDEN; }
 
     virtual void reset();
 
@@ -305,7 +309,7 @@ private:
     virtual bool supportsMaxLength() const { return isTextType(); }
     bool isTextType() const;
 
-    virtual bool supportsPlaceholder() const { return isTextType() || inputType() == ISINDEX; }
+    virtual bool supportsPlaceholder() const { return isTextType() || deprecatedInputType() == ISINDEX; }
     virtual bool isEmptyValue() const { return value().isEmpty(); }
     virtual void handleFocusEvent();
     virtual void handleBlurEvent();
@@ -316,6 +320,8 @@ private:
     virtual bool isRequiredFormControl() const;
     virtual bool recalcWillValidate() const;
 
+    void updateType();
+
     void updateCheckedRadioButtons();
     
     void handleBeforeTextInsertedEvent(Event*);
@@ -355,7 +361,7 @@ private:
     short m_maxResults;
     OwnPtr<HTMLImageLoader> m_imageLoader;
     RefPtr<FileList> m_fileList;
-    unsigned m_type : 5; // InputType 
+    unsigned m_deprecatedTypeNumber : 5; // DeprecatedInputType 
     bool m_checked : 1;
     bool m_defaultChecked : 1;
     bool m_useDefaultChecked : 1;
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp
index aaeb3e2..5533326 100644
--- a/WebCore/rendering/MediaControlElements.cpp
+++ b/WebCore/rendering/MediaControlElements.cpp
@@ -350,7 +350,7 @@ MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElemen
     , m_mediaElement(mediaElement)
     , m_pseudoStyleId(pseudo)
 {
-    setInputType(type);
+    setType(type);
     setInDocument();
 
     switch (pseudo) {
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index 7e2d617..20ebe4d 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -146,7 +146,7 @@ void RenderFileUploadControl::updateFromElement()
     
     if (!m_button) {
         m_button = ShadowInputElement::create(inputElement);
-        m_button->setInputType("button");
+        m_button->setType("button");
         m_button->setValue(fileButtonChooseFileLabel());
         RefPtr<RenderStyle> buttonStyle = createButtonStyle(style());
         RenderObject* renderer = m_button->createRenderer(renderArena(), buttonStyle.get());
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index ee8e7f7..3f81503 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -91,6 +91,21 @@
 
 2010-09-17  Darin Adler  <darin at apple.com>
 
+        Reviewed by James Robinson.
+
+        Deprecate the inputType function on HTMLInputElement
+        https://bugs.webkit.org/show_bug.cgi?id=46023
+
+        * src/WebInputElement.cpp:
+        (WebKit::WebInputElement::inputType):
+        * src/WebPasswordFormUtils.cpp:
+        (WebKit::findPasswordFormFields):
+        * src/WebSearchableFormData.cpp:
+        (WebCore::HasSuitableTextElement):
+        Use deprecatedInputType instead of inputType.
+
+2010-09-17  Darin Adler  <darin at apple.com>
+
         Reviewed by Sam Weinig.
 
         REGRESSION (r60104): Zoom level is unexpectedly reset on page reload
diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp
index 25af3b0..25d484c 100644
--- a/WebKit/chromium/src/WebInputElement.cpp
+++ b/WebKit/chromium/src/WebInputElement.cpp
@@ -77,7 +77,7 @@ bool WebInputElement::isEnabledFormControl() const
 
 WebInputElement::InputType WebInputElement::inputType() const
 {
-    return static_cast<InputType>(constUnwrap<HTMLInputElement>()->inputType());
+    return static_cast<InputType>(constUnwrap<HTMLInputElement>()->deprecatedInputType());
 }
 
 int WebInputElement::maxLength() const
diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp
index a34b17a..6968e1a 100644
--- a/WebKit/chromium/src/WebPasswordFormUtils.cpp
+++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp
@@ -98,8 +98,9 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
             if (!inputElement->isEnabledFormControl())
                 continue;
 
-            // FIXME: This needs to use a function other than inputType.
-            if ((inputElement->inputType() == HTMLInputElement::TEXT)
+            // FIXME: This needs to use a function other than deprecatedInputType.
+            // Does this really want to special-case TEXT, and not other text-field-like input elements?
+            if ((inputElement->deprecatedInputType() == HTMLInputElement::TEXT)
                 && (inputElement->autoComplete())) {
                 fields->userName = inputElement;
                 break;
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index ba8a4f2..5fc51ca 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -176,9 +176,9 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
                 return 0;
             }
 
-            // FIXME: This needs to use a function on HTMLInputElement other than inputType.
+            // FIXME: This needs to use a function on HTMLInputElement other than deprecatedInputType.
             // Also, it's not clear why TEXT should be handled differently than, say, SEARCH.
-            switch (static_cast<const HTMLInputElement*>(formElement)->inputType()) {
+            switch (static_cast<const HTMLInputElement*>(formElement)->deprecatedInputType()) {
             case HTMLInputElement::TEXT:
             case HTMLInputElement::ISINDEX:
                 isTextElement = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list