Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.9.9, 5.12.10, 5.15.2, 6.2.1
-
None
-
-
74021bfcb8f3937e960e76c39d06f5a2a6304673 (qt/qtwebengine/dev) 5a2db0883cc6acadebf3fa0197c36d81af167492 (qt/qtwebengine/6.2)
Description
I have encountered an annoying issue where if user wants to insert certain HTML (which we assume he copied from somewhere else) into the HTML element that has contentEditable attribute set to true, it results in some weird behavior.
It boils down to:
- User have copied some "weird" HTML.
- contentEditable element has some text in it.
- User pastes HTML before text in the element.
- Caret is moved in unexpected way:
- Upon reaching 2 pastes on the single line, cursor will be moved to a new line. This happens up until we hit existing text. Attempting to paste on the line with existing text will:
- Crash WebEngine process (5.9.9, debug)
- Remove existing text and get "stuck" (meaning, nothing happens on subsequent attempts to paste text) in insert loop. (5.9.9, release).
- Caret is moved to next line after every paste up until reaching line with existing text. Attempting to paste here will result in HTML being inserted after existing text. Subsequent pastes are producing expected behavior. (5.12.10, debug/release).
- Similar behavior as in 1st case, but after reaching text it will behave like in 2nd. (5.15.2, debug/release)
- Upon reaching 2 pastes on the single line, cursor will be moved to a new line. This happens up until we hit existing text. Attempting to paste on the line with existing text will:
Steps to reproduce:
- Compile attached example with Qt 5.9.9, 5.12.10 or 5.15.2 using MSVC 2017.
- Go to this MDN page on outline style.
- Select and copy string <'outline-color'> under Values section.
- Start an app, place caret on the top of contentEditable element.
- Press CTRL + V until you see a result.
If description is too difficult to understand at first, let me know so I can record a video.
Attachments
Issue Links
- relates to
-
QTBUG-118121 QtWebEngine CFHtmlExtractMetadata does not handle case of no context properly
- Reported
- resulted in
-
QTBUG-100806 QMimeData::html() returns undesirable meta data
- Closed