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

QtWebEngine CFHtmlExtractMetadata does not handle case of no context properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.2, 6.4.3, 6.5.3, dev
    • WebEngine
    • None
    • windows
    • Windows

      The Win 32 spec for CF_Html clearly states that the context (html and body tags) is optional and that StartHtml and EndHtml should be set to -1 in those cases.

      See:
      https://learn.microsoft.com/en-us/windows/win32/dataxchg/html-clipboard-format

      QUOTE:
      The context is optional, as sufficient information is included in the fragment for basic pasting of an HTML fragment to take place. If the context is not stored, the fragment only is stored and the StartHTML=EndHTML=-1.

      But src/core/clipboard_util_win.cpp in CFHtmlExtractMetadata clearly does not handle the case where the find for <html comes back as not found, npos. That makes the search for StartFragment fail.

      This causes the paste to not happen when the clipboard was created by outside copy that generates the cf_html according to the spec.

      Perhaps something as simple as checking for '<html' not found, and instead looking for the first '<' after the metadata and calling that htmlstart for the purposes of the later substr call used in clipboard_qt that invokes CFHtmlExtractMetadata?

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

            qt_webengine_team Qt WebEngine Team
            kevinhendricks Kevin B. Hendricks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes