Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21797

XWiki console prints warning when user is trying to apply style with CSS 3 HEX background-color rule

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 15.10.4
    • None
    • Unknown

    Description

      Prerequisite: having a custom downloaded image locally on your device.

      Step to reproduce:

      1. Login as Admin to XWiki
      2. Navigate to the dedicated test page
      3. Attached your image
      4. Insert image via below syntax during Wiki mode editing page (don't forget to replace image with yours)
        [[image:rohit-choudhari-pE37k0imUDs-unsplash.jpg||style='background-color: #FFFFFF44;']]
        
      1. Click Save & View

      Actual result:

      If you check XWiki console, there'll a line null [1:19] Invalid color "#FFFFFF44".

      Expected result:

      No new warning in XWiki console will appear.

      The issue happens only with an attempt to apply CSS3 (CSS Color Module Level 4) rules for image, HEX 4 or 8 digits. This caused by CSS Parser Bugs "CSS parser is returning an error for #RGBA and #RRGGBBAA hex color values"

      The workaround for this is to use old CSS rules https://developer.mozilla.org/en-US/docs/Web/CSS/background-color.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              npetrenko Nikita Petrenko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: