Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: Source/WebCore/rendering/RenderFileUploadControl.cpp

Issue 7792032: Merge 94045 - REGRESSION(r88115): Disabling a file upload control causes an endless busyloop. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderFileUploadControl.cpp
===================================================================
--- Source/WebCore/rendering/RenderFileUploadControl.cpp (revision 94056)
+++ Source/WebCore/rendering/RenderFileUploadControl.cpp (working copy)
@@ -63,8 +63,15 @@
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
ASSERT(input->isFileUpload());
- if (HTMLInputElement* button = uploadButton())
- button->setDisabled(!theme()->isEnabled(this));
+ if (HTMLInputElement* button = uploadButton()) {
+ bool newDisabled = !theme()->isEnabled(this);
+ // We should avoid to call HTMLFormControlElement::setDisabled() as
+ // possible because setAttribute() in setDisabled() can cause style
+ // recalculation, and HTMLFormControlElement::recalcStyle() calls
+ // updateFromElement() eventually.
+ if (button->disabled() != newDisabled)
+ button->setDisabled(newDisabled);
+ }
// This only supports clearing out the files, but that's OK because for
// security reasons that's the only change the DOM is allowed to make.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698