Changeset 91566 in webkit


Ignore:
Timestamp:
Jul 22, 2011, 6:40:59 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r89535): Form reset does not repaint a file upload control.
https://bugs.webkit.org/show_bug.cgi?id=65008

Patch by Kentaro Hara <haraken@google.com> on 2011-07-22
Reviewed by Kent Tamura.

Source/WebCore:

This patch fixes the code so that the file upload control is repainted
in updateFromElement() if no files are selected.

Tests: fast/forms/file-input-reset.html

  • rendering/RenderFileUploadControl.cpp:

(WebCore::RenderFileUploadControl::updateFromElement): Calls repaint() if no files are selected.

LayoutTests:

This patch fixes the code so that the file upload control is repainted
in updateFromElement() if no files are selected. The added test checks
if the label next to the file chooser button becomes "No file chosen"
when we press the reset button.

  • fast/forms/file-input-reset-expected.html: Added.
  • fast/forms/file-input-reset.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91564 r91566  
     12011-07-22  Kentaro Hara  <haraken@google.com>
     2
     3        REGRESSION(r89535): Form reset does not repaint a file upload control.
     4        https://bugs.webkit.org/show_bug.cgi?id=65008
     5
     6        Reviewed by Kent Tamura.
     7
     8        This patch fixes the code so that the file upload control is repainted
     9        in updateFromElement() if no files are selected. The added test checks
     10        if the label next to the file chooser button becomes "No file chosen"
     11        when we press the reset button.
     12
     13        * fast/forms/file-input-reset-expected.html: Added.
     14        * fast/forms/file-input-reset.html: Added.
     15
    1162011-07-22  John Knottenbelt  <jknotten@chromium.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r91565 r91566  
     12011-07-22  Kentaro Hara  <haraken@google.com>
     2
     3        REGRESSION(r89535): Form reset does not repaint a file upload control.
     4        https://bugs.webkit.org/show_bug.cgi?id=65008
     5
     6        Reviewed by Kent Tamura.
     7
     8        This patch fixes the code so that the file upload control is repainted
     9        in updateFromElement() if no files are selected.
     10
     11        Tests: fast/forms/file-input-reset.html
     12
     13        * rendering/RenderFileUploadControl.cpp:
     14        (WebCore::RenderFileUploadControl::updateFromElement): Calls repaint() if no files are selected.
     15
    1162011-07-22  Ilya Tikhonovsky  <loislo@chromium.org>
    217
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r90250 r91566  
    6161void RenderFileUploadControl::updateFromElement()
    6262{
     63    HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     64    ASSERT(input->isFileUpload());
     65
    6366    if (HTMLInputElement* button = uploadButton())
    6467        button->setDisabled(!theme()->isEnabled(this));
     68
     69    // This only supports clearing out the files, but that's OK because for
     70    // security reasons that's the only change the DOM is allowed to make.
     71    FileList* files = input->files();
     72    ASSERT(files);
     73    if (files && files->isEmpty())
     74        repaint();
    6575}
    6676
Note: See TracChangeset for help on using the changeset viewer.