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

core_useragent::get_browser_version_classes does not distinguish Chrome and Safari and don't know Edge

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      The unit tests cover the code well.

      Do a quick sanity-check of Moodle in Chrome on desktop and Android.

      1. Check the body class is replaced correctly, open the browser's debug window and check for body's class, depend on the browser, class name should replace correctly:

      • Google Chrome (Mac & Window): The class chrome should exist, safari class should be removed. 
      • Google Chrome (Android) : The class chrome, android should exist, safari class should be removed.
      • Microsoft Edge: The class edge android should exist, safari class should be removed.
      • Mobile safari: The class ios should exist, safari class should be removed.
      • Other browsers: Should stay the same as before.

       2. We removed the safari class from the activity chooser dialog, so we will check to make sure it's display same as before.

      • Using iPhone4S or any iOS device with height 639px or lower.
      • Create a course using Boost or Bootstrap Base theme.
      • Navigate to the course.
      • Click on "Add an activity or resource".
      • The margin around Add and Cancel button should be displayed as before (45px).
      Show
      The unit tests cover the code well. Do a quick sanity-check of Moodle in Chrome on desktop and Android. 1. Check the body class is replaced correctly, open the browser's debug window and check for body's class, depend on the browser, class name should replace correctly: Google Chrome (Mac & Window) : The class chrome should exist, safari class should be removed.  Google Chrome (Android)  : The class chrome, android should exist, safari class should be removed. Microsoft Edge : The class  edge android should exist, safari class should be removed. Mobile safari:  The class  ios  should exist,  safari  class should be removed. Other browsers:  Should stay the same as before.   2.  We removed the safari class from the activity chooser dialog, so we will check to make sure it's display same as before. Using iPhone4S or any iOS device with height  639px or lower. Create a course using Boost or  Bootstrap Base theme. Navigate to the course. Click on "Add an activity or resource". The margin around Add and Cancel button should be displayed as before ( 45px ).
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull Master Branch:
      MDL-50812-master

      Description

      At the moment, when you are using Google Chrome (Android, PC and MacOS) or Microsoft Edge, Moodle add 'safari' to the list of classes on body.

      Sometimes Chrome and Safari lay things out differently, and you need different CSS.

      So, the body's class should change to match the browser:

      • Google Chrome (Mac & Window): The body class should change from safari to chrome.
      • Google Chrome (Android) : The body class should change from safari, android to chrome, android.
      • Microsoft Edge: The body class should change from safari to edge.
      • Mobile safari: The class ios should exist, safari class should be removed.

      And there are some CSS styling for safari class that are not sure if they are styled for Safari, Chrome or Edge (because they are all return the same class name), we should check to make sure.

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/18