1. [VD] Do not show IME if click is prevented or
scrollbar
Do not 'ShowVirtualKeyboard' when mouse up event occurs
if the previous mouse down event is 'preventDefault'
by JavaScript.
Bug:
DF170215-01023
Check if it is mouse click on the scrollbar before
|ShowVirtualKeyboard|.
No need to show VirtualKeyboard if click on the scrollbar.
2. [HBBTV] Trigger auto show IME when webview focus in
The patch is for fixing hbbtv can not auto show IME issue.
Current, only element been set focus can tigger show IME autolly,
but show IME autolly also need based on webview been focused.
If element been focused first, and webview been focused later,
then can not show IME.
So here, add another trigger to show IME autolly.
refer:
https://review.tizen.org/gerrit/#/c/288827
Change-Id: I025fa50f075f3d816467e7b7550e6c3002271d5d
Signed-off-by: fang fengrong <fr.fang@samsung.com>
// Returns the number of live WebView instances in this process.
static size_t GetWebViewCount();
+#if BUILDFLAG(IS_TIZEN_TV)
+ virtual bool IsHitScrollbar() { return false; }
+ virtual bool IsMouseDownEventSwallowed() { return false; }
+#endif
+
// Sets whether web or OS-level Attribution Reporting is supported. See
// https://github.com/WICG/attribution-reporting-api/blob/main/app_to_web.md
virtual void SetPageAttributionSupport(
}
}
#if BUILDFLAG(IS_TIZEN_TV)
+ // Trigger auto show IME when webview focus in
+ if (IsHbbTV()) {
+ if (MainFrameImpl() && MainFrameImpl()->FrameWidgetImpl()) {
+ MainFrameImpl()
+ ->FrameWidgetImpl()
+ ->DidUpdateTextOfFocusedElementByNonUserInput();
+ }
+ }
+
if (element) {
// Accessibility needs to be informed that system focus has moved
// into the web area again, even if focus did not change within
}
#if BUILDFLAG(IS_TIZEN_TV)
+bool WebViewImpl::IsHitScrollbar() {
+ const LocalFrame* frame =
+ DynamicTo<LocalFrame>(page_->GetFocusController().FocusedOrMainFrame());
+ if (!frame)
+ return false;
+ return frame->GetEventHandler().PressedScrollbar();
+}
+
+bool WebViewImpl::IsMouseDownEventSwallowed() {
+ if (!MainFrameImpl() || !MainFrameImpl()->GetFrame())
+ return false;
+ return MainFrameImpl()
+ ->GetFrame()
+ ->GetEventHandler()
+ .MousePressEventSwallowed();
+}
+
void WebViewImpl::SetFloatVideoWindowState(bool enable) {
if (!GetPage())
return;
const SessionStorageNamespaceId& GetSessionStorageNamespaceId() override;
bool IsFencedFrameRoot() const override;
+#if BUILDFLAG(IS_TIZEN_TV)
+ bool IsHitScrollbar() override;
+ bool IsMouseDownEventSwallowed() override;
+#endif
+
#if BUILDFLAG(IS_EFL)
bool PaintSoftBitmap(SkCanvas*, const gfx::Rect&) override;
bool HasAcceleratedCanvasWithinViewport() const override;
}
#if BUILDFLAG(IS_TIZEN_TV)
+bool WebFrameWidgetImpl::IsHitScrollbar() {
+ return View()->IsHitScrollbar();
+}
+
+bool WebFrameWidgetImpl::IsMouseDownEventSwallowed() {
+ return View()->IsMouseDownEventSwallowed();
+}
+
void WebFrameWidgetImpl::SetFloatVideoWindowState(bool enabled) {
View()->SetFloatVideoWindowState(enabled);
}
void SelectFocusedLink() override;
gfx::Rect RequestSelectionRect() override;
#if BUILDFLAG(IS_TIZEN_TV)
+ bool IsHitScrollbar() override;
+ bool IsMouseDownEventSwallowed() override;
void SetFloatVideoWindowState(bool enabled) override;
void SuspendNetworkLoading() override;
void ResumeNetworkLoading() override;
#if BUILDFLAG(IS_TIZEN_TV)
handled_mouse_left_button_press_event_ = false;
+ mouse_press_event_swallowed_ = false;
#endif
HitTestRequest request(HitTestRequest::kActive);
? event_result != WebInputEventResult::kNotHandled
: true;
}
+
+ if (mev.GetScrollbar())
+ pressed_scrollbar_ = true;
#endif
if (PassMousePressEventToScrollbar(mev))
frame_->GetChromeClient().OnMouseDown(*result.InnerNode());
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ mouse_press_event_swallowed_ =
+ (event_result == WebInputEventResult::kHandledApplication);
+#endif
+
return event_result;
}
mouse_event_manager_->SetLastKnownMousePosition(mouse_event);
mouse_event_manager_->HandleSvgPanIfNeeded(true);
+#if BUILDFLAG(IS_TIZEN_TV)
+ pressed_scrollbar_ = false;
+#endif
+
if (frame_set_being_resized_) {
WebInputEventResult result =
mouse_event_manager_->SetMousePositionAndDispatchMouseEvent(
void ClearDragState();
#if BUILDFLAG(IS_TIZEN_TV)
+ bool MousePressEventSwallowed() const { return mouse_press_event_swallowed_; }
+ bool PressedScrollbar() const { return pressed_scrollbar_; }
bool ScrollNewPosition(const ScrollOffset&, LocalFrameView*);
bool ScrollWithMultiplier(const ScrollOffset&, Node*);
#endif
#if BUILDFLAG(IS_TIZEN_TV)
bool handled_mouse_left_button_press_event_ = false;
+ bool mouse_press_event_swallowed_ = false;
+ bool pressed_scrollbar_ = false;
#endif
// ShouldShowIBeamForNode's unit tests:
prevent_default = prevent_default || suppress;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ bool hit_scrollbar = false;
+ if (widget_->client())
+ hit_scrollbar = widget_->client()->IsHitScrollbar();
+#endif
+
WebInputEventResult processed = prevent_default
? WebInputEventResult::kHandledSuppressed
: WebInputEventResult::kNotHandled;
// Show the virtual keyboard if enabled and a user gesture triggers a focus
// change.
+#if BUILDFLAG(IS_TIZEN_TV)
+ bool mouse_down_event_swallowed = false;
+ if (widget_->client())
+ mouse_down_event_swallowed = widget_->client()->IsMouseDownEventSwallowed();
+
+ if (((processed != WebInputEventResult::kNotHandled &&
+ input_event.GetType() == WebInputEvent::Type::kTouchEnd) ||
+ show_virtual_keyboard_for_mouse) &&
+ !mouse_down_event_swallowed && !hit_scrollbar) {
+ widget_->ShowVirtualKeyboard();
+ }
+#else
if ((processed != WebInputEventResult::kNotHandled &&
input_event.GetType() == WebInputEvent::Type::kTouchEnd) ||
show_virtual_keyboard_for_mouse) {
widget_->ShowVirtualKeyboard();
}
+#endif
if (!prevent_default &&
WebInputEvent::IsKeyboardEventType(input_event.GetType()))