⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 94059 in webkit


Ignore:
Timestamp:
Aug 30, 2011, 1:07:08 AM (15 years ago)
Author:
tkent@chromium.org
Message:

Merge 94045 - REGRESSION(r88115): Disabling a file upload control causes an endless busyloop.
https://bugs.webkit.org/show_bug.cgi?id=66659

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/forms/file/disabling-file-busy-loop.html

  • rendering/RenderFileUploadControl.cpp:

(WebCore::RenderFileUploadControl::updateFromElement):
Don't call setDisabled() if the disabled status is not changed.
setDisabled() causes styleRecalc(), and
HTMLFormControlElement::styleRecalc() causes
updateFromElement(). updateFromElement() should not call
setDisabled() again.

LayoutTests:

  • fast/forms/file/disabling-file-busy-loop-expected.txt: Added.
  • fast/forms/file/disabling-file-busy-loop.html: Added.

TBR=tkent@chromium.org
BUG=94710
Review URL: http://codereview.chromium.org/7792032

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/835/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r91566 r94059  
    6464    ASSERT(input->isFileUpload());
    6565
    66     if (HTMLInputElement* button = uploadButton())
    67         button->setDisabled(!theme()->isEnabled(this));
     66    if (HTMLInputElement* button = uploadButton()) {
     67        bool newDisabled = !theme()->isEnabled(this);
     68        // We should avoid to call HTMLFormControlElement::setDisabled() as
     69        // possible because setAttribute() in setDisabled() can cause style
     70        // recalculation, and HTMLFormControlElement::recalcStyle() calls
     71        // updateFromElement() eventually.
     72        if (button->disabled() != newDisabled)
     73            button->setDisabled(newDisabled);
     74    }
    6875
    6976    // This only supports clearing out the files, but that's OK because for
Note: See TracChangeset for help on using the changeset viewer.