display:none file upload button crashes
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 00:41:07 +0000 (00:41 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 00:41:07 +0000 (00:41 +0000)
commit1cbea790287ee22a1d56690289cc820c565cda5c
tree8d372447ee38eaf7d59701f600ee0b30334f4c00
parentf461b87c87db7c427594a6536c22ae16644a7528
display:none file upload button crashes
https://bugs.webkit.org/show_bug.cgi?id=109102

Reviewed by Levi Weintraub.

Source/WebCore:

Test: fast/forms/file/display-none-upload-button.html

* rendering/RenderFileUploadControl.cpp:
(WebCore::nodeWidth):
(WebCore::RenderFileUploadControl::paintObject):
Having an upload button doesn't mean we have a rendered upload button.
Null check the renderer before trying to access it.

LayoutTests:

* fast/forms/file/display-none-upload-button-expected.txt: Added.
* fast/forms/file/display-none-upload-button.html: Added.
Tests that we don't crash. Also exposes a bug that the baseline and height of
the input don't include the height of the filename text.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/file/display-none-upload-button-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/file/display-none-upload-button.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFileUploadControl.cpp