summaryrefslogtreecommitdiffstats
path: root/webkit/glue/editor_client_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/editor_client_impl.cc')
-rw-r--r--webkit/glue/editor_client_impl.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc
index 411c514..670bee0 100644
--- a/webkit/glue/editor_client_impl.cc
+++ b/webkit/glue/editor_client_impl.cc
@@ -28,6 +28,7 @@
#include "base/string_util.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
#include "webkit/glue/autofill_form.h"
+#include "webkit/glue/dom_operations.h"
#include "webkit/glue/editor_client_impl.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webkit_glue.h"
@@ -664,14 +665,10 @@ void EditorClientImpl::textDidChangeInTextField(WebCore::Element* element) {
}
void EditorClientImpl::ShowAutofillForNode(WebCore::Node* node) {
- if (node->nodeType() == WebCore::Node::ELEMENT_NODE) {
- WebCore::Element* element = static_cast<WebCore::Element*>(node);
- if (element->hasLocalName(WebCore::HTMLNames::inputTag)) {
- WebCore::HTMLInputElement* input_element =
- static_cast<WebCore::HTMLInputElement*>(element);
- Autofill(input_element, true);
- }
- }
+ WebCore::HTMLInputElement* input_element =
+ webkit_glue::NodeToHTMLInputElement(node);
+ if (input_element)
+ Autofill(input_element, true);
}
void EditorClientImpl::Autofill(WebCore::HTMLInputElement* input_element,