Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68191

Performance / accuracy bug in Minify CSS processing

XMLWordPrintable

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE
    • Hide
      1. Accuracy testing
        1. Before the patch
          1. Copy the 2 attached files test.php and test.css to your moodle root direcoty.
          2. From command line, run: php test.php
          3. Look to the generated test.min.css file
          4. Verify that it has not been minified (it has multiple lines, like the original had, but with some details).
          5. Detail 1: Verify that the comment /* First comment */ is still there.
          6. Detail 2: Verify that the very last line that has three occurrences of .lots .of .css .rules all-together.
          7. Detail 3: Verify that there is only one /* @License MUT 2020 */ line.
          8. Detail 4: Verify that the /* Another comment */ is gone.
        2. After the patch
          1. From command line, run: php test.php again
          2. Look to the generated test.min.css file
          3. Verify that now the file has been minified more (styles don't have multiple lines anymore).
          4. Verify that the lines having styles have 1, 2 and 3 occurrences of the .lots .of .css .rules in each line.
          5. Verify that the /* First comment / and / Another comment */ are gone.
          6. Verify that the /* @preserve I've been preserved! */ is present in a line.
          7. Verify that there are two /* @License MUT 2020 */ lines.
      1. Exploratory testing
        1. Access to moodle, purge caches, switch between themes and visit some pages (course, wiki, forum...) verify that there isn't anything visually broken.
      Show
      Accuracy testing Before the patch Copy the 2 attached files test.php and test.css to your moodle root direcoty. From command line, run: php test.php Look to the generated test.min.css file Verify that it has not been minified (it has multiple lines, like the original had, but with some details). Detail 1: Verify that the comment /* First comment */ is still there. Detail 2: Verify that the very last line that has three occurrences of .lots .of .css .rules all-together. Detail 3: Verify that there is only one /* @License MUT 2020 */ line. Detail 4: Verify that the /* Another comment */ is gone. After the patch From command line, run: php test.php again Look to the generated test.min.css file Verify that now the file has been minified more (styles don't have multiple lines anymore). Verify that the lines having styles have 1, 2 and 3 occurrences of the .lots .of .css .rules in each line. Verify that the /* First comment / and / Another comment */ are gone. Verify that the /* @preserve I've been preserved! */ is present in a line. Verify that there are two /* @License MUT 2020 */ lines. Exploratory testing Access to moodle, purge caches, switch between themes and visit some pages (course, wiki, forum...) verify that there isn't anything visually broken.

      This is to track the Minify bug I found and reported at https://github.com/matthiasmullie/minify/issues/317. We will want that fix in Moodle when possible. It is a huge performance win.

        1. before patch.jpg
          16 kB
          Anna Carissa Sadia
        2. MDL-68191.jpg
          28 kB
          Anna Carissa Sadia
        3. test.css
          0.4 kB
          Eloy Lafuente (stronk7)
        4. test.php
          0.4 kB
          Eloy Lafuente (stronk7)

            timhunt Tim Hunt
            timhunt Tim Hunt
            Mark Johnson Mark Johnson
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 20 minutes
                3h 20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.