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

Performance / accuracy bug in Minify CSS processing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8.2, 3.9
    • Fix Version/s: 3.8.3
    • Component/s: HTML and CSS, Themes
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Pull Master Branch:

      Description

      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.

        Attachments

        1. before patch.jpg
          before patch.jpg
          16 kB
        2. MDL-68191.jpg
          MDL-68191.jpg
          28 kB
        3. test.css
          0.4 kB
        4. test.php
          0.4 kB

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Mark Johnson
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Bas Brands
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/20

                Time Tracking

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