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

QtWebEngine documentation is missing critical information

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.5
    • 5.12.2
    • WebEngine
    • None
    • All
    • ba57bbb0f8443a964e771fc65a3de807923bb71e (qt/qtwebengine/5.15)

    Description

      During a port of Sigil to use WebEngine, we found that asynchronous loading of pages happens quite differently in WebEngine than in WebKit when acceptNavigationRequest is overridden in QWebEnginePage. Overriding acceptNavigationRequest is used because the DelegateAllRequests QWebSettings equivalent is not available in WebEngine.

      It seems under WebEngine, clicking a link will actually emit the loadStarted signal from QWebEnginePage *BEFORE* the acceptNavigationRequest override is invoked.

      If that routine decides to delegate certain links and returns false for them in acceptNavigationRequest a loadFinished(okay=FALSE) is then emitted even though no load request was approved and no error was generated.

      Perhaps loadStarted should be emitted only when loadCommitted is generated? Or not emitted unless or until acceptNavigationRequest returns true for that request.

      These extra loadStarted() and LoadFinished(false) signals can confuse code that was designed to work originally with WebKit.

      This is especially a problem if a signal is emitted in acceptNavigationRequest which can send control to other places leaving the QWebEnginePage in a strange state and can also result in recursive loads attempted depending on the sequence of event processing.

      So at the very least, since overriding acceptNavigationRequests is promoted as a way to handle link delegation, please document in your porting documents that QWebEnginePage::acceptNavigationRequests has already started the loading process and emitted loadStarted() BEFORE the request is ever accepted or rejected, and that a follow-up loadFinished(false) is to be expected as a result of link delegation.

      Attachments

        Issue Links

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

          Activity

            People

              kiburtse Kirill Burtsev
              kevinhendricks Kevin B. Hendricks
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes