From 8cc47ce3146b70a4bef2665eebeb5875050d3534 Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> Date: Tue, 13 Jan 2009 01:56:22 +0000 Subject: 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 --- webkit/glue/dom_operations.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'webkit/glue/dom_operations.cc') 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 -- cgit v1.1