Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74446

Focus and selection related test failures

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.12
    • WebEngine
    • None

    Description

      Recent ci test failures:

      tst_QWebEnginePage::findText

      FAIL!  : tst_QWebEnginePage::findText() Compared values are not the same
      Actual   (((m_view->hasSelection()))): 0   
      Expected (true)                      : 1
      Loc: [tst_qwebenginepage.cpp(911)]

       tst_QWebEngineView::mouseClick

      FAIL! : tst_QWebEngineView::mouseClick() 'selectionChangedSpy.wait()' returned FALSE. ()
      Loc: [tst_qwebengineview.cpp(1480)]
      

      and probably:

      FAIL!  : tst_QWebEnginePage::runJavaScriptFromSlot() Compared values are not the same
      Actual   (((result))) : QVariant()
      Expected (QVariant(4)): QVariant(int,4)
      Loc: [tst_qwebenginepage.cpp(1667)]
      
      FAIL!  : tst_QQuickWebEngineView::inputMethod() '((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject())' returned FALSE. ()
      Loc: [tst_qquickwebengineview.cpp(450)]

      Even though

      QWebEngineSettings::FocusOnNavigationEnabled

      setting set to true and there is a call inside WebContentAdapter:

      m_webContents->Focus()

      the actual focus is set asynchronously in

      WidgetInputHandlerImpl::SetFocus()

      That is why some methods calls inside WevContentsImpl (like SelectAll, Replace, Copy, etc) are just ignored right after

      page->setContent(), setHtml() or load()

      Actual focused frame is set in frame_tree.cc:

      void FrameTree::SetFocusedFrame(...) {
          ...
          focused_frame_tree_node_id_ = node->frame_tree_node_id();
          node->DidFocus();
          ...
      }
      

      and DidFocus calls FrameTreeNode::Observer, so potential solution is to add FrameTreeNode::AddObserver.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              kiburtse Kirill Burtsev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes