return nullptr;
}
+#if BUILDFLAG(IS_EFL)
+static bool IsClickableOrFocusable(Node* focusable_node) {
+ return (focusable_node->IsHTMLElement() &&
+ To<HTMLElement>(focusable_node)->IsFocusable()) ||
+ focusable_node->HasEventListeners(event_type_names::kClick) ||
+ focusable_node->HasEventListeners(event_type_names::kMousedown) ||
+ focusable_node->HasEventListeners(event_type_names::kMouseup);
+}
+#endif
+
// This is for tap (link) highlight and is tested in
// link_highlight_impl_test.cc.
Node* WebViewImpl::BestTapNode(
if (IsEditable(*best_touch_node))
return nullptr;
+#if BUILDFLAG(IS_EFL)
+ // If we hit HTMLButtonElement, then show tap highlight on it.
+ if (RuntimeEnabledFeatures::TizenCompatibilityModeEnabled()) {
+ auto focusable = best_touch_node;
+ do {
+ if (IsClickableOrFocusable(focusable)) {
+ if (focusable->IsContainerNode() && !focusable->IsLink()) {
+ auto child =
+ static_cast<const ContainerNode*>(focusable)->firstChild();
+ while (child) {
+ if (IsClickableOrFocusable(child))
+ return nullptr;
+
+ child = NodeTraversal::Next(*child, focusable);
+ }
+ }
+ return focusable;
+ }
+ } while (focusable && (focusable = focusable->parentNode()));
+ }
+#endif
+
Node* hand_cursor_ancestor = FindLinkHighlightAncestor(best_touch_node);
// We show a highlight on tap only when the current node shows a hand cursor
if (!hand_cursor_ancestor) {
bool should_keep_active_for_min_interval = false;
if (read_only) {
hit_type |= HitTestRequest::kReadOnly;
- } else if (gesture_event.GetType() == WebInputEvent::Type::kGestureTap &&
- last_show_press_timestamp_) {
+ } else if (
+#if BUILDFLAG(IS_EFL)
+ !RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() &&
+#endif
+ gesture_event.GetType() == WebInputEvent::Type::kGestureTap &&
+ last_show_press_timestamp_) {
// If the Tap is received very shortly after ShowPress, we want to
// delay clearing of the active state so that it's visible to the user
// for at least a couple of frames.
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/paint/link_highlight_impl.h"
+#if BUILDFLAG(IS_EFL)
+#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
+#endif
+
namespace blink {
LinkHighlight::LinkHighlight(Page& owner) : page_(&owner) {}
DCHECK(node->GetLayoutObject());
DCHECK(!node->IsTextNode());
+#if BUILDFLAG(IS_EFL)
+ // Chromium-efl shows light orange semi-transparent highlight on tap
+ // (Defined in "blink/renderer/core/layout/layout_theme_chromium_tizen.cc").
+ // For elements larger than 80% of the size of visible viewport, tap
+ // highlight resulted in undesirable visible effects. So disable the tap
+ // highlight for those elements, when compatibility mode is enabled.
+ if (RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() &&
+ (node->IsHTMLElement() || node->IsDocumentNode())) {
+ gfx::Rect visible_rect =
+ MainFrame()->View()->LayoutViewport()->VisibleContentRect();
+ gfx::Rect node_rect = node->GetLayoutObject()->AbsoluteBoundingBoxRect();
+ if (node_rect.width() > (visible_rect.width() * 0.8) &&
+ node_rect.height() > (visible_rect.height() * 0.8))
+ return;
+ }
+#endif
+
Color highlight_color =
node->GetLayoutObject()->StyleRef().VisitedDependentColor(
GetCSSPropertyWebkitTapHighlightColor());