Regression :Unable to search using search box.
Reported by
pranjali...@etouch.net,
Oct 20 2017
|
||||
Issue descriptionChrome Version:64.0.3245.0 (Official Build) 140f8ce04cc4ee5d4b3ca2eb83888d2452a1f43b-refs/heads/master@{#510270}(32/64 bit) OS:Windows (7,8,10),Linux (14.04 LTS),Mac(10.12.6). Steps to reproduce: 1)Launch chrome ,go to NTP , Click in the search box and type. 2)observe. Actual Result:Unable to search using search box. Expected Result:should be able to search using search box. This is Regression issue broken in 'M-64' and will soon update other bisect info. Good Build:64.0.3244.0 Bad Build: 64.0.3245.0
,
Oct 20 2017
Confirmed, it's the same thing as issue 776655 . After crrev.com/c/700443, the embeddedSearch APIs can still be called directly, like window.chrome.embeddedSearch.searchBox.startCapturingKeyStrokes(); but the following does not work (it did work before): var f = window.chrome.embeddedSearch.searchBox.startCapturingKeyStrokes; f(); Calling f fails with the following error: Uncaught TypeError: Error processing argument at index -1, conversion failure from undefined Jochen, any idea what's up with that?
,
Oct 20 2017
hum, what's f() supposed to do? When I look at the implementation of startCapturingKeyStrokes() it accesses "this" to get the render frame. invoking f() is basically invoking the method without the "this" project, and gin protects against that.
,
Oct 20 2017
f() should call the native SearchBoxBindings::StartCapturingKeyStrokes method (which does use "this", the C++ one). I guess by first assigning to a JS var, the JS "this" gets lost. The following does work: var f2 = window.chrome.embeddedSearch.searchBox.startCapturingKeyStrokes.bind(window.chrome.embeddedSearch.searchBox); f2(); This kinda makes sense, but the problem is that the previous (v8::Extension) implementation did not require the bind(), and it's used in that way. Is there any way to make the gin implementation behave the same way?
,
Oct 20 2017
if you want to be able to invoke the function without binding it to the object, the C++ function needs to be static. You probably then have to use blink::WebLocalFrame::FrameForCurrentContex() to get the frame and go from there.
,
Oct 20 2017
Alright, thanks! I'll get on that and hopefully send you a CL soon.
,
Oct 20 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/453cdca9a87018ae26b911899beb6394eaa17ecd commit 453cdca9a87018ae26b911899beb6394eaa17ecd Author: Marc Treib <treib@chromium.org> Date: Fri Oct 20 11:29:19 2017 embeddedSearch API: Expose static functions This makes sure they can be called after being assigned to a var, like var f = chrome.embeddedSearch.searchBox.startCapturingKeyStrokes; f(); This was the case when the API was implemented as a v8::Extension, but got broken when it was converted to Gin in crrev.com/c/700443. Bug: 776660 , 776655 Change-Id: Idab6a6e960ff614c80f74b3acdadede7bf9af9d0 Reviewed-on: https://chromium-review.googlesource.com/730186 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/heads/master@{#510401} [modify] https://crrev.com/453cdca9a87018ae26b911899beb6394eaa17ecd/chrome/browser/ui/search/local_ntp_browsertest.cc [modify] https://crrev.com/453cdca9a87018ae26b911899beb6394eaa17ecd/chrome/renderer/chrome_render_frame_observer.cc [modify] https://crrev.com/453cdca9a87018ae26b911899beb6394eaa17ecd/chrome/renderer/searchbox/searchbox_extension.cc [modify] https://crrev.com/453cdca9a87018ae26b911899beb6394eaa17ecd/chrome/renderer/searchbox/searchbox_extension.h
,
Oct 20 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by treib@chromium.org
, Oct 20 2017Status: Assigned (was: Unconfirmed)