qt5base-lts/tests/auto
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
..
bic/data Add binary compatibility files for 6.1 2021-09-03 13:41:25 +00:00
cmake CMake: Bump almost all cmake_minimum_required calls to 3.16 2021-09-22 19:36:49 +02:00
concurrent Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
corelib QList::iterator: use templates for advancing operators 2021-10-12 08:46:31 -07:00
dbus tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
gui Fix caching of parsed border color values in CSS parser 2021-10-12 18:26:26 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network Http/2 - handle PADDED flag correctly 2021-10-09 12:49:01 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Add lancelot test for smallcaps text path 2021-10-04 16:10:00 +02:00
printsupport Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
testlib Rename command-option to generate_expected_output.py 2021-10-01 19:24:31 +02:00
tools QPlugin: add qt_plugin_query_metadata_v2() to dynamic plugins 2021-10-11 18:59:52 -07:00
widgets Activate tst_QWidget_window::tst_showWithoutActivating on cocoa 2021-10-12 14:08:08 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt Don't build tests/auto/tools when cross-compiling 2021-10-07 08:03:40 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00