Reviewed many times by darin, hyatt.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2006 19:42:41 +0000 (19:42 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2006 19:42:41 +0000 (19:42 +0000)
commit7d972060fb8cdc997d1b4975eea4ac376799aa3e
treef2bfff984a746bf7d61d18883384dcc85684e80e
parent295cb0eb54d9c4a7c00b900b828283138bf1ae1b
    Reviewed many times by darin, hyatt.

        Switch to new engine-based implementation of <input type="file">

        * WebCore.exp: Remove obsolete symbol WebCoreFileButton
        * WebCore.xcodeproj/project.pbxproj: Remove files for old widget-based
        control, add files for new engine-based control
        * css/CSSSelector.cpp: Add support for new
        '-webkit-file-upload-button' pseudo element
        (WebCore::CSSSelector::extractPseudoType):
        * css/CSSSelector.h: Ditto.
        (WebCore::CSSSelector::):
        * css/cssstyleselector.cpp: Ditto.
        (WebCore::CSSStyleSelector::checkOneSelector):
        * html/HTMLInputElement.cpp: Send click events to new control
        (WebCore::HTMLInputElement::select):
        (WebCore::HTMLInputElement::click):
        (WebCore::HTMLInputElement::createRenderer):
        (WebCore::HTMLInputElement::valueWithDefault):
        (WebCore::HTMLInputElement::defaultEventHandler):
        * html/HTMLTextFieldInnerElement.h: Add 'virtual' keyword
        (WebCore::HTMLTextFieldInnerElement::shadowParentNode):
        * platform/FileButton.h: Removed.
        * platform/FileChooser.h: Added. This is the replacement for
        FileButton.h
        (WebCore::FileChooser::filename):
        (WebCore::FileChooser::icon):
        (WebCore::FileChooser::uploadControl):
        (WebCore::FileChooser::document):
        * platform/Icon.h: Added new platform-specific class representing a
        file icon.
        * platform/LocalizedStrings.h:
        * platform/mac/FileButtonMac.mm: Removed.
        * platform/mac/FileChooserMac.mm: Added. This is the replacement for
        FileButtonMac.mm
        (-[OpenPanelController initWithFileChooser:]):
        (-[OpenPanelController fileChooserDetachingSoon]):
        (-[OpenPanelController beginSheet]):
        (-[OpenPanelController chooseFilename:]):
        (-[OpenPanelController cancel]):
        (WebCore::FileChooser::FileChooser):
        (WebCore::FileChooser::~FileChooser):
        (WebCore::FileChooser::openFileChooser):
        (WebCore::FileChooser::basenameForWidth):
        (WebCore::FileChooser::uploadControlDetaching):
        (WebCore::FileChooser::chooseFile):
        * platform/mac/IconMac.mm: Added.
        (WebCore::Icon::Icon):
        (WebCore::Icon::~Icon):
        (WebCore::Icon::newIconForFile):
        (WebCore::Icon::paint):
        * platform/mac/LocalizedStringsMac.mm: Call across bridge to get
        localized strings.
        (WebCore::fileButtonChooseFileLabel):
        (WebCore::fileButtonNoFileSelectedLabel):
        * rendering/RenderButton.cpp: Extract method setText() from
        updateFromElement.
        (WebCore::RenderButton::updateFromElement):
        (WebCore::RenderButton::setText):
        * rendering/RenderButton.h: Add declaration for new setText method.
        * rendering/RenderFileButton.cpp: Removed.
        * rendering/RenderFileButton.h: Removed.
        * rendering/RenderFileUploadControl.cpp: Added. This is the
        replacement for RenderFileButton.cpp.
        (WebCore::RenderFileUploadInnerFileBox::renderName):
        (WebCore::HTMLFileUploadInnerButtonElement::isShadowNode):
        (WebCore::HTMLFileUploadInnerButtonElement::shadowParentNode):
        (WebCore::RenderFileUploadControl::RenderFileUploadControl):
        (WebCore::RenderFileUploadControl::~RenderFileUploadControl):
        (WebCore::RenderFileUploadControl::setStyle):
        (WebCore::RenderFileUploadControl::updateIconAndFilename):
        (WebCore::RenderFileUploadControl::click):
        (WebCore::RenderFileUploadControl::updateFromElement):
        (WebCore::RenderFileUploadControl::maxFilenameWidth):
        (WebCore::RenderFileUploadControl::createButtonStyle):
        (WebCore::RenderFileUploadControl::paintObject):
        (WebCore::RenderFileUploadInnerFileBox::RenderFileUploadInnerFileBox):
        (WebCore::RenderFileUploadInnerFileBox::setStyle):
        (WebCore::RenderFileUploadInnerFileBox::layout):
        (WebCore::RenderFileUploadInnerFileBox::setHasIcon):
        (WebCore::RenderFileUploadInnerFileBox::setFilename):
        (WebCore::RenderFileUploadInnerFileBox::calcMinMaxWidth):
        (WebCore::HTMLFileUploadInnerButtonElement::HTMLFileUploadInnerButtonElement):
        (WebCore::HTMLFileUploadInnerButtonElement::createRenderer):
        * rendering/RenderFileUploadControl.h: Added. This is the replacement
        for RenderFileButton.h.
        (WebCore::RenderFileUploadControl::renderName):
        * rendering/RenderStyle.cpp: Add support for
        -webkit-file-upload-button pseudo element.
        (WebCore::):
        (WebCore::pseudoBit):
        * rendering/RenderStyle.h: Ditto.
        (WebCore::RenderStyle::):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/css/CSSSelector.cpp
WebCore/css/CSSSelector.h
WebCore/css/cssstyleselector.cpp
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLTextFieldInnerElement.h
WebCore/platform/FileButton.h [deleted file]
WebCore/platform/FileChooser.h [new file with mode: 0644]
WebCore/platform/Icon.h [new file with mode: 0644]
WebCore/platform/LocalizedStrings.h
WebCore/platform/mac/FileButtonMac.mm [deleted file]
WebCore/platform/mac/FileChooserMac.mm [new file with mode: 0644]
WebCore/platform/mac/IconMac.mm [new file with mode: 0644]
WebCore/platform/mac/LocalizedStringsMac.mm
WebCore/rendering/RenderButton.cpp
WebCore/rendering/RenderButton.h
WebCore/rendering/RenderFileButton.cpp [deleted file]
WebCore/rendering/RenderFileButton.h [deleted file]
WebCore/rendering/RenderFileUploadControl.cpp [new file with mode: 0644]
WebCore/rendering/RenderFileUploadControl.h [new file with mode: 0644]
WebCore/rendering/RenderStyle.cpp
WebCore/rendering/RenderStyle.h