qt5base-lts/tests/auto/gui
Volker Hilsheimer 8513bcd90c Fix caching of parsed border color values in CSS parser
When parsing CSS, a border-color value is parsed as four brushes, as css
allows assigning up to four values, one for each side.

When applying the CSS to the HTML, we accessed it as a color value,
which overwrote the parsed value with a QColor. So while we had a valid
parsed value (and didn't re-parse), the code accessing that value still
expected it to be a list, and thus failed to retrieve the data.

There are several ways to fix that, but the cleanest way without
introducing any performance penalty from repeatedly parsing (and in fact
removing a parse of the string into a color) is to enable colorValue to
interpret an already parsed value that is a list without overwriting the
parsed value again. To avoid similar issues in the future, add assert
that the parsed value has the right type in brushValues.

As a drive-by, speed things up further by making use of qMetaTypeId
being constexpr, which allows for it to be used in a switch statement.

Add a test case.

Fixes: QTBUG-96603
Pick-to: 6.2 5.15
Change-Id: Icdbff874daedc91bff497cd0cd1d99e4c713217c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-12 18:26:26 +02:00
..
image Preserve QImage metadata when converting format with color table 2021-09-28 15:59:31 +02:00
itemmodels emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
kernel QPlugin: add qt_plugin_query_metadata_v2() to dynamic plugins 2021-10-11 18:59:52 -07:00
math3d tst_QMatrixNxN: fix type-punning warning 2021-06-30 23:13:28 +02:00
painting Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
platform Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00
qopengl Block flaky rhi and OpenGL tests on Android 2021-05-30 23:02:53 +02:00
qopenglconfig Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvulkan vulkan: Update legacy tests and examples to the modern validation layer 2021-05-31 17:16:49 +02:00
rhi rhi: Remove Q_RELOCATABLE_TYPE for types with QVLA in them 2021-09-20 12:25:37 +02:00
text Fix caching of parsed border color values in CSS parser 2021-10-12 18:26:26 +02:00
util Remove qshadergraph files 2021-10-05 17:49:51 +02:00
CMakeLists.txt Move QtX11Extras into QtGui as private API 2021-05-10 21:19:46 +00:00