Overview: Poor C++ style with direct calls to cast operator in WebFrameImpl.cpp. Steps to Reproduce: 1) Open WebFrameImpl.cpp 2) Inspect WebKit::WebFrameImpl::registerPasswordListener and WebKit::WebFrameImpl::notifiyPasswordListenerOfAutocomplete Actual Results: Notice the calls to: RefPtr<HTMLInputElement> element = inputElement.operator PassRefPtr<HTMLInputElement>(); This is using an explicit call to a PassRefPtr cast operator to bridge from a WebInputElement back to an HTMLInputElement. Expected Results: Better style is to "unwrap" the WebInputElement explicitly, eg.: RefPtr<HTMLInputElement> element(inputElement.unwrap<HTMLInputElement>());
Follow up for bug 41236.
Created attachment 60272 [details] Proposed patch.
Created attachment 60277 [details] Proposed patch.
Comment on attachment 60277 [details] Proposed patch. Thanks! R=me
Comment on attachment 60277 [details] Proposed patch. Clearing flags on attachment: 60277 Committed r62349: <http://trac.webkit.org/changeset/62349>
All reviewed patches have been landed. Closing bug.
http://trac.webkit.org/changeset/62349 might have broken Chromium Linux Release
Rolled out due to breakage on Linux. http://trac.webkit.org/changeset/62351
And OSX bustage. Here's the compile error: /Users/cltbld/Desktop/BuildSlaveData/WebKit-BuildSlave/chromium-mac-release/build/WebKit/chromium/src/WebFrameImpl.cpp: In member function ‘virtual void WebKit::WebFrameImpl::notifiyPasswordListenerOfAutocomplete(const WebKit::WebInputElement&)’: /Users/cltbld/Desktop/BuildSlaveData/WebKit-BuildSlave/chromium-mac-release/build/WebKit/chromium/src/WebFrameImpl.cpp:1974: error: passing ‘const WebKit::WebInputElement’ as ‘this’ argument of ‘T* WebKit::WebNode::unwrap() [with T = WebCore::HTMLInputElement]’ discards qualifiers
Created attachment 60792 [details] Proposed patch. Fixes const-ness issues. Grrrr. False positive my end. New patch addresses const-ness issues and pushes the const-ness of the |inputElement| parameter down a level to WebFrameImpl::getPasswordListener(). We need a const_cast at this level due to the use of non-const RefPtr<HTMLInputElement> used as the key to the |m_passwordListeners| map.
Comment on attachment 60792 [details] Proposed patch. Fixes const-ness issues. Clearing flags on attachment: 60792 Committed r62770: <http://trac.webkit.org/changeset/62770>