Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18024

ezjscore outputs not valid xhtml transitional code for generated css content

    XMLWordPrintable

Details

    Description

      Hi there.
      When you try to add your own functions for generating a specific css code that should to be put inline, ezjscore outputs not valid xhtml acording to the w3c validator.

      Problem come because of ezjscPacker::buildStylesheetTag

      When is not a css file but a css content, function output

      $ret .= $packedFile ? "<style rel=\"$rel\" type=\"$type\"$media>\r\n$packedFile\r\n</style>\r\n" : '';
      

      but rel attribute is not supported by style tag, according to xhtml 1 transitional DTD [1].

      ...
      <!ELEMENT link EMPTY>
      <!ATTLIST link
        %attrs;
        charset     %Charset;      #IMPLIED
        href        %URI;          #IMPLIED
        hreflang    %LanguageCode; #IMPLIED
        type        %ContentType;  #IMPLIED
        rel         %LinkTypes;    #IMPLIED
        rev         %LinkTypes;    #IMPLIED
        media       %MediaDesc;    #IMPLIED
        target      %FrameTarget;  #IMPLIED
        >
      
      <!-- style info, which may include CDATA sections -->
      <!ELEMENT style (#PCDATA)>
      <!ATTLIST style
        %i18n;
        id          ID             #IMPLIED
        type        %ContentType;  #REQUIRED
        media       %MediaDesc;    #IMPLIED
        title       %Text;         #IMPLIED
        xml:space   (preserve)     #FIXED 'preserve'
        >
      ...
      

      I think we can safely remove that rel=\"$rel\" for this case.

      [1] http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional

      Steps to reproduce

      Attached is a small extension to ilustrate the problem. i've called it 'test'. unpack the files in your extension folder and activate the extension.
      regenerate your autoloads and your caches
      give permissions to anonymous users to ezjscore/call/test_testcss.

      if all goes as expected and you're using a standard you will see color of main text will turn red. but if you try to validate againts w3c validator, you will get errors related to the style tag produced.

      Attachments

        Activity

          People

            andre1 andre1
            desorden desorden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: