diff options
Diffstat (limited to 'WebCore/html/HTMLFormControlElement.cpp')
-rw-r--r-- | WebCore/html/HTMLFormControlElement.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp index 0295f39..5238ad5 100644 --- a/WebCore/html/HTMLFormControlElement.cpp +++ b/WebCore/html/HTMLFormControlElement.cpp @@ -34,6 +34,7 @@ #include "HTMLNames.h" #include "HTMLParser.h" #include "HTMLTokenizer.h" +#include "RenderBox.h" #include "RenderTheme.h" namespace WebCore { @@ -98,8 +99,12 @@ void HTMLFormControlElement::attach() // Focus the element if it should honour its autofocus attribute. // We have to determine if the element is a TextArea/Input/Button/Select, // if input type hidden ignore autofocus. So if disabled or readonly. + bool isInputTypeHidden = false; + if (hasTagName(inputTag)) + isInputTypeHidden = static_cast<HTMLInputElement*>(this)->isInputTypeHidden(); + if (autofocus() && renderer() && !document()->ignoreAutofocus() && !isReadOnlyControl() && - ((hasTagName(inputTag) && !isInputTypeHidden()) || hasTagName(selectTag) || + ((hasTagName(inputTag) && !isInputTypeHidden) || hasTagName(selectTag) || hasTagName(buttonTag) || hasTagName(textareaTag))) focus(); } |