RFR: 8269115: WebView paste event contains old data
Jay Bhaskar
duke at openjdk.java.net
Thu Feb 24 15:37:11 UTC 2022
On Thu, 24 Feb 2022 12:42:49 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
>> Issue: The DataObject uses m_availMimeTypes as Vector of strings, and appending mime types in pasteboard operation like setPlainText, Hence it will append duplicate mime types in m_availMimeTypes , in this case the length clipboardData.types would be wrong, and duplicates data would be copied to clipboard target.
>> Solution: Use ListHashSet data Structure instead of Vector for m_availMimeTypes.
>
> modules/javafx.web/src/main/native/Source/WebCore/platform/java/DataObjectJava.h line 133:
>
>> 131: Vector<String> types;
>> 132: types.appendRange(m_availMimeTypes.begin(), m_availMimeTypes.end());
>> 133: //returns MIME Types available in clipboard.z
>
> Minor: The comment should be the first line in the method, as it was before this.
> The character z at the end must be unintended.
done
> modules/javafx.web/src/main/native/Source/WebCore/platform/java/PasteboardJava.cpp line 240:
>
>> 238: // TODO: setURL, setFiles, setData, setHtml (needs URL)
>> 239: data->setPlainText(jGetPlainText());
>> 240: data->setData(DataObjectJava::mimeHTML(),jGetPlainText());
>
> Minor: Please add a space after `,`
done
> modules/javafx.web/src/test/java/test/javafx/scene/web/HTMLEditingTest.java line 73:
>
>> 71: Clipboard.getSystemClipboard().setContent(content);
>> 72:
>> 73:
>
> Minor: The extra line is not required and would recommend to remove.
done
-------------
PR: https://git.openjdk.java.net/jfx/pull/729
More information about the openjfx-dev
mailing list