#if BUILDFLAG(IS_TIZEN_TV)
#include "third_party/blink/public/platform/web_application_type.h"
+#include "third_party/blink/renderer/core/page/spatial_navigation_controller.h"
+#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/public/web/web_security_policy.h"
#endif
SelectionInDOMTree::Builder().Collapse(position).Build());
}
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (element) {
+ // Accessibility needs to be informed that system focus has moved
+ // into the web area again, even if focus did not change within
+ // WebCore. send the notification even if the element is the same.
+ AXObjectCache* cache =
+ focused_frame->GetDocument()->ExistingAXObjectCache();
+ if (cache)
+ cache->HandleFocusedUIElementChanged(0, element);
+ } else {
+ // if no focus element and spatial navigation enabled,
+ // move to the first top element by send a fake arrow down
+ if (IsSpatialNavigationEnabled(focused_frame) && IsWebBrowser()) {
+ LOG(INFO) << "No focused element in view, navigate downward";
+ GetPage()
+ ->GetSpatialNavigationController()
+ .HandleSpatialNavigationDirection(
+ SpatialNavigationDirection::kDown);
+ }
+ }
+#endif
}
} else {
CancelPagePopup();
return false;
const LayoutObject* origin = current_interest.visible_node->GetLayoutObject();
+ if (!origin)
+ return false;
const PaintLayer* focused_layer = origin->PaintingLayer();
if (!focused_layer || focused_layer->IsRootLayer())
return false;
const LayoutObject* next = candidate.visible_node->GetLayoutObject();
+ if (!next)
+ return false;
const PaintLayer* candidate_layer = next->PaintingLayer();
if (focused_layer != candidate_layer)
return false;
void Trace(Visitor*) const;
+#if BUILDFLAG(IS_TIZEN_TV)
+ bool HandleSpatialNavigationDirection(SpatialNavigationDirection direction);
+#endif
+
private:
// Entry-point into SpatialNavigation advancement. Will return true if an
// action (moving interest or scrolling), false otherwise.
if (IsMobileProfile() || IsTvProfile())
(is_enabled) ? AddPlug() : RemovePlug();
+// On TV, the Spatial Navigation and Accessibility are independent, the
+// Accessibility Status change should not trigger Spatial Navigation status
+// change. So disbale trigger SpatialNavigationStatusChange when
+// AccessibilityStatusChanged.
+#if !BUILDFLAG(IS_TIZEN_TV)
if (observer_) {
observer_->OnSpatialNavigationStatusChanged(is_enabled);
observer_->OnAccessibilityStatusChanged(is_enabled);
}
+#endif
}