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

qcssparser.cpp ASSERT: "d->parsed.metaType() == QMetaType::fromType<QList<QVariant>>()"

    XMLWordPrintable

Details

    • Linux/X11
    • a37ca7c85 (dev), 28b9a653e (6.8), 6c83477a3 (6.7), 0bd97a2c3 (tqtc/lts-6.5), f9bf4de26 (tqtc/lts-6.2)

    Description

      QCssParser gets confused about the type of a CSS declaration, and asserts, when loading the HTML in the attached testcase.

      void Declaration::brushValues(QBrush *c, const QPalette &pal) const
      {
          int needParse = 0x1f; // bits 0..3 say if we should parse the corresponding value.
                                // the bit 4 say we need to update d->parsed
          int i = 0;
          if (d->parsed.isValid()) {
              needParse = 0;
              Q_ASSERT(d->parsed.metaType() == QMetaType::fromType<QList<QVariant>>());   
      

      But d->parsed.metaType() is QColor.

      #7  0x00007ffff5313f25 in QMessageLogger::fatal (this=0x7fffffffc400, msg=0x7ffff58e2810 "ASSERT: \"%s\" in file %s, line %d") at qtbase-dev/src/corelib/global/qlogging.cpp:880
      #8  0x00007ffff5302f9c in qt_assert (assertion=0x7ffff69bb010 "d->parsed.metaType() == QMetaType::fromType<QList<QVariant>>()", file=0x7ffff69bab30 "qtbase-dev/src/gui/text/qcssparser.cpp", line=1533) at qtbase-dev/src/corelib/global/qassert.cpp:105
      #9  0x00007ffff6711ebb in QCss::Declaration::brushValues (this=0x52e140, c=0x7fffffffc710, pal=...) at qtbase-dev/src/gui/text/qcssparser.cpp:1533
      #10 0x00007ffff670c589 in QCss::ValueExtractor::extractBorder (this=0x7fffffffc6a0, borders=0x7fffffffc5a0, colors=0x7fffffffc710, styles=0x7fffffffc590, radii=0x7fffffffc5b0) at qtbase-dev/src/gui/text/qcssparser.cpp:614
      #11 0x00007ffff64e9270 in operator() (__closure=0x7fffffffc648, borderWidth=0x7fffffffc6f0, borderBrush=0x7fffffffc710, borderStyles=0x7fffffffc6e0) at qtbase-dev/src/gui/text/qtexthtmlparser.cpp:1196
      #12 0x00007ffff64e96f2 in QTextHtmlParserNode::applyCssDeclarations (this=0x663290, declarations=QList<QCss::Declaration> (size = 4) = {...}, resourceProvider=0x4af410) at qtbase-dev/src/gui/text/qtexthtmlparser.cpp:1231
      #13 0x00007ffff64e6fd5 in QTextHtmlParser::parseTag (this=0x7fffffffc9f0) at qtbase-dev/src/gui/text/qtexthtmlparser.cpp:676
      #14 0x00007ffff64e699e in QTextHtmlParser::parse (this=0x7fffffffc9f0) at qtbase-dev/src/gui/text/qtexthtmlparser.cpp:606
      #15 0x00007ffff64e66c0 in QTextHtmlParser::parse (this=0x7fffffffc9f0, text="...", _resourceProvider=0x4af410) at qtbase-dev/src/gui/text/qtexthtmlparser.cpp:549
      

      Attachments

        1. anchorborder.html
          0.4 kB
        2. cssparser_assert.cpp
          0.7 kB
        3. test.html
          0.4 kB

        Issue Links

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

          Activity

            People

              hatemelkharashy Hatem ElKharashy
              dfaure_kdab David Faure
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes