Changeset 136915 in webkit
- Timestamp:
- Dec 6, 2012, 6:18:01 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136913 r136915 1 2012-12-06 Kunihiko Sakamoto <ksakamoto@chromium.org> 2 3 Disabled file input box stops a certain other div from being rendered 4 https://bugs.webkit.org/show_bug.cgi?id=104226 5 6 Reviewed by Dimitri Glazkov. 7 8 Add a test to ensure that sibling of disabled file input is correctly rendered. 9 10 * fast/forms/file/sibling-of-disabled-file-input-expected.txt: Added. 11 * fast/forms/file/sibling-of-disabled-file-input.html: Added. 12 1 13 2012-12-06 Dominic Cooney <dominicc@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r136913 r136915 1 2012-12-06 Kunihiko Sakamoto <ksakamoto@chromium.org> 2 3 Disabled file input box stops a certain other div from being rendered 4 https://bugs.webkit.org/show_bug.cgi?id=104226 5 6 Reviewed by Dimitri Glazkov. 7 8 The bug was caused by setNeedsStyleRecalc() call during style recalculation, 9 which resulted in inconsistent ChildNeedsStyleRecalc flags in DOM tree. 10 11 When reattach of file input happens during style recalculation, 12 RenderFileUploadControl::updateFromElement() is called from attach(). 13 It may change the disabled state of the upload button in its shadow tree, 14 but it triggers style recalculation. 15 16 This patch solves this issue by setting disabled state of the upload button in 17 FileInputType::disabledAttributeChanged instead of RenderFileUploadControl. 18 19 Test: fast/forms/file/sibling-of-disabled-file-input.html 20 21 * html/FileInputType.cpp: 22 (WebCore::FileInputType::disabledAttributeChanged): Added. 23 * html/FileInputType.h: 24 (FileInputType): Declare disabledAttributeChanged. 25 * rendering/RenderFileUploadControl.cpp: 26 (WebCore::RenderFileUploadControl::updateFromElement): Remove call to button->setDisabled(). 27 1 28 2012-12-06 Dominic Cooney <dominicc@chromium.org> 2 29 -
trunk/Source/WebCore/html/FileInputType.cpp
r133976 r136915 307 307 } 308 308 309 void FileInputType::disabledAttributeChanged() 310 { 311 ASSERT(element()->shadow()); 312 UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->userAgentShadowRoot()->firstChild()); 313 if (button) 314 button->setDisabled(element()->disabled()); 315 } 316 309 317 void FileInputType::multipleAttributeChanged() 310 318 { -
trunk/Source/WebCore/html/FileInputType.h
r125759 r136915 72 72 virtual bool isFileUpload() const OVERRIDE; 73 73 virtual void createShadowSubtree() OVERRIDE; 74 virtual void disabledAttributeChanged() OVERRIDE; 74 75 virtual void multipleAttributeChanged() OVERRIDE; 75 76 virtual String defaultToolTip() const OVERRIDE; -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r128130 r136915 73 73 74 74 if (HTMLInputElement* button = uploadButton()) { 75 bool newDisabled = !theme()->isEnabled(this);76 // We should avoid to call HTMLFormControlElement::setDisabled() as77 // possible because setAttribute() in setDisabled() can cause style78 // recalculation, and HTMLFormControlElement::recalcStyle() calls79 // updateFromElement() eventually.80 if (button->disabled() != newDisabled)81 button->setDisabled(newDisabled);82 83 75 bool newCanReceiveDroppedFilesState = input->canReceiveDroppedFiles(); 84 76 if (m_canReceiveDroppedFiles != newCanReceiveDroppedFilesState) {
Note:
See TracChangeset
for help on using the changeset viewer.