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

Rendering of pages without text elements is delayed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.4.2, 6.5.0 Beta3
    • WebEngine
    • None
    • Linux/X11

    Description

      I've put Linux/X11 as platform but we say this issue in CI test failures and we had some of the same failures on Windows too so I expect it's more broadly applicable.

      It appears that rendering of pages without any text elements is delayed by a few hundred seconds. How to reproduce:

      1 have a test page like so:

      <!DOCTYPE html>
      <html>
          <head>
              <meta charset="utf-8">
              <title>Textarea</title>
              <script>
                function onload () {
                  console.log('page finished loading')
                }
      
                var timer = window.setInterval(() => {
                  var el = document.getElementById("textarea")
                  console.log(`textarea: ${el}`)
                  if (el) {
                    window.clearInterval(timer)
                    // We get here before the element shows up in the UI and this
                    // .focus() and .click() does work to focus the element when it
                    // eventually shows up. So it seems it is in the DOM in a timely
                    // manner.
                    //el.focus()
                    //el.click()
                  }
                }, 20)
              </script>
          </head>
          <body onload="onload()">
              <!--
                <p>a text element</p>
              -->
              <br/>
              <textarea id="textarea"></textarea>
              <br/>
              <textarea id="textarea-2"></textarea>
              <br/>
              <form>
                <input type="text"></input>
              </form>
              <br/>
              <iframe src="data:,an%20iframe">
              </iframe>
              <br/>
              <button onclick="console.log('clicky')">
                <!--
                button
                -->
              </button>
          </body>
      </html>
      

      2 serve that somewhere (it doesn't seem to reproduce when read from a file), eg python3 -m http.server 3366

      3 load the page in simplebrowser

      4 (optional) it's easiest to manually reproduce by opening a new page that's visibly different (like about:blank) then go back and forward in the tab history to see how slow the test page loads

      5 uncomment either of the text elements in the test page, re-test and see how it loads much faster now

      We caught this in CI where we send a QMouseEvent(QEvent.Type.MouseButtonPress, ...) to click on an input element. When delaying when we wen the event the tests started passing. But when checking from JS the elements appear in the DOM in short order, we also get a load finished event very faster. So it seems something like the chromium stuff works fine by the Qt stuff doesn't point to it for a bit.

      The performance tab of the developer tools also seems to show that the page finished rendering early, although there is some activity periodically happening until everything finally shows up.

      Attachments

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

        Activity

          People

            mnegyokru Martin Negyokru
            toofar toofar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes