1. 13 Aug, 2010 2 commits
  2. 11 Aug, 2010 1 commit
    • cfleizach@apple.com's avatar
      AX: isNativeCheckbox does not work as advertised · 53e67549
      cfleizach@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=43872
      
      Reviewed by Beth Dakin.
      
      WebCore: 
      
      Test: platform/mac/accessibility/native-vs-nonnative-checkboxes.html
      
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::isInputImage):
          Only say it's an input image if its role has not been overriden
      (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
      * dom/InputElement.h:
          Add methods to query if it's a checkbox or radio button type element.
      * html/HTMLInputElement.h:
      (WebCore::HTMLInputElement::isCheckbox):
      
      LayoutTests: 
      
      * platform/mac/accessibility/native-vs-nonnative-checkboxes-expected.txt: Added.
      * platform/mac/accessibility/native-vs-nonnative-checkboxes.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53e67549
  3. 22 Jul, 2010 1 commit
    • tkent@chromium.org's avatar
      maxLength should not be applied to non-text types · a0c6424e
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=42814
      
      Reviewed by Darin Adler.
      
      WebCore:
      
      According to the HTML5 specification, maxLength attribute should
      be applied to text, search, url, tel, email, and password types.
      
      Test: fast/forms/input-maxlength-unsupported.html
      
      * dom/InputElement.cpp:
      (WebCore::InputElement::handleBeforeTextInsertedEvent):
       Apply maxLength() only if supportsMaxLength() is true.
      * dom/InputElement.h:
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::patternMismatch):
       Code cleanup by isTextType().
      (WebCore::HTMLInputElement::tooLong):
       ditto.
      (WebCore::HTMLInputElement::isTextType):
       Added. This returns true for types with maxLength/pattern/placeholder.
      * html/HTMLInputElement.h:
      (WebCore::HTMLInputElement::supportsMaxLength):
       Added. Just calls isTextType().
      (WebCore::HTMLInputElement::supportsPlaceholder):
       Code cleanup by isTextType().
      * wml/WMLInputElement.h:
      (WebCore::WMLInputElement::supportsMaxLength):
       Added. Always returns true.
      
      LayoutTests:
      
      * fast/forms/input-maxlength-unsupported-expected.txt: Added.
      * fast/forms/input-maxlength-unsupported.html: Added.
      * fast/forms/script-tests/input-maxlength-unsupported.js: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a0c6424e
  4. 16 Jul, 2010 1 commit
    • tkent@chromium.org's avatar
      Keyboard operations for <input type=number> · 83230bf9
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=42076
      
      Reviewed by Darin Fisher.
      
      WebCore:
      
      - The up arrow key works as stepUp().
      - The down arrow key works as stepDown().
      - Reject characters other than + - 0-9 . e E
      
      Test: fast/forms/input-number-keyoperation.html
      
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::defaultEventHandler):
       Add up/down arrow keys support, and call handleBeforeTextInsertedEvent().
      (WebCore::isNumberCharacter):
      (WebCore::HTMLInputElement::handleBeforeTextInsertedEvent):
       For type=number, remove unacceptable characters.
      * html/HTMLInputElement.h:
      
      LayoutTests:
      
      * fast/forms/input-number-keyoperation-expected.txt: Added.
      * fast/forms/input-number-keyoperation.html: Added.
      * fast/forms/script-tests/input-number-keyoperation.js: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83230bf9
  5. 15 Jul, 2010 1 commit
    • johnnyg@google.com's avatar
      2010-07-07 John Gregg <johnnyg@google.com> · 4b0a455b
      johnnyg@google.com authored
              Reviewed by Jian Li.
      
              Experimental directory upload feature.
              https://bugs.webkit.org/show_bug.cgi?id=40872
      
              This patch adds a new HTML attribute webkitdirectory which applies to 
              <input type="file"> tags and allows the user to specify a folder
              which is recursively enumerated so that all the files in that folder
              are added to the file list.
      
              The files chosen in that way have a .webkitRelativePath attribute which contains
              the relative path starting from the chosen folder.  The relative path is
              also appended to each item in the FormData when uploaded.
      
              All the code is behind an ENABLE_DIRECTORY_UPLOAD flag.
      
              Test: fast/forms/input-file-directory-upload.html
      
              * html/Blob.cpp:
              (WebCore::Blob::Blob):
              * html/Blob.h:
              * html/File.cpp:
              (WebCore::File::File):
              (WebCore::File::Init):
              (WebCore::File::webkitRelativePath):
              * html/File.h:
              (WebCore::File::create):
              * html/File.idl:
              * html/HTMLAttributeNames.in: add webkitdirectory attribute
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::setFileListFromRenderer):
              (WebCore::HTMLInputElement::webkitdirectory):
              * html/HTMLInputElement.h:
              * html/HTMLInputElement.idl:
              * platform/BlobItem.cpp:
              (WebCore::FileBlobItem::create):
              (WebCore::FileBlobItem::FileBlobItem):
              * platform/BlobItem.h:
              (WebCore::FileBlobItem::relativePath):
              * platform/FileChooser.h:
              (WebCore::FileChooser::allowsDirectoryUpload):
              * platform/network/FormData.cpp:
              (WebCore::FormData::appendKeyValuePairItems):
              * rendering/RenderFileUploadControl.cpp:
              (WebCore::RenderFileUploadControl::allowsMultipleFiles):
              (WebCore::RenderFileUploadControl::allowsDirectoryUpload):
              * rendering/RenderFileUploadControl.h:
      2010-07-07  John Gregg  <johnnyg@google.com>
      
              Reviewed by Jian Li.
      
              Layout test for experimental directory upload feature.  Only enabled on chromium since that's where the feature is compiled in.
              https://bugs.webkit.org/show_bug.cgi?id=40872
      
              * fast/forms/input-file-directory-upload-expected.txt: Added.
              * fast/forms/input-file-directory-upload.html: Added.
              * platform/gtk/Skipped:
              * platform/mac/Skipped:
              * platform/qt/Skipped:
              * platform/win/Skipped:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b0a455b
  6. 07 Jul, 2010 1 commit
  7. 26 Jun, 2010 2 commits
    • darin@apple.com's avatar
      Try to fix Chromium build by adding back function used only by Chromium WebKit. · 8d1252e0
      darin@apple.com authored
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::defaultChecked): Added back.
      * html/HTMLInputElement.h: Added defaultChecked function.
      
      * html/HTMLMetaElement.cpp:
      (WebCore::HTMLMetaElement::httpEquiv): Added back.
      * html/HTMLMetaElement.h: Added httpEquiv function.
      
      * html/HTMLOptionElement.cpp:
      (WebCore::HTMLOptionElement::defaultSelected): Added back.
      * html/HTMLOptionElement.h: Added defaultSelected function.
      
      * rendering/style/StyleRareNonInheritedData.h: Fixed incorrect struct vs. class
      here as seen in warnings on Chromium Windows bot.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d1252e0
    • darin@apple.com's avatar
      2010-06-26 Darin Adler <darin@apple.com> · 817d2779
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              Add more use of reflection, remove unused functions
              https://bugs.webkit.org/show_bug.cgi?id=41255
      
              Also noticed that HTMLDirectoryElement was missing its create function
              and added that so the element will get the correct class.
      
              * html/HTMLBaseFontElement.idl: Use reflection for the size attribute
              in the Objective-C code path too.
      
              * html/HTMLSelectElement.idl: Use reflection for disabled and autofocus
              attributes. Also removed spaces and indenting to match other IDL files.
      
              * html/HTMLStyleElement.idl: Use reflection for disabled attribute.
      
              * html/HTMLTableCellElement.idl: Use reflection for noWrap attribute.
      
              * html/HTMLTextAreaElement.idl: Use reflection for disabled, autofocus,
              readOnly, and required attributes.
      
              * html/HTMLUListElement.idl: Use reflection for compact attribute.
      
              * html/HTMLDirectoryElement.cpp:
              (WebCore::HTMLDirectoryElement::HTMLDirectoryElement): Made inline.
              (WebCore::HTMLDirectoryElement::create): Added.
              * html/HTMLDirectoryElement.h:
              Added create, made constructor private, removed unused functions.
      
              * html/HTMLStyleElement.cpp:
              (WebCore::HTMLStyleElement::parseMappedAttribute): Removed code to
              set unused m_media data member.
              * html/HTMLStyleElement.h:
              Removed unused functions and m_media data member. Also made some
              functions private.
      
              * html/HTMLAppletElement.cpp:
              * html/HTMLAppletElement.h:
              * html/HTMLAreaElement.cpp:
              * html/HTMLAreaElement.h:
              * html/HTMLBaseFontElement.cpp:
              * html/HTMLBaseFontElement.h:
              * html/HTMLButtonElement.cpp:
              * html/HTMLButtonElement.h:
              * html/HTMLDListElement.cpp:
              * html/HTMLDListElement.h:
              * html/HTMLDivElement.cpp:
              * html/HTMLDivElement.h:
              * html/HTMLFontElement.cpp:
              * html/HTMLFontElement.h:
              * html/HTMLFormControlElement.cpp:
              * html/HTMLFormControlElement.h:
              * html/HTMLFormElement.cpp:
              * html/HTMLFormElement.h:
              * html/HTMLFrameElement.cpp: Also removed an incorrect FIXME comment
              here after I did a little research to disprove it.
              * html/HTMLFrameElement.h:
              * html/HTMLFrameSetElement.cpp:
              * html/HTMLFrameSetElement.h:
              * html/HTMLHRElement.cpp:
              * html/HTMLHRElement.h:
              * html/HTMLHeadElement.cpp:
              * html/HTMLHeadElement.h:
              * html/HTMLHeadingElement.cpp:
              * html/HTMLHeadingElement.h:
              * html/HTMLHtmlElement.cpp:
              * html/HTMLHtmlElement.h:
              * html/HTMLImageElement.cpp:
              * html/HTMLImageElement.h:
              * html/HTMLInputElement.cpp:
              * html/HTMLInputElement.h:
              * html/HTMLIsIndexElement.cpp:
              * html/HTMLIsIndexElement.h:
              * html/HTMLLIElement.cpp:
              * html/HTMLLIElement.h:
              * html/HTMLLabelElement.cpp:
              * html/HTMLLabelElement.h:
              * html/HTMLLegendElement.cpp:
              * html/HTMLLegendElement.h:
              * html/HTMLLinkElement.cpp:
              * html/HTMLLinkElement.h:
              * html/HTMLMapElement.cpp:
              * html/HTMLMapElement.h:
              * html/HTMLMenuElement.cpp:
              * html/HTMLMenuElement.h:
              * html/HTMLMetaElement.cpp:
              * html/HTMLMetaElement.h:
              * html/HTMLModElement.cpp:
              * html/HTMLModElement.h:
              * html/HTMLOListElement.cpp:
              * html/HTMLOListElement.h:
              * html/HTMLObjectElement.cpp:
              * html/HTMLObjectElement.h:
              * html/HTMLOptGroupElement.cpp:
              * html/HTMLOptGroupElement.h:
              * html/HTMLOptionElement.cpp:
              * html/HTMLOptionElement.h:
              * html/HTMLParagraphElement.cpp:
              * html/HTMLParagraphElement.h:
              * html/HTMLParamElement.cpp:
              * html/HTMLParamElement.h:
              * html/HTMLPlugInElement.cpp:
              * html/HTMLPlugInElement.h:
              * html/HTMLPreElement.cpp:
              * html/HTMLPreElement.h:
              * html/HTMLQuoteElement.cpp:
              * html/HTMLQuoteElement.h:
              * html/HTMLScriptElement.cpp:
              * html/HTMLScriptElement.h:
              * html/HTMLTableCaptionElement.cpp:
              * html/HTMLTableCaptionElement.h:
              * html/HTMLTableCellElement.cpp:
              * html/HTMLTableCellElement.h:
              * html/HTMLTableColElement.cpp:
              * html/HTMLTableColElement.h:
              * html/HTMLTableElement.cpp:
              * html/HTMLTableElement.h:
              * html/HTMLTableRowElement.cpp:
              * html/HTMLTableRowElement.h:
              * html/HTMLTextAreaElement.cpp:
              * html/HTMLTextAreaElement.h:
              * html/HTMLUListElement.cpp:
              * html/HTMLUListElement.h:
              * html/HTMLVideoElement.cpp:
              * html/HTMLVideoElement.h:
              Removed unused functions.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      817d2779
  8. 24 Jun, 2010 1 commit
    • jorlow@chromium.org's avatar
      2010-06-24 Satish Sampath <satish@chromium.org> · 777bf4bc
      jorlow@chromium.org authored
              Reviewed by Kent Tamura.
      
              Add a speech button to input elements, no rendering or actions yet.
      
              Speech Input: Add a speech button to text input element (no rendering or actions yet)
              https://bugs.webkit.org/show_bug.cgi?id=40925
      
              No new tests. Will create a layout test in a subsequent patch.
      
              * css/CSSPrimitiveValueMappings.h:
              (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
              * css/CSSSelector.cpp:
              (WebCore::CSSSelector::pseudoId):
              (WebCore::nameToPseudoTypeMap):
              (WebCore::CSSSelector::extractPseudoType):
              * css/CSSSelector.h:
              (WebCore::CSSSelector::):
              * css/CSSValueKeywords.in:
              * css/html.css:
              (input::-webkit-input-speech-button):
              * dom/InputElement.h:
              * html/HTMLAttributeNames.in:
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::isSpeechEnabled):
              * html/HTMLInputElement.h:
              * platform/ThemeTypes.h:
              (WebCore::):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::nodeAtPoint):
              (WebCore::RenderTextControlSingleLine::forwardEvent):
              (WebCore::RenderTextControlSingleLine::styleDidChange):
              (WebCore::RenderTextControlSingleLine::hasControlClip):
              (WebCore::RenderTextControlSingleLine::controlClipRect):
              (WebCore::RenderTextControlSingleLine::textBlockWidth):
              (WebCore::RenderTextControlSingleLine::preferredContentWidth):
              (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
              (WebCore::RenderTextControlSingleLine::createSpeechButtonStyle):
              (WebCore::RenderTextControlSingleLine::clientPaddingRight):
              * rendering/RenderTextControlSingleLine.h:
              * rendering/RenderTheme.cpp:
              (WebCore::RenderTheme::adjustStyle):
              (WebCore::RenderTheme::paint):
              (WebCore::RenderTheme::paintBorderOnly):
              (WebCore::RenderTheme::paintDecorations):
              * rendering/TextControlInnerElements.cpp:
              (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
              (WebCore::InputFieldSpeechButtonElement::create):
              (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
              * rendering/TextControlInnerElements.h:
              * rendering/style/RenderStyleConstants.h:
              (WebCore::):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      777bf4bc
  9. 19 Jun, 2010 1 commit
  10. 10 Jun, 2010 1 commit
    • eric@webkit.org's avatar
      2010-06-10 Raine Makelainen <raine.makelainen@nokia.com> · 00417ded
      eric@webkit.org authored
              Reviewed by Kenneth Rohde Christiansen.
      
              Impossible to set input method hints based HTML5 input types
              https://bugs.webkit.org/show_bug.cgi?id=40107
      
              Helper methods for checking "tel", "number", "email",
              and "url" input element types.
      
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::isTelephoneField):
              (WebCore::HTMLInputElement::isNumberField):
              (WebCore::HTMLInputElement::isEmailField):
              (WebCore::HTMLInputElement::isUrlField):
      2010-06-10  Raine Makelainen  <raine.makelainen@nokia.com>
      
              Reviewed by Kenneth Rohde Christiansen.
      
              Impossible to set input method hints based HTML5 input types
              https://bugs.webkit.org/show_bug.cgi?id=40107
      
              EditorClientQt to set input method hints for "number", "tel",
              "email", and "url" HTML input elements.
      
              Tests for HTML input elements and input method hints added for
              QGraphicsWebView and QWebView.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::setInputMethodState):
              * tests/qgraphicswebview/resources/input_types.html: Added.
              * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
              (GraphicsWebView::GraphicsWebView):
              (GraphicsWebView::fireMouseClick):
              (tst_QGraphicsWebView::focusInputTypes):
              * tests/qgraphicswebview/tst_qgraphicswebview.qrc: Added.
              * tests/qwebview/resources/input_types.html: Added.
              * tests/qwebview/tst_qwebview.cpp:
              (WebView::fireMouseClick):
              (tst_QWebView::focusInputTypes):
              * tests/qwebview/tst_qwebview.qrc:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      00417ded
  11. 30 May, 2010 2 commits
    • dbates@webkit.org's avatar
      2010-05-30 Daniel Bates <dbates@rim.com> · d301988a
      dbates@webkit.org authored
              Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418.
      
              * html/HTMLFormControlElement.h:
              (WebCore::HTMLFormControlElement::isEnabledFormControl):
              (WebCore::HTMLFormControlElement::isReadOnlyFormControl):
              (WebCore::HTMLFormControlElement::isFormControlElement):
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::isPasswordField):
      
      2010-05-30  Daniel Bates  <dbates@rim.com>
      
              Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418.
      
              * src/EditorClientImpl.cpp:
              (WebKit::EditorClientImpl::autofill):
              * src/WebFormControlElement.cpp:
              (WebKit::WebFormControlElement::formControlName):
              (WebKit::WebFormControlElement::formControlType):
              * src/WebFormElement.cpp:
              (WebKit::WebFormElement::getFormControlElements):
              * src/WebPasswordFormUtils.cpp:
              (WebKit::findPasswordFormFields):
      
      2010-05-30  Daniel Bates  <dbates@rim.com>
      
              Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418.
      
              * WebFrame.cpp:
              (WebFrame::elementWithName):
              (WebFrame::controlsInForm):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d301988a
    • darin@apple.com's avatar
      2010-05-30 Darin Adler <darin@apple.com> · 1f643c79
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              Make more HTML DOM members private, especially constructors, third and final batch
              https://bugs.webkit.org/show_bug.cgi?id=39916
      
              * WebView/WebHTMLRepresentation.mm:
              (-[WebHTMLRepresentation elementWithName:inForm:]): Use the new HTMLFormElement
              function, associatedElements, rather than getting directly at a data member
              named formElements.
              (-[WebHTMLRepresentation controlsInForm:]): Ditto.
      2010-05-30  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              Make more HTML DOM members private, especially constructors, third and final batch
              https://bugs.webkit.org/show_bug.cgi?id=39916
      
              * dom/Document.cpp:
              (WebCore::Document::implicitClose):
              * editing/DeleteButtonController.cpp:
              (WebCore::DeleteButtonController::createDeletionUI):
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertHorizontalRule):
              (WebCore::executeInsertImage):
              * editing/htmlediting.cpp:
              (WebCore::createDefaultParagraphElement):
              (WebCore::createListItemElement):
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::handleError):
              (WebCore::HTMLParser::headCreateErrorCheck):
              (WebCore::HTMLParser::formCreateErrorCheck):
              (WebCore::HTMLParser::createHead):
              (WebCore::HTMLParser::handleIsindex):
              (WebCore::HTMLParser::finished):
              * html/HTMLViewSourceDocument.cpp:
              (WebCore::HTMLViewSourceDocument::createContainingTable):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::createSubtreeIfNeeded):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
              Use create instead of new to create HTML elements.
      
              * html/HTMLFormCollection.cpp:
              (WebCore::HTMLFormCollection::formCollectionInfo):
              (WebCore::HTMLFormCollection::item):
              (WebCore::HTMLFormCollection::getNamedFormItem):
              (WebCore::HTMLFormCollection::updateNameCache):
              * html/HTMLFormControlElement.h:
              Updated for name and privacy changes in HTMLFormElement.
      
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::HTMLFormElement):
              (WebCore::HTMLFormElement::create):
              (WebCore::HTMLFormElement::~HTMLFormElement):
              (WebCore::HTMLFormElement::length):
              (WebCore::HTMLFormElement::submitImplicitly):
              (WebCore::HTMLFormElement::createFormData):
              (WebCore::HTMLFormElement::submit):
              (WebCore::HTMLFormElement::reset):
              (WebCore::HTMLFormElement::formElementIndex):
              (WebCore::HTMLFormElement::registerFormElement):
              (WebCore::HTMLFormElement::removeFormElement):
              (WebCore::HTMLFormElement::registerImgElement):
              (WebCore::HTMLFormElement::removeImgElement):
              (WebCore::HTMLFormElement::defaultButton):
              (WebCore::HTMLFormElement::collectUnhandledInvalidControls):
              (WebCore::HTMLFormElement::addElementAlias):
              (WebCore::HTMLFormElement::documentDidBecomeActive):
              * html/HTMLFormElement.h:
              Added create functions. Made constructors and other members private.
              Used an OwnPtr for m_elementAliases. Renamed collectionInfo to
              m_collectionCache and used an OwnPtr for it. Renamed formElements to
              m_associatedElements (since its contents are what HTML5 calls
              "form-associated element", not form elements). Renamed imgElements to
              m_imageElements.
      
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
              (WebCore::HTMLFrameSetElement::create):
              (WebCore::HTMLFrameSetElement::parseMappedAttribute):
              * html/HTMLFrameSetElement.h:
              Added create functions. Made constructors and other members private.
              Renamed m_rows and m_cols to m_rowLengths and m_colLengths and used
              OwnArrayPtr for both.
      
              * html/HTMLLabelElement.cpp:
              (WebCore::nodeAsLabelableFormControl): Made this cast to Element instead
              of HTMLElement, since isFormControlElement is available on Element.
              (WebCore::HTMLLabelElement::HTMLLabelElement):
              (WebCore::HTMLLabelElement::create):
              * html/HTMLLabelElement.h:
              Added create functions. Made constructors and other members private.
      
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::HTMLLegendElement):
              (WebCore::HTMLLegendElement::create):
              (WebCore::HTMLLegendElement::associatedControl):
              (WebCore::HTMLLegendElement::focus):
              (WebCore::HTMLLegendElement::accessKeyAction):
              * html/HTMLLegendElement.h:
              Added create functions. Made constructors and other members private.
              Renamed formElement to associatedControl since hte control associated
              with this legend is not a "form element".
      
              * editing/DeleteButton.cpp:
              (WebCore::DeleteButton::DeleteButton):
              (WebCore::DeleteButton::create):
              * editing/DeleteButton.h:
              * html/HTMLDivElement.cpp:
              (WebCore::HTMLDivElement::HTMLDivElement):
              (WebCore::HTMLDivElement::create):
              * html/HTMLDivElement.h:
              * html/HTMLFontElement.cpp:
              (WebCore::HTMLFontElement::create):
              * html/HTMLFontElement.h:
              * html/HTMLHRElement.cpp:
              (WebCore::HTMLHRElement::HTMLHRElement):
              (WebCore::HTMLHRElement::create):
              * html/HTMLHRElement.h:
              * html/HTMLHeadElement.cpp:
              (WebCore::HTMLHeadElement::HTMLHeadElement):
              (WebCore::HTMLHeadElement::create):
              * html/HTMLHeadElement.h:
              * html/HTMLHeadingElement.cpp:
              (WebCore::HTMLHeadingElement::HTMLHeadingElement):
              (WebCore::HTMLHeadingElement::create):
              * html/HTMLHeadingElement.h:
              * html/HTMLHtmlElement.cpp:
              (WebCore::HTMLHtmlElement::HTMLHtmlElement):
              (WebCore::HTMLHtmlElement::create):
              * html/HTMLHtmlElement.h:
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::HTMLImageElement):
              (WebCore::HTMLImageElement::create):
              * html/HTMLImageElement.h:
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::HTMLInputElement):
              (WebCore::HTMLInputElement::create):
              (WebCore::HTMLInputElement::createTemporaryFormForIsIndex):
              * html/HTMLInputElement.h:
              * html/HTMLIsIndexElement.cpp:
              (WebCore::HTMLIsIndexElement::HTMLIsIndexElement):
              (WebCore::HTMLIsIndexElement::create):
              * html/HTMLIsIndexElement.h:
              * html/HTMLLIElement.cpp:
              (WebCore::HTMLLIElement::HTMLLIElement):
              (WebCore::HTMLLIElement::create):
              * html/HTMLLIElement.h:
              * html/HTMLLinkElement.cpp:
              (WebCore::HTMLLinkElement::HTMLLinkElement):
              (WebCore::HTMLLinkElement::create):
              * html/HTMLLinkElement.h:
              Added create functions. Made constructors and other members private.
      
              * html/HTMLTagNames.in: Removed the createWithNew flag from all the
              tags that were still using it: div, font, form, frameset, h1, h2, h3,
              h4, h5, h6, head, hr, html, image, img, input, ins, isindex, label,
              legend, li, and link.
      
              * html/HTMLTextAreaElement.h: Removed unneeded definition of the readOnly
              function, since the one in HTMLFormElement does the same thing.
      
              * loader/ImageDocument.cpp:
              (WebCore::ImageDocumentElement::ImageDocumentElement):
              (WebCore::ImageDocumentElement::create):
              (WebCore::ImageDocument::createDocumentStructure):
              Added create functions. Made constructors and other members private.
      
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag): Use the non-virtual disabled
              function instead of the virtual isEnabledFormControl function, which just
              turns around and calls the disabled function.
      
              * rendering/MediaControlElements.cpp:
              (WebCore::MediaControlShadowRootElement::MediaControlShadowRootElement):
              (WebCore::MediaControlShadowRootElement::create):
              (WebCore::MediaControlElement::MediaControlElement):
              (WebCore::MediaControlElement::create):
              (WebCore::MediaControlTimelineContainerElement::MediaControlTimelineContainerElement):
              (WebCore::MediaControlTimelineContainerElement::create):
              (WebCore::MediaControlTimelineContainerElement::rendererIsNeeded):
              (WebCore::MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContainerElement):
              (WebCore::MediaControlVolumeSliderContainerElement::create):
              (WebCore::MediaControlStatusDisplayElement::MediaControlStatusDisplayElement):
              (WebCore::MediaControlStatusDisplayElement::create):
              (WebCore::MediaControlStatusDisplayElement::update):
              (WebCore::MediaControlStatusDisplayElement::rendererIsNeeded):
              (WebCore::MediaControlInputElement::MediaControlInputElement):
              (WebCore::MediaControlInputElement::styleForElement):
              (WebCore::MediaControlInputElement::rendererIsNeeded):
              (WebCore::MediaControlInputElement::attach):
              (WebCore::MediaControlInputElement::updateStyle):
              (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement):
              (WebCore::MediaControlMuteButtonElement::create):
              (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
              (WebCore::MediaControlMuteButtonElement::updateDisplayType):
              (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement):
              (WebCore::MediaControlPlayButtonElement::create):
              (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
              (WebCore::MediaControlPlayButtonElement::updateDisplayType):
              (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement):
              (WebCore::MediaControlSeekButtonElement::create):
              (WebCore::MediaControlSeekButtonElement::isForwardButton):
              (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
              (WebCore::MediaControlSeekButtonElement::seekTimerFired):
              (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement):
              (WebCore::MediaControlRewindButtonElement::create):
              (WebCore::MediaControlRewindButtonElement::defaultEventHandler):
              (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement):
              (WebCore::MediaControlReturnToRealtimeButtonElement::create):
              (WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
              (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
              (WebCore::MediaControlTimelineElement::MediaControlTimelineElement):
              (WebCore::MediaControlTimelineElement::create):
              (WebCore::MediaControlTimelineElement::defaultEventHandler):
              (WebCore::MediaControlTimelineElement::update):
              (WebCore::MediaControlVolumeSliderElement::MediaControlVolumeSliderElement):
              (WebCore::MediaControlVolumeSliderElement::create):
              (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
              (WebCore::MediaControlVolumeSliderElement::update):
              (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement):
              (WebCore::MediaControlFullscreenButtonElement::create):
              (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
              (WebCore::MediaControlTimeDisplayElement::MediaControlTimeDisplayElement):
              (WebCore::MediaControlTimeDisplayElement::create):
              * rendering/MediaControlElements.h:
              Added create functions. Made constructors and other members private.
      
              * rendering/RenderFileUploadControl.cpp:
              (WebCore::ShadowInputElement::ShadowInputElement):
              (WebCore::ShadowInputElement::create):
              (WebCore::RenderFileUploadControl::updateFromElement):
              Added create functions. Made constructors and other members private.
      
              * rendering/RenderMedia.cpp:
              (WebCore::RenderMedia::createControlsShadowRoot):
              (WebCore::RenderMedia::createPanel):
              (WebCore::RenderMedia::createMuteButton):
              (WebCore::RenderMedia::createPlayButton):
              (WebCore::RenderMedia::createSeekBackButton):
              (WebCore::RenderMedia::createSeekForwardButton):
              (WebCore::RenderMedia::createRewindButton):
              (WebCore::RenderMedia::createReturnToRealtimeButton):
              (WebCore::RenderMedia::createToggleClosedCaptionsButton):
              (WebCore::RenderMedia::createStatusDisplay):
              (WebCore::RenderMedia::createTimelineContainer):
              (WebCore::RenderMedia::createTimeline):
              (WebCore::RenderMedia::createVolumeSliderContainer):
              (WebCore::RenderMedia::createVolumeSlider):
              (WebCore::RenderMedia::createCurrentTimeDisplay):
              (WebCore::RenderMedia::createTimeRemainingDisplay):
              (WebCore::RenderMedia::createFullscreenButton):
              Use create instead of new.
      
              * rendering/RenderProgress.cpp:
              (WebCore::ProgressValueElement::ProgressValueElement):
              (WebCore::ProgressValueElement::create):
              (WebCore::RenderProgress::updateValuePartState):
              * rendering/RenderSlider.cpp:
              (WebCore::SliderThumbElement::SliderThumbElement):
              (WebCore::SliderThumbElement::create):
              (WebCore::RenderSlider::updateFromElement):
              Added create functions. Made constructors and other members private.
      
              * rendering/TextControlInnerElements.cpp:
              (WebCore::TextControlInnerElement::TextControlInnerElement):
              (WebCore::TextControlInnerElement::create):
              (WebCore::TextControlInnerTextElement::TextControlInnerTextElement):
              (WebCore::TextControlInnerTextElement::create):
              (WebCore::TextControlInnerTextElement::defaultEventHandler):
              (WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
              (WebCore::SearchFieldResultsButtonElement::create):
              (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
              (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
              (WebCore::SearchFieldCancelButtonElement::create):
              (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
              (WebCore::SpinButtonElement::SpinButtonElement):
              (WebCore::SpinButtonElement::create):
              (WebCore::SpinButtonElement::defaultEventHandler):
              * rendering/TextControlInnerElements.h:
              Added create functions. Made constructors and other members private.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f643c79
  12. 19 May, 2010 1 commit
  13. 11 May, 2010 1 commit
    • dglazkov@chromium.org's avatar
      2010-05-11 Dimitri Glazkov <dglazkov@chromium.org> · 0dea8641
      dglazkov@chromium.org authored
              Reviewed by Darin Adler.
      
              REGRESSION(r58520): Implicit submission on forms with button type="submit" no longer works
              https://bugs.webkit.org/show_bug.cgi?id=38913
      
              Updated the test to include coverage of button elements.
      
              * fast/forms/enter-clicks-buttons-expected.txt: Updated expectations to account for implicit
                  submission which now correctly happens from the right element (button).
              * fast/forms/implicit-submission-expected.txt: Updated expectations with new test results.
              * fast/forms/implicit-submission.html: Added tests and code to cover button elements.
      2010-05-11  Dimitri Glazkov  <dglazkov@chromium.org>
      
              Reviewed by Darin Adler.
      
              REGRESSION(r58520): Implicit submission on forms with button type="submit" no longer works
              https://bugs.webkit.org/show_bug.cgi?id=38913
      
              * Widened the check for a successful submit button to include all HTMLFormControlElements.
              * Clarified implicit submission code by:
                  - introducing HTMLFormControlElement::canTriggerImplicitSubmission flag,
                  - getting rid of static casting and checking for tag names.
      
              * html/HTMLFormControlElement.h:
              (WebCore::HTMLFormControlElement::canTriggerImplicitSubmission): Added.
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::submitImplicitly): Renamed parameters for clarity, refactored code
                  to use canTriggerImplicitSubmission.
              * html/HTMLFormElement.h: Renamed parameter for clarity.
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::defaultEventHandler):  Used canTriggerImplicitSubmission()
                  instead of isTextField() for clarity.
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::canTriggerImplicitSubmission): Added.
              * html/HTMLIsIndexElement.h:
              (WebCore::HTMLIsIndexElement::canTriggerImplicitSubmission): Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0dea8641
  14. 06 May, 2010 2 commits
    • eric@webkit.org's avatar
      2010-05-05 Charles Wei <charles.wei@torchmobile.com.cn> · 5d98a3f2
      eric@webkit.org authored
              Reviewed by George Staikos
      
              https://bugs.webkit.org/show_bug.cgi?id=37848
              Add test cases for -wap-input-format and -wap-input-required of WCSS
      
              * fast/wcss/wap-input-format-expected.txt: Added.
              * fast/wcss/wap-input-format.xhtml: Added.
              * fast/wcss/wap-input-required-expected.txt: Added.
              * fast/wcss/wap-input-required.xhtml: Added.
      2010-05-05  Charles Wei  <charles.wei@torchmobile.com.cn>
      
              Reviewed by George Staikos
      
              https://bugs.webkit.org/show_bug.cgi?id=37848
              This patch adds WCSS -wap-input-format and -wap-input-required support to WebKit
      
              Tests: fast/wcss/wap-input-format.xhtml
                     fast/wcss/wap-input-required.xhtml
      
              * css/CSSParser.cpp:
              (WebCore::CSSParser::parseValue):
              (WebCore::CSSParser::parseWCSSInputProperty):
              * css/CSSParser.h:
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::applyProperty):
              * css/WCSSPropertyNames.in:
              * dom/InputElement.cpp:
              (WebCore::InputElement::sanitizeValue):
              (WebCore::InputElement::handleBeforeTextInsertedEvent):
              (WebCore::InputElementData::InputElementData):
              (WebCore::formatCodes):
              (WebCore::cursorPositionToMaskIndex):
              (WebCore::InputElement::isConformToInputMask):
              (WebCore::InputElement::validateInputMask):
              * dom/InputElement.h:
              (WebCore::InputElementData::inputFormatMask):
              (WebCore::InputElementData::setInputFormatMask):
              (WebCore::InputElementData::maxInputCharsAllowed):
              (WebCore::InputElementData::setMaxInputCharsAllowed):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::setWapInputFormat):
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::data):
              * wml/WMLInputElement.h:
              (WebCore::WMLInputElement::data):
      2010-05-05  Charles Wei  <charles.wei@torchmobile.com.cn>
      
              Reviewed by George Staikos
      
              This patch adds WCSS -wap-input-format and -wap-input-required support to WebKit
              Make the test cases in fast/wcss optionional only when  WCSS is enabled.
      
              https://bugs.webkit.org/show_bug.cgi?id=37848
      
              * Scripts/old-run-webkit-tests:
              * Scripts/webkitperl/features.pm:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d98a3f2
    • morrita@google.com's avatar
      2010-05-05 MORITA Hajime <morrita@google.com> · ca076b99
      morrita@google.com authored
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=38150
              Refactoring: webkitEditableContentChangedEvent should be handled by the owner of appropriate the renderer.
      
              Moved a part of code chunk in HTMLFormControlElementWithState::defaultEventHandler()
              which accesses the renderer from foreign node,
              to TextControlInnerTextElement::defaultEventHandler() which owns the renderer.
      
              No new tests. No behavioral change.
      
              * html/HTMLFormControlElement.cpp:
              (WebCore::HTMLFormControlElementWithState::defaultEventHandler):
              * html/HTMLFormControlElement.h:
              * html/HTMLInputElement.h:
              * html/HTMLTextAreaElement.h:
              * rendering/TextControlInnerElements.cpp:
              (WebCore::TextControlInnerTextElement::defaultEventHandler):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca076b99
  15. 04 May, 2010 1 commit
    • eric@webkit.org's avatar
      2010-05-04 Steven Lai <steven_lai@asia.apple.com> · 160d9409
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=37900
              <rdar://problem/7806164> cloneNode() does not preserve z-index with more than six digits
      
              * fast/dom/HTMLInputElement/clone-input-checked-expected.txt: Added.
              * fast/dom/HTMLInputElement/clone-input-checked.html: Added.
              * fast/dom/clone-node-z-index-expected.txt: Added.
              * fast/dom/clone-node-z-index.html: Added.
      2010-05-04  Steven Lai  <steven_lai@asia.apple.com>
      
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=37900
              <rdar://problem/7806164> cloneNode() does not preserve z-index with more than six digits
      
              Tests: fast/dom/HTMLInputElement/clone-input-checked.html
                     fast/dom/clone-node-z-index.html
      
              * dom/Element.cpp: undid the order change of calling copyNonAttributeProperties() before setAttributes()
              (WebCore::Element::cloneElementWithoutChildren): uncheck the previous radio button in the same radio button group only when the checked radio box is appended to the dom tree
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::updateCheckedRadioButtons):
              (WebCore::HTMLInputElement::attach):
              (WebCore::HTMLInputElement::setChecked):
              * html/HTMLInputElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      160d9409
  16. 01 May, 2010 1 commit
  17. 30 Apr, 2010 2 commits
    • tkent@chromium.org's avatar
      Implement interactive behavior of spin buttons. · e3920baf
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=27968
      
      Reviewed by Adele Peterson.
      
      WebCore:
      
      Introduce SpinButtonElement. It is a shadow element class for
      spin buttons. If the upper side of the element is clicked, calls
      HTMLInputElement::stepUpFromRenderer(1). If the lower button is
      clicked, calls HTMLInputElement::stepUpFromRenderer(-1).
      
      SpinButtonElement tracks the mouse pointer position, and
      RenderTheme sets ControlStates::SpinUpState if the pointer is on
      the upper side.
      
      Test: platform/mac/fast/forms/input-number-click.html
      
      * dom/Element.h:
      (WebCore::Element::isSpinButtonElement):
      * editing/VisibleSelection.cpp:
      (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
       Remove an assertion. lastEditablePositionBeforePositionInRoot() can
       return null in a case that m_end is at a shadow element (a spin button)
       and baseRoot is another shadow element (inner text block) in the same
       node (an INPUT element).
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::stepUpFromRenderer):
      * html/HTMLInputElement.h:
      (WebCore::HTMLInputElement::hasSpinButton):
       Add types supporting step attribute except RANGE.
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::nodeAtPoint):
      (WebCore::RenderTextControlSingleLine::forwardEvent):
      (WebCore::RenderTextControlSingleLine::preferredContentWidth):
      (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
      * rendering/RenderTextControlSingleLine.h:
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::controlStatesForRenderer):
      (WebCore::RenderTheme::isSpinUpButtonPartPressed):
      (WebCore::RenderTheme::isSpinUpButtonPartHovered):
      * rendering/RenderTheme.h:
      * rendering/TextControlInnerElements.cpp:
      (WebCore::SpinButtonElement::SpinButtonElement):
      (WebCore::SpinButtonElement::defaultEventHandler):
      * rendering/TextControlInnerElements.h:
      (WebCore::SpinButtonElement::isSpinButtonElement):
      (WebCore::SpinButtonElement::isEnabledFormControl):
      (WebCore::SpinButtonElement::onUpButton):
      
      LayoutTests:
      
      * platform/mac/fast/forms/input-number-click-expected.txt: Added.
      * platform/mac/fast/forms/input-number-click.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e3920baf
    • tkent@chromium.org's avatar
      2010-04-30 Kent Tamura <tkent@chromium.org> · 5c8ac40c
      tkent@chromium.org authored
              Reviewed by Adele Peterson.
      
              Mac implementation of outer-spin-button appearance, and anonymous
              element generation for <input type=number>.
              https://bugs.webkit.org/show_bug.cgi?id=32813
      
              input-appearance-spinbutton.html checks the appearances of various
              sizes of spin-buttons. input-appearance-spinbutton-size.html
              checks a spin-button height is equal to or less than the
              corresponding text field height.
      
              * platform/mac/fast/forms/input-appearance-spinbutton-expected.checksum: Added.
              * platform/mac/fast/forms/input-appearance-spinbutton-expected.png: Added.
              * platform/mac/fast/forms/input-appearance-spinbutton-expected.txt: Added.
              * platform/mac/fast/forms/input-appearance-spinbutton-size-expected.txt: Added.
              * platform/mac/fast/forms/input-appearance-spinbutton-size.html: Added.
              * platform/mac/fast/forms/input-appearance-spinbutton.html: Added.
      2010-04-30  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Adele Peterson.
      
              Mac implementation of outer-spin-button appearance, and anonymous
              element generation for <input type=number>.
              https://bugs.webkit.org/show_bug.cgi?id=32813
      
              The implementation uses NSStepperCell. Like the other Mac
              controls, it has only three candidates for sizes.
      
              The editable block of an input element is shrunk, and the
              anonymous block for a spin button is put on the right of the
              editable block.
      
              Tests: platform/mac/fast/forms/input-appearance-spinbutton-size.html
                     platform/mac/fast/forms/input-appearance-spinbutton.html
      
              * dom/Element.cpp:
              (WebCore::Element::pseudoStyleCacheIsInvalid):
              * dom/InputElement.h:
              (WebCore::InputElement::hasSpinButton):
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::hasSpinButton): Return true for NUMBER type.
              * platform/mac/ThemeMac.mm:
              (WebCore::sizeFromNSControlSize): Split the main part of sizeFromFont()
                to this in order to use stepperControlSizeForFont() instead of
                controlSizeForFont().
              (WebCore::sizeFromFont): Just calls sizeFromNSControlSize() with
                sizeFromFont(). No behavior changes.
              (WebCore::stepperSizes): Returns sizes for mini, small, and regular.
              (WebCore::stepperControlSizeForFont):
                Dedicated version of controlSizeForFont().
              (WebCore::stepper): Returns NSStepperCell object with specified settings.
              (WebCore::paintStepper):
              (WebCore::ThemeMac::controlSize): Support for OuterSpinButton.
              (WebCore::ThemeMac::minimumControlSize): ditto.
              (WebCore::ThemeMac::inflateControlPaintRect): ditto.
              (WebCore::ThemeMac::paint): ditto.
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::paintBoxDecorations):
                Move the content to paintBoxDecorationsWithSize().
              (WebCore::RenderBox::paintBoxDecorationsWithSize):
              * rendering/RenderBox.h: Declare paintBoxDecorationsWithSize().
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::~RenderTextControlSingleLine):
              (WebCore::RenderTextControlSingleLine::paintBoxDecorations):
                Call paintBoxDecorationsWithSize() with smaller width by decorationWidthRight().
              (WebCore::RenderTextControlSingleLine::addFocusRingRects):
                Add a rectangle of which width is smaller by decorationWidthRight().
              (WebCore::RenderTextControlSingleLine::layout):
                Adjust m_outerSpinButton position.
              (WebCore::RenderTextControlSingleLine::styleDidChange):
              (WebCore::RenderTextControlSingleLine::textBlockWidth):
              (WebCore::RenderTextControlSingleLine::decorationWidthRight):
              (WebCore::RenderTextControlSingleLine::preferredDecorationWidthRight):
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
                Creates an element for m_outerSpinButton if it is needed.
              (WebCore::RenderTextControlSingleLine::createInnerTextStyle):
              (WebCore::RenderTextControlSingleLine::createOuterSpinButtonStyle):
              * rendering/RenderTextControlSingleLine.h: Declare new methods and m_outerSpinButton.
              * rendering/RenderThemeMac.mm:
              (WebCore::RenderThemeMac::adjustRepaintRect): Support for OuterSpinButton.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5c8ac40c
  18. 23 Mar, 2010 1 commit
    • tkent@chromium.org's avatar
      2010-03-23 Kent Tamura <tkent@chromium.org> · 1c326f0c
      tkent@chromium.org authored
              Reviewed by Adam Barth.
      
              Add checks if setNeedsWillValidateCheck() and
              setNeedsValidityCheck() are called correctly.
              https://bugs.webkit.org/show_bug.cgi?id=34924
      
              Introduce HTMLFormControlElement::m_willValidate and
              m_isValid. They are the caches of willValidate() and
              isValidFormControlElement(). setNeedsWillValidateCheck() updates
              m_willValidate and setNeedsValidityCheck() updates m_isValid.
      
              willValidate() and isValidFormControlElement() have assertions to
              check m_willvalidate or m_isValid has the correct state. If
              setNeedsWillValidateCheck() or setNeedsValidityCheck() is needed
              to be called and is not called, these assertions fail.
      
              * html/HTMLButtonElement.h:
              (WebCore::HTMLButtonElement::recalcWillValidate):
              * html/HTMLFieldSetElement.h:
              (WebCore::HTMLFieldSetElement::recalcWillValidate):
              * html/HTMLFormControlElement.cpp:
              (WebCore::HTMLFormControlElement::HTMLFormControlElement):
              (WebCore::HTMLFormControlElement::parseMappedAttribute):
              (WebCore::HTMLFormControlElement::recalcWillValidate):
              (WebCore::HTMLFormControlElement::willValidate):
              (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
              (WebCore::HTMLFormControlElement::validationMessage):
              (WebCore::HTMLFormControlElement::isValidFormControlElement):
              (WebCore::HTMLFormControlElement::setNeedsValidityCheck):
              * html/HTMLFormControlElement.h:
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::setInputType):
              (WebCore::HTMLInputElement::parseMappedAttribute):
              (WebCore::HTMLInputElement::setValue):
              (WebCore::HTMLInputElement::recalcWillValidate):
              * html/HTMLInputElement.h:
              * html/HTMLTextAreaElement.cpp:
              (WebCore::HTMLTextAreaElement::setNonDirtyValue):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1c326f0c
  19. 19 Mar, 2010 1 commit
    • simon.fraser@apple.com's avatar
      2010-03-19 Simon Fraser <simon.fraser@apple.com> · ed5bcc4c
      simon.fraser@apple.com authored
              Reviewed by Dimitri Glazkov.
      
              https://bugs.webkit.org/show_bug.cgi?id=36387
              REGRESSION: Can "uncheck" radio buttons by clicking on them
      
              My change in r56174 caused radio buttons and checkboxes to go down the same code path by virtue
              of allowsIndeterminate(), but this broke save/restore behavior on radio buttons.
      
              Fix by saving and restoring both the intermediate and checked state for radio buttons
              and checkboxes, as well as the "current radio button" state.
      
              Test: fast/forms/radio-checkbox-restore-indeterminate.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::EventHandlingState::EventHandlingState): New struct to hold state between preDispatchEventHandler()
              and postDispatchEventHandler().
              (WebCore::HTMLInputElement::preDispatchEventHandler): Store intermedate and checked state
              and the current radio button.
              (WebCore::HTMLInputElement::postDispatchEventHandler): Restore state as appropriate.
              * html/HTMLInputElement.h: Add a comment to clarify how 'intermediate' interacts with 'checked', according
              to the spec.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ed5bcc4c
  20. 18 Mar, 2010 1 commit
    • simon.fraser@apple.com's avatar
      2010-03-18 Simon Fraser <simon.fraser@apple.com> · 1d9039f5
      simon.fraser@apple.com authored
              Reviewed by Dave Hyatt.
      
              https://bugs.webkit.org/show_bug.cgi?id=36273
              CSS3 :indeterminate and input type=radio test fails
      
              The :indeterminate pseudo-class should apply to both radio buttons and checkboxes.
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::setIndeterminate): Use allowsIndeterminate() to determine if the input
              supports the indeterminate state.
              (WebCore::HTMLInputElement::preDispatchEventHandler): Use allowsIndeterminate() to determine whether
              to handle the indeterminate state.
              (WebCore::HTMLInputElement::postDispatchEventHandler): Ditto.
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::allowsIndeterminate): New utility method, returns true for radio buttons
              and checkboxes.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1d9039f5
  21. 13 Feb, 2010 1 commit
    • tkent@chromium.org's avatar
      2010-02-13 Kent Tamura <tkent@chromium.org> · 592c5eda
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              Refactor parsing/serialization functions in HTMLInputElement.
              https://bugs.webkit.org/show_bug.cgi?id=34852
      
              - Rename formStringToDouble() to parseToDoubleForNumberType()
              - Rename formStringToDateComponents() to parseToDateComponents()
              - Rename formStringFromDouble() to serializeForNumberType()
              - Add serializeForDateTimeTypes()
                The code is moved from setValueAsDate() and setDateValue().
              - Add serialize()
      
              parseToDouble() is the top-level function to parse a
              type-dependent string and return a double
              value. parseToDoubleForNumber() and parseToDateComponents()
              functions are helper functions for it. serialize() is the
              top-level function to serialize a double value to a type-dependent
              string, and serializeForNumberType() and
              serializeForDateTimeTypes() are helper functions for it.
      
              No tests because of no functional changes.
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::stepMismatch):
              (WebCore::HTMLInputElement::getAllowedValueStep):
              (WebCore::HTMLInputElement::parseToDouble):
              (WebCore::HTMLInputElement::valueAsDate):
              (WebCore::HTMLInputElement::setValueAsDate):
              (WebCore::HTMLInputElement::setValueAsNumber):
              (WebCore::HTMLInputElement::serializeForDateTimeTypes):
              (WebCore::HTMLInputElement::serialize):
              (WebCore::HTMLInputElement::serializeForNumberType):
              (WebCore::HTMLInputElement::parseToDoubleForNumberType):
              (WebCore::HTMLInputElement::parseToDateComponents):
              * html/HTMLInputElement.h:
              * html/ValidityState.cpp:
              (WebCore::ValidityState::typeMismatch):
              * rendering/RenderSlider.cpp:
              (WebCore::SliderRange::valueFromElement):
              (WebCore::RenderSlider::updateFromElement):
              (WebCore::RenderSlider::setValueForPosition):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      592c5eda
  22. 11 Feb, 2010 1 commit
    • tkent@chromium.org's avatar
      2010-02-11 Kent Tamura <tkent@chromium.org> · 112bd507
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              Step attribute support for date&time types.
              https://bugs.webkit.org/show_bug.cgi?id=30847
      
              Add tests for ValidityState.stepMismatch, stepUp() and stepDown()
              for date, datetime, datetime-local, month, time, week types.
              Update valueAsDate and valueAsNumber tests for a string representation
              change.
      
              * fast/forms/ValidityState-stepMismatch-expected.txt: Added.
              * fast/forms/ValidityState-stepMismatch.html: Added.
              * fast/forms/input-stepup-stepdown-expected.txt: Added.
              * fast/forms/input-stepup-stepdown.html: Added.
              * fast/forms/input-valueasdate-datetime-expected.txt:
              * fast/forms/input-valueasdate-time-expected.txt:
              * fast/forms/input-valueasnumber-datetime-expected.txt:
              * fast/forms/input-valueasnumber-datetimelocal-expected.txt:
              * fast/forms/input-valueasnumber-time-expected.txt:
              * fast/forms/script-tests/ValidityState-stepMismatch.js: Added.
              * fast/forms/script-tests/input-stepup-stepdown.js: Added.
              * fast/forms/script-tests/input-valueasdate-datetime.js:
              * fast/forms/script-tests/input-valueasnumber-datetime.js:
      
      2010-02-11  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Step attribute support for date&time types.
              https://bugs.webkit.org/show_bug.cgi?id=30847
      
              - Add implementation for ValidityState.stepMismatch, stepUp() and
                stepDown() for date, datetime, datetime-local, month, time, week types.
              - Fix string representation of DateComponents.
      
              Tests: fast/forms/ValidityState-stepMismatch.html
                     fast/forms/input-stepup-stepdown.html
      
              * html/HTMLInputElement.cpp:
                - Change monthDefaultMaximum so that DateComponents::m_year doesn't overflow.
              (WebCore::HTMLInputElement::stepBase):
              (WebCore::HTMLInputElement::stepMismatch):
              (WebCore::HTMLInputElement::getStepParameters):
              (WebCore::HTMLInputElement::getAllowedValueStep):
              (WebCore::HTMLInputElement::applyStep):
                Renamed from applyStepForNumberOrRange(), and add support for other types.
              (WebCore::HTMLInputElement::stepUp): Rename applyStepForNumberOrRange().
              (WebCore::HTMLInputElement::stepDown): Rename applyStepForNumberOrRange().
              (WebCore::HTMLInputElement::setValueAsDate): Use setDateValue().
              (WebCore::HTMLInputElement::setDateValue):
                A helper function to make the best representation of DateComponents.
              (WebCore::HTMLInputElement::setValueAsNumber):  Use setDateValue().
              * html/HTMLInputElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      112bd507
  23. 28 Jan, 2010 2 commits
    • eric@webkit.org's avatar
      2010-01-28 Kent Tamura <tkent@chromium.org> · 40e39ec6
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              Rename ISODateTime.{cpp,h} to DateComponents.{cpp,h}
              https://bugs.webkit.org/show_bug.cgi?id=34245
      
              No functional changes.
      
              * GNUmakefile.am:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * html/DateComponents.cpp: Copied from WebCore/html/ISODateTime.cpp.
              (WebCore::DateComponents::maxWeekNumberInYear):
              (WebCore::DateComponents::parseYear):
              (WebCore::DateComponents::addDay):
              (WebCore::DateComponents::addMinute):
              (WebCore::DateComponents::parseTimeZone):
              (WebCore::DateComponents::parseMonth):
              (WebCore::DateComponents::parseDate):
              (WebCore::DateComponents::parseWeek):
              (WebCore::DateComponents::parseTime):
              (WebCore::DateComponents::parseDateTimeLocal):
              (WebCore::DateComponents::parseDateTime):
              (WebCore::DateComponents::setMillisecondsSinceMidnightInternal):
              (WebCore::DateComponents::setMillisecondsSinceEpochForDateInternal):
              (WebCore::DateComponents::setMillisecondsSinceEpochForDate):
              (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime):
              (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal):
              (WebCore::DateComponents::setMillisecondsSinceEpochForMonth):
              (WebCore::DateComponents::setMillisecondsSinceMidnight):
              (WebCore::DateComponents::setMillisecondsSinceEpochForWeek):
              (WebCore::DateComponents::millisecondsSinceEpochForTime):
              (WebCore::DateComponents::millisecondsSinceEpoch):
              (WebCore::DateComponents::toStringForTime):
              (WebCore::DateComponents::toString):
              * html/DateComponents.h: Copied from WebCore/html/ISODateTime.h.
              (WebCore::DateComponents::DateComponents):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::parseToDouble):
              (WebCore::HTMLInputElement::valueAsDate):
              (WebCore::HTMLInputElement::setValueAsDate):
              (WebCore::HTMLInputElement::setValueAsNumber):
              (WebCore::HTMLInputElement::formStringToDateComponents):
              * html/HTMLInputElement.h:
              * html/ISODateTime.cpp: Removed.
              * html/ISODateTime.h: Removed.
              * html/ValidityState.cpp:
              (WebCore::ValidityState::typeMismatch):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      40e39ec6
    • tkent@chromium.org's avatar
      2010-01-27 Kent Tamura <tkent@chromium.org> · dec81420
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              rangeOverflow/rangeUnderflow support for type=date
              https://bugs.webkit.org/show_bug.cgi?id=34209
      
              * fast/forms/ValidityState-rangeOverflow-date-expected.txt: Added.
              * fast/forms/ValidityState-rangeOverflow-date.html: Added.
              * fast/forms/ValidityState-rangeUnderflow-date-expected.txt: Added.
              * fast/forms/ValidityState-rangeUnderflow-date.html: Added.
              * fast/forms/script-tests/ValidityState-rangeOverflow-date.js: Added.
              * fast/forms/script-tests/ValidityState-rangeUnderflow-date.js: Added.
      
      2010-01-27  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              rangeOverflow/rangeUnderflow support for type=date
              https://bugs.webkit.org/show_bug.cgi?id=34209
      
              Add DATE type support to rangeUnderflow(), rangeOverflow(),
              minimum(), and maximum() of HTMLInputElement.
              In order to unify parsing code for value, min, and max strings,
              introduce parseToDouble() function and it is called by
              valueAsDate() and valueAsNumber() too.
      
              Tests: fast/forms/ValidityState-rangeOverflow-date.html
                     fast/forms/ValidityState-rangeUnderflow-date.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::rangeUnderflow): Support DATE type, and use parseToDouble().
              (WebCore::HTMLInputElement::rangeOverflow): ditto.
              (WebCore::HTMLInputElement::minimum): ditto.
              (WebCore::HTMLInputElement::maximum): ditto.
              (WebCore::HTMLInputElement::doubleValueFor): Added.
              (WebCore::HTMLInputElement::valueAsDate): Use parseToDouble().
              (WebCore::HTMLInputElement::valueAsNumber): Use parseToDouble().
              * html/HTMLInputElement.h: Declare parseToDouble().
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dec81420
  24. 26 Jan, 2010 1 commit
    • tkent@chromium.org's avatar
      2010-01-26 Kent Tamura <tkent@chromium.org> · 3fc69dc5
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              HTMLInputElement::valueAsNumber support except type=datetime-local.
              https://bugs.webkit.org/show_bug.cgi?id=32696
      
              input-valueasnumber-datetime-expected.txt and
              input-valueasnumber-time-expected.txt have FAIL lines because they
              test unimplemented features.
      
              * fast/forms/input-valueasnumber-date-expected.txt: Added.
              * fast/forms/input-valueasnumber-date.html: Added.
              * fast/forms/input-valueasnumber-datetime-expected.txt: Added.
              * fast/forms/input-valueasnumber-datetime.html: Added.
              * fast/forms/input-valueasnumber-month-expected.txt: Added.
              * fast/forms/input-valueasnumber-month.html: Added.
              * fast/forms/input-valueasnumber-number-expected.txt: Added.
              * fast/forms/input-valueasnumber-number.html: Added.
              * fast/forms/input-valueasnumber-range-expected.txt: Added.
              * fast/forms/input-valueasnumber-range.html: Added.
              * fast/forms/input-valueasnumber-time-expected.txt: Added.
              * fast/forms/input-valueasnumber-time.html: Added.
              * fast/forms/input-valueasnumber-unsupported-expected.txt: Added.
              * fast/forms/input-valueasnumber-unsupported.html: Added.
              * fast/forms/input-valueasnumber-week-expected.txt: Added.
              * fast/forms/input-valueasnumber-week.html: Added.
              * fast/forms/script-tests/input-valueasnumber-date.js: Added.
              * fast/forms/script-tests/input-valueasnumber-datetime.js: Added.
              * fast/forms/script-tests/input-valueasnumber-month.js: Added.
              * fast/forms/script-tests/input-valueasnumber-number.js: Added.
              * fast/forms/script-tests/input-valueasnumber-range.js: Added.
              * fast/forms/script-tests/input-valueasnumber-time.js: Added.
              * fast/forms/script-tests/input-valueasnumber-unsupported.js: Added.
              * fast/forms/script-tests/input-valueasnumber-week.js: Added.
      
      2010-01-26  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              HTMLInputElement::valueAsNumber support except type=datetime-local.
              https://bugs.webkit.org/show_bug.cgi?id=32696
      
              Tests: fast/forms/input-valueasnumber-date.html
                     fast/forms/input-valueasnumber-datetime.html
                     fast/forms/input-valueasnumber-month.html
                     fast/forms/input-valueasnumber-number.html
                     fast/forms/input-valueasnumber-range.html
                     fast/forms/input-valueasnumber-time.html
                     fast/forms/input-valueasnumber-unsupported.html
                     fast/forms/input-valueasnumber-week.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::valueAsNumber):
                According to the specification, we should return NaN for invalid values.
              (WebCore::HTMLInputElement::setValueAsNumber):
                According to the specification, throws NOT_SUPPORTED_ERR for Infinitiy or NaN,
                and throws INVALID_STATE_ERR for unsupported types.
              (WebCore::HTMLInputElement::formStringToDouble):
                According to the step 14 of Real Number in the specification, we
                should round -0 to 0.
              * html/HTMLInputElement.h: Declare valueAsNumber() and setValueAsNumber().
              * html/HTMLInputElement.idl: Add valueAsNumber.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3fc69dc5
  25. 20 Dec, 2009 1 commit
    • tkent@chromium.org's avatar
      2009-12-20 Kent Tamura <tkent@chromium.org> · 72d02311
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              A test for Date binding.
              https://bugs.webkit.org/show_bug.cgi?id=32698
      
              * fast/forms/input-valueasdate-expected.txt: Added.
              * fast/forms/input-valueasdate.html: Added.
              * fast/forms/script-tests/input-valueasdate.js: Added.
      
      2009-12-20  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Add support for JavaScriptCore Date binding.
              https://bugs.webkit.org/show_bug.cgi?id=32698
      
              This is needed for HTMLInputElement::valueAsDate and
              HTMLTimeElement::valueAsDate.
      
              A Date instance is mapped to a double value in C++.
              - If null or undefined is set to a JavaScript property, C++ setter
                function receives NaN.
              - If a getter C++ function returns NaN or infinity, a JavaScript
                property returns null.
      
              Test: fast/forms/input-valueasdate.html
      
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::jsDateOrNull): Implement the above.
              (WebCore::valueToDate): ditto.
              * bindings/js/JSDOMBinding.h: Declare them.
              * bindings/scripts/CodeGeneratorJS.pm: Produce jsDateOrNull() or
                valueToDate() for Date type.
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::valueAsDate): Temporal implementation.
              (WebCore::HTMLInputElement::setValueAsDate): ditto.
              * html/HTMLInputElement.h:
              * html/HTMLInputElement.idl: Declare valueAsDate.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      72d02311
  26. 16 Dec, 2009 1 commit
    • eric@webkit.org's avatar
      2009-12-16 Zelidrag Hornung <zelidrag@chromium.org> · b6e6211e
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=32261
              Added ability to separate the autocomplete suggestion previewing from
              the actual accepting of the suggested value in HTMLInputElement.
              This element (it's single line text incarnation) can now
              be put in suggestion mode where renderer might display the suggested
              value without making it automatically exposed to JavaScript.
      
              No new tests. This new methods are not exposed yet. It's use will be
              platform specific. PopupMenu and Chromium specific changes will be
              separated based on Darin Adler's comments.
      
              * dom/InputElement.h:
              (WebCore::InputElementData::suggestedValue):
              (WebCore::InputElementData::setSuggestedValue):
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::suggestedValue):
              (WebCore::HTMLInputElement::setSuggestedValue):
              (WebCore::HTMLInputElement::setValue):
              (WebCore::HTMLInputElement::setValueFromRenderer):
              * html/HTMLInputElement.h:
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::updateFromElement):
              * wml/WMLInputElement.cpp:
              (WebCore::WMLInputElement::suggestedValue):
              * wml/WMLInputElement.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b6e6211e
  27. 07 Dec, 2009 1 commit
    • tkent@chromium.org's avatar
      2009-12-07 Kent Tamura <tkent@chromium.org> · a65e5433
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              Add tests for HTMLInputElement::stepUp() and stepDown().
              https://bugs.webkit.org/show_bug.cgi?id=27451
      
              * fast/forms/input-step-number-expected.txt: Added.
              * fast/forms/input-step-number.html: Added.
              * fast/forms/input-step-range-expected.txt: Added.
              * fast/forms/input-step-range.html: Added.
              * fast/forms/input-step-unsupported-expected.txt: Added.
              * fast/forms/input-step-unsupported.html: Added.
              * fast/forms/script-tests/input-step-number.js: Added.
              * fast/forms/script-tests/input-step-range.js: Added.
              * fast/forms/script-tests/input-step-unsupported.js: Added.
      
      2009-12-07  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Add support for HTMLInputElement::stepUp() and stepDown() for
              type=number and type=range.
              https://bugs.webkit.org/show_bug.cgi?id=27451
      
              Our implementation of stepUp() and stepDown() rounds the resultant
              value to conform to the step value.
              Change the number-string conversion method for RenderSlider to be
              consistent with type=number.
      
              Tests: fast/forms/input-step-number.html
                     fast/forms/input-step-range.html
                     fast/forms/input-step-unsupported.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::rangeUnderflow): Unify the code for NUMBER and RANGE.
              (WebCore::HTMLInputElement::rangeOverflow): Unify the code for NUMBER and RANGE.
              (WebCore::HTMLInputElement::minimum): Renamed from rangeMinimum(), and support for NUMBER.
              (WebCore::HTMLInputElement::maximum): Renamed from rangeMaximum(), and support for NUMBER.
              (WebCore::HTMLInputElement::stepBase):
              (WebCore::HTMLInputElement::stepMismatch): Use stepBase().
              (WebCore::HTMLInputElement::applyStepForNumberOrRange):
              (WebCore::HTMLInputElement::stepUp):
              (WebCore::HTMLInputElement::stepDown):
              (WebCore::HTMLInputElement::formStringFromDouble):
              * html/HTMLInputElement.h:
              (WebCore::HTMLInputElement::stepUp):
              (WebCore::HTMLInputElement::stepDown):
              * html/HTMLInputElement.idl: Add stepUp() and stepDown().
              * rendering/RenderSlider.cpp:
              (WebCore::SliderRange::SliderRange): Sync with rangeMinimum()/rangeMaximum() renaming.
              (WebCore::RenderSlider::updateFromElement): Use formStringFromDouble().
              (WebCore::RenderSlider::setValueForPosition): Use formStringFromDouble().
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a65e5433
  28. 02 Dec, 2009 1 commit
    • timothy@apple.com's avatar
      WebCore: Expose a function to set the value of an input element on behalf of the user. · 7157c6d7
      timothy@apple.com authored
      This function will dispatch the change event so the page is notified when autofill
      happens. Also dispatch a change event when a select element is changed by autofill.
      
      <rdar://problem/6760590> Would like a way to detect a login form AutoFill from JavaScript
      
      Reviewed by Darin Adler.
      
      * WebCore.xcodeproj/project.pbxproj: Added the DOMHTMLInputElementPrivate.h header.
      * bindings/objc/DOMHTML.mm:
      (-[DOMHTMLSelectElement _activateItemAtIndex:]): Call setSelectedIndexByUser instead so
      a change event is fired. This method is called by Safari autofill.
      * dom/Document.cpp:
      (WebCore::Document::setFocusedNode): Use dispatchFormControlChangeEvent instead
      of dispatching the change event directly to be consistent.
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLInputElement::setValueForUser): Added. Calls setValue with the sendChangeEvent
      (WebCore::HTMLInputElement::setValue): Added the optional sendChangeEvent argument. Mimics setChecked.
      * html/HTMLInputElement.h:
      * html/HTMLInputElement.idl: Added setValueForUser for non-JS languages.
      * html/InputElement.h: Added setValueForUser.
      
      WebKit/mac: Migrate DOMHTMLInputElementPrivate.h as a private header.
      
      Reviewed by Darin Adler.
      
      * MigrateHeaders.make:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7157c6d7
  29. 18 Nov, 2009 2 commits
    • tkent@chromium.org's avatar
      2009-11-18 Kent Tamura <tkent@chromium.org> · c242b0a4
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              Tests for ValidityState.typeMismatch for the following types of INPUT element:
                  date, datetime, datetime-local, month, time and week
              https://bugs.webkit.org/show_bug.cgi?id=31342
      
              * fast/forms/ValidityState-typeMismatch-date-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-date.html: Added.
              * fast/forms/ValidityState-typeMismatch-datetime-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-datetime.html: Added.
              * fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-datetimelocal.html: Added.
              * fast/forms/ValidityState-typeMismatch-month-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-month.html: Added.
              * fast/forms/ValidityState-typeMismatch-time-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-time.html: Added.
              * fast/forms/ValidityState-typeMismatch-week-expected.txt: Added.
              * fast/forms/ValidityState-typeMismatch-week.html: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-date.js: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-datetime.js: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-month.js: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-time.js: Added.
              * fast/forms/script-tests/ValidityState-typeMismatch-week.js: Added.
      2009-11-18  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Add support for ValidityState.typeMismatch for the following INPUT types:
                date datetime datetime-local month time week
              https://bugs.webkit.org/show_bug.cgi?id=31342
      
              Tests: fast/forms/ValidityState-typeMismatch-date.html
                     fast/forms/ValidityState-typeMismatch-datetime.html
                     fast/forms/ValidityState-typeMismatch-datetimelocal.html
                     fast/forms/ValidityState-typeMismatch-month.html
                     fast/forms/ValidityState-typeMismatch-time.html
                     fast/forms/ValidityState-typeMismatch-week.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::formStringToISODateTime): Check the type
                validity of the specified type and string using the ISODateTime class.
              * html/HTMLInputElement.h:
              * html/ValidityState.cpp:
              (WebCore::ValidityState::typeMismatch): Check the type validity
                for date, datetime, datetime-local, month, time and week with
                HTMLInputElemtn::formStringToISODateTime()
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c242b0a4
    • eric@webkit.org's avatar
      2009-11-18 Kent Tamura <tkent@chromium.org> · 8b47b6c7
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              Add tests for ValidityState.stepMismatch.
              https://bugs.webkit.org/show_bug.cgi?id=31331
      
              * fast/forms/ValidityState-stepMismatch-number-expected.txt: Added.
              * fast/forms/ValidityState-stepMismatch-number.html: Added.
              * fast/forms/ValidityState-stepMismatch-range-expected.txt: Added.
              * fast/forms/ValidityState-stepMismatch-range.html: Added.
              * fast/forms/ValidityState-stepMismatch-unsupported-expected.txt: Added.
              * fast/forms/ValidityState-stepMismatch-unsupported.html: Added.
              * fast/forms/input-step-expected.txt: Added.
              * fast/forms/input-step.html: Added.
              * fast/forms/script-tests/ValidityState-stepMismatch-number.js: Added.
              * fast/forms/script-tests/ValidityState-stepMismatch-range.js: Added.
              * fast/forms/script-tests/ValidityState-stepMismatch-unsupported.js: Added.
              * fast/forms/script-tests/input-step.js: Added.
      2009-11-18  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Support for step attribute and ValidityStae.stepMismatch for
              type=number and range.  stepMismatch will be false if the
              difference between the current value and a multiple of the step
              value is very small.
      
              Change the behavior of RenderSlider so that it always has a value
              rounded to the step attribute value.
      
              https://bugs.webkit.org/show_bug.cgi?id=31331
      
              Tests: fast/forms/ValidityState-stepMismatch-number.html
                     fast/forms/ValidityState-stepMismatch-range.html
                     fast/forms/ValidityState-stepMismatch-unsupported.html
                     fast/forms/input-step.html
      
              * html/HTMLAttributeNames.in: Add "step".
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::stepMismatch):
              (WebCore::HTMLInputElement::getStepParameters):
              (WebCore::HTMLInputElement::getAllowedValueStep):
              * html/HTMLInputElement.h:
              * html/HTMLInputElement.idl: Add "step".
              * html/ValidityState.cpp:
              (WebCore::ValidityState::stepMismatch): Forward to HTMLInputElement::stepMismatch().
              * html/ValidityState.h:
              * rendering/RenderSlider.cpp:
              (WebCore::SliderRange::SliderRange):
              (WebCore::SliderRange::clampValue):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8b47b6c7
  30. 14 Nov, 2009 1 commit
    • tkent@chromium.org's avatar
      2009-11-14 Kent Tamura <tkent@chromium.org> · fe6c71e0
      tkent@chromium.org authored
              Reviewed by Darin Adler.
      
              Add tests for reading/writing .type property of HTMLInputElement.
              https://bugs.webkit.org/show_bug.cgi?id=29004
      
              * fast/forms/input-type-change3-expected.txt: Added.
              * fast/forms/input-type-change3.html: Added.
              * fast/forms/script-tests/input-type-change3.js: Added.
      
      2009-11-14  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              - Recognizes date/datetime/datetime-local/month/time/week types of INPUT element.
                They have no dedicated UI and no type validation for now.
              - Clean up setInputType() and formControlType() of HTMLInputElement.
              https://bugs.webkit.org/show_bug.cgi?id=29004
      
              Test: fast/forms/input-type-change3.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::valueMissing):
              (WebCore::HTMLInputElement::patternMismatch):
              (WebCore::HTMLInputElement::tooLong):
              (WebCore::createTypeMap): Initializer for a static local variable.
              (WebCore::HTMLInputElement::setInputType):
              (WebCore::createFormControlTypes): Initializer for a static local variable.
              (WebCore::HTMLInputElement::formControlType):
              (WebCore::HTMLInputElement::saveFormControlState):
              (WebCore::HTMLInputElement::restoreFormControlState):
              (WebCore::HTMLInputElement::accessKeyAction):
              (WebCore::HTMLInputElement::rendererIsNeeded):
              (WebCore::HTMLInputElement::createRenderer):
              (WebCore::HTMLInputElement::appendFormData):
              (WebCore::HTMLInputElement::isTextField):
              (WebCore::HTMLInputElement::valueWithDefault):
              (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
              (WebCore::HTMLInputElement::defaultEventHandler):
              (WebCore::HTMLInputElement::isRequiredFormControl):
              (WebCore::HTMLInputElement::dataList):
              * html/HTMLInputElement.h: Add new values to InputType enum, and define numberOfTypes.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fe6c71e0
  31. 27 Oct, 2009 1 commit
    • dbates@webkit.org's avatar
      2009-10-26 Daniel Bates <dbates@webkit.org> · c6b0081f
      dbates@webkit.org authored
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=30491
      
              Fixes an issue where pressing return/enter on the keyboard 
              in <isindex> does not submit it if is not within a <form>.
      
              According to the HTML 2.0 thru HTML 4.01 spec 
              (http://www.w3.org/MarkUp/html-spec/html-spec_7.html#SEC7.5), the 
              <isindex> element does not need to be within a <form> element in 
              order to submit it. It can submitted on its own. Also, if present,
              the href property of the <base> element will dictate where to submit
              the value of the <isindex> element (this is analogous to the action 
              property of the <form> element).
      
              Tests: http/tests/misc/isindex-with-no-form-base-href.html
                     http/tests/misc/isindex-with-no-form.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::defaultEventHandler): Calls createTemporaryFormForIsIndex()
              to create a <form> if none is present and we are an <isindex> element.
              (WebCore::HTMLInputElement::createTemporaryFormForIsIndex): Added.
              * html/HTMLInputElement.h:
      2009-10-26  Daniel Bates  <dbates@webkit.org>
      
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=30491
      
              Test that the <isindex> element can be submitted without being enclosed
              within a <form> element. Also tests that the href property of the <base>
              element can be used to direct where the submission is sent.
      
              * http/tests/misc/isindex-with-no-form-base-href-expected.txt: Added.
              * http/tests/misc/isindex-with-no-form-base-href.html: Added.
              * http/tests/misc/isindex-with-no-form-expected.txt: Added.
              * http/tests/misc/isindex-with-no-form.html: Added.
              * http/tests/misc/resources/isindex-with-no-form-base-href-submit.html: Added.
              * http/tests/misc/resources/isindex-with-no-form-base-href.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c6b0081f
  32. 06 Oct, 2009 1 commit
    • eric@webkit.org's avatar
      2009-10-06 Kent Tamura <tkent@chromium.org> · c6fa8a5a
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              Implement min/max attributes, ValidityState.rangeUnderflow and
              ValidityState.rangeOverflow for <input type=number> and <input type=range>
              https://bugs.webkit.org/show_bug.cgi?id=29069
      
              * fast/forms/ValidityState-rangeOverflow-number-expected.txt: Added.
              * fast/forms/ValidityState-rangeOverflow-number.html: Added.
              * fast/forms/ValidityState-rangeOverflow-range-expected.txt: Added.
              * fast/forms/ValidityState-rangeOverflow-range.html: Added.
              * fast/forms/ValidityState-rangeUnderflow-number-expected.txt: Added.
              * fast/forms/ValidityState-rangeUnderflow-number.html: Added.
              * fast/forms/ValidityState-rangeUnderflow-range-expected.txt: Added.
              * fast/forms/ValidityState-rangeUnderflow-range.html: Added.
              * fast/forms/input-minmax-expected.txt: Added.
              * fast/forms/input-minmax.html: Added.
              * fast/forms/script-tests/ValidityState-rangeOverflow-number.js: Added.
              * fast/forms/script-tests/ValidityState-rangeOverflow-range.js: Added.
              * fast/forms/script-tests/ValidityState-rangeUnderflow-number.js: Added.
              * fast/forms/script-tests/ValidityState-rangeUnderflow-range.js: Added.
              * fast/forms/script-tests/input-minmax.js: Added.
      2009-10-06  Kent Tamura  <tkent@chromium.org>
      
              Reviewed by Darin Adler.
      
              Implement min/max attributes, ValidityState.rangeUnderflow and
              ValidityState.rangeOverflow for <input type=number> and <input type=range>
              https://bugs.webkit.org/show_bug.cgi?id=29069
      
              HTMLInputElement::max and min are not defined for COM because they
              conflict with the standard min() and max() macros.
      
              Tests: fast/forms/ValidityState-rangeOverflow-number.html
                     fast/forms/ValidityState-rangeOverflow-range.html
                     fast/forms/ValidityState-rangeUnderflow-number.html
                     fast/forms/ValidityState-rangeUnderflow-range.html
                     fast/forms/input-minmax.html
      
              * html/HTMLInputElement.cpp:
              (WebCore::HTMLInputElement::rangeUnderflow):
              (WebCore::HTMLInputElement::rangeOverflow):
              (WebCore::HTMLInputElement::rangeMinimum):
              (WebCore::HTMLInputElement::rangeMaximum):
              * html/HTMLInputElement.h:
              * html/HTMLInputElement.idl:
              * html/ValidityState.cpp:
              (WebCore::ValidityState::rangeUnderflow):
              (WebCore::ValidityState::rangeOverflow):
              * html/ValidityState.h:
              * rendering/RenderSlider.cpp:
              (WebCore::SliderRange::SliderRange):
              (WebCore::SliderRange::valueFromElement):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c6fa8a5a
  33. 05 Oct, 2009 1 commit
    • eric@webkit.org's avatar
      2009-10-05 Eric Seidel <eric@webkit.org> · 4bd1c43b
      eric@webkit.org authored
              No review, rolling out r49104.
              http://trac.webkit.org/changeset/49104
      
              * fast/forms/ValidityState-rangeOverflow-number-expected.txt: Removed.
              * fast/forms/ValidityState-rangeOverflow-number.html: Removed.
              * fast/forms/ValidityState-rangeOverflow-range-expected.txt: Removed.
              * fast/forms/ValidityState-rangeOverflow-range.html: Removed.
              * fast/forms/ValidityState-rangeUnderflow-number-expected.txt: Removed.
              * fast/forms/ValidityState-rangeUnderflow-number.html: Removed.
              * fast/forms/ValidityState-rangeUnderflow-range-expected.txt: Removed.
              * fast/forms/ValidityState-rangeUnderflow-range.html: Removed.
              * fast/forms/input-minmax-expected.txt: Removed.
              * fast/forms/input-minmax.html: Removed.
              * fast/forms/script-tests/ValidityState-rangeOverflow-number.js: Removed.
              * fast/forms/script-tests/ValidityState-rangeOverflow-range.js: Removed.
              * fast/forms/script-tests/ValidityState-rangeUnderflow-number.js: Removed.
              * fast/forms/script-tests/ValidityState-rangeUnderflow-range.js: Removed.
              * fast/forms/script-tests/input-minmax.js: Removed.
      2009-10-05  Eric Seidel  <eric@webkit.org>
      
              No review, rolling out r49104.
              http://trac.webkit.org/changeset/49104
      
              * html/HTMLInputElement.cpp:
              * html/HTMLInputElement.h:
              * html/HTMLInputElement.idl:
              * html/ValidityState.cpp:
              * html/ValidityState.h:
              (WebCore::ValidityState::rangeUnderflow):
              (WebCore::ValidityState::rangeOverflow):
              * rendering/RenderSlider.cpp:
              (WebCore::SliderRange::SliderRange):
              (WebCore::SliderRange::valueFromElement):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4bd1c43b