fixup! Implement ewk_settings_auto_fitting_set
authorAntonio Gomes <a1.gomes@samsung.com>
Thu, 26 Nov 2015 00:09:39 +0000 (20:09 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
commit2db30b53bd73e799bd15975f3154798a85b12a99
treeca444c3de83cab983d5059551be72699e7963df5
parent04e5b0e2f5458ba7d8e61b06be88e393b4d58fcc
fixup! Implement ewk_settings_auto_fitting_set

chromium-efl has a mechanism to inform the embedding
app about a blocked window opening. It is the "popup,blocked"
smart signal.
In [1], we removed the EWK specific preference that used to
control window opening by javascript, in favor of chromium's
WebPreferences::javascript_can_open_windows_automatically.

Problem is that this changed the way chromium-efl blocks popups.
When javascript_can_open_windows_automatically is set, it gets
bubbled down to Blink, and popup blocking happens in Blink level
(see third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp,
LocalDOMWindow::open() method).
This makes it impossible to inform the embedding app about a blocked
popup.

Additionally, [1] also started to cache a RenderView instance
(see ContentRendererClientEfl::RenderViewCreated) in order to
query for javascript_can_open_windows_automatically.
This is crash-prone because it caches the latest RenderView
instance created. If the for instance window associated to the
RenderView gets closed, ContentRendererClientEfl will hold a dangling
pointer, and crash upon accessing it.

Patch fixes this by reimplementing the way we control window
opening by javascript. Now
WebPreferences::javascript_can_open_windows_automatically (the chromium
preference) is always ON, so new window creation request messages
always reach the browser process. From there, we can control it
according to the EWK specific setting, and emit the
"popup,blocked" smart signal if needed.

The following EWK unit test were crashing due to this:
- utc_blink_ewk_settings_scripts_can_open_windows_set
Tests were also changed based on the default value of
javascript_can_open_windows_automatically_ewk, which is true.

[1] http://165.213.202.130/gerrit/#/c/92971/

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14640

Reviewed by: a.renevier, djmix.kim, g.czajkowski

Change-Id: I3c5e45961265d78c0832387586c4f2aa103f398a
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/ewk/efl_integration/common/render_messages_ewk.h
tizen_src/ewk/efl_integration/common/web_preferences_efl.h
tizen_src/ewk/efl_integration/public/ewk_settings.cc
tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc
tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.h
tizen_src/ewk/efl_integration/renderer/render_view_observer_efl.cc
tizen_src/ewk/unittest/utc_blink_ewk_settings_scripts_can_open_windows_set_func.cpp