summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 01:56:22 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 01:56:22 +0000
commit8cc47ce3146b70a4bef2665eebeb5875050d3534 (patch)
tree42c9679eee636657405a175395d1367bff59dff9 /webkit/glue/dom_operations.cc
parent11c2fe82bca2cd871eeb7aff77043754ef75651a (diff)
downloadchromium_src-8cc47ce3146b70a4bef2665eebeb5875050d3534.zip
chromium_src-8cc47ce3146b70a4bef2665eebeb5875050d3534.tar.gz
chromium_src-8cc47ce3146b70a4bef2665eebeb5875050d3534.tar.bz2
Adding the elementDoesAutoCompleteForElementWithId method to the layoutTestController class to fix the security/set-form-autocomplete-attribute.html layout test.
Review URL: http://codereview.chromium.org/17364 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r--webkit/glue/dom_operations.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index 1db09c1..6fc79b9 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -843,4 +843,21 @@ bool PauseTransitionAtTimeOnElementWithId(WebView* view,
time);
}
+bool ElementDoesAutoCompleteForElementWithId(WebView* view,
+ const std::string& element_id) {
+ WebFrame* web_frame = view->GetMainFrame();
+ if (!web_frame)
+ return false;
+
+ WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame();
+ WebCore::Element* element =
+ frame->document()->getElementById(StdStringToString(element_id));
+ if (!element || !element->hasLocalName(WebCore::HTMLNames::inputTag))
+ return false;
+
+ WebCore::HTMLInputElement* input_element =
+ static_cast<WebCore::HTMLInputElement*>(element);
+ return input_element->autoComplete();
+}
+
} // webkit_glue