Skip to content

[Bug]: CDF - Two Small Issues Rendering DnnXxIncludes -- v10.02.00 RC2 #6850

@jeremy-farrance

Description

@jeremy-farrance

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

See code below for details and to reproduce using Aperture default.aspx

Issue 1A: double forward slash after SkinPath

Issue 3A: multiple rel attributes are not supported, only the last one is used by the browser... given "preconnect" (or "preload"), don't add rel="stylesheet".

Steps to reproduce?

In a new deploy or DNN v10.02.00 RC2, Insert everything below into ~/Portals/_default/Skins/Aperture/default.aspx at line 4.

<%-- copy+paste this into Aperture default.ascx at line 4 to test --%>

<%-- Test 1
  - Issue 1A: double forward slash after SkinPath
  - fantastic that the unnecessary type="text/css" is removed 
--%>
<dnn:DnnCssInclude
  FilePath="public/YOUR_FILE_HERE"
  PathNameAlias="SkinPath"
  Priority="16"
  runat="server"
/>

<%-- 
Results in DNN v10.02.00 RC2:
<link href="/Portals/_default/Skins/Aperture//public/YOUR_FILE_HERE?cdv=50" rel="stylesheet">
                                            ^^
Results in DNN v10.01.02:
<link href="/Portals/_default/skins/Aperture/public/YOUR_FILE_HERE?cdv=223" type="text/css" rel="stylesheet">
--%>


<%-- Test 2
  - async and defer attributes render correctly, without =""
--%>
<dnn:DnnJsInclude
  FilePath="~/Portals/0/notapath/ae44c967ae.js"
  ForceProvider="DnnFormBottomProvider"
  HtmlAttributesAsString="async defer crossorigin:anonymous" 
  Priority="99"
  runat="server"
/>

<%-- 
Results in DNN v10.02.00 RC2:
<script src="/Portals/0/notapath/ae44c967ae.js?cdv=50" type="text/javascript" async defer crossorigin="anonymous"></script>

Results in DNN v10.01.02:
<script src="/Portals/0/notapath/ae44c967ae.js?cdv=50" type="text/javascript" async="" defer="" crossorigin="anonymous"></script>
--%>


<%-- 3. How close can we get to Google Fonts docs?
  - Issue 3A: multiple rel attributes are not supported, only the last one is rendered... given "preconnect" (or "preload"), don't add "stylesheet"
  - ampersands in href are okay converted or not 
  - in HTML5, end brackets with "/>" or ">" are both valid
--%>

<%-- Copied contents from Google for [font-name]
https://fonts.google.com/specimen/MuseoModerno
https://web.dev/learn/performance/optimize-web-fonts 
--%>
<dnn:DnnCssInclude
  FilePath="https://fonts.googleapis.com"
  Priority="2"
  ForceProvider="DnnPageHeaderProvider"
  HtmlAttributesAsString="rel:preconnect"
  runat="server"
/>
<dnn:DnnCssInclude
  FilePath="https://fonts.gstatic.com"
  Priority="2"
  ForceProvider="DnnPageHeaderProvider"
  HtmlAttributesAsString="crossorigin rel:preconnect"
  runat="server"
/> 
<dnn:DnnCssInclude
  FilePath="https://fonts.googleapis.com/css2?family=MuseoModerno:ital,wght@0,100..900;1,100..900&display=swap"
  Priority="2"
  ForceProvider="DnnPageHeaderProvider"
  runat="server"
/>

<%-- 
Expected/desired:
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=MuseoModerno:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">

Results in DNN v10.02.00 RC2:
<link href="https://fonts.googleapis.com" rel="stylesheet" rel="preconnect" /> 
<link href="https://fonts.gstatic.com" rel="stylesheet" crossorigin rel="preconnect" /> 
<link href="https://fonts.googleapis.com/css2?family=MuseoModerno:ital,wght@0,100..900;1,100..900&amp;display=swap" rel="stylesheet" />

Results in DNN v10.01.02 (corrected):
<link href="https://fonts.googleapis.com?cdv=223" rel="preconnect" type="text/css"/>
<link href="https://fonts.gstatic.com?cdv=223" crossorigin rel="preconnect" type="text/css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css2?family=MuseoModerno:ital,wght@0,100..900;1,100..900&amp;display=swap&amp;cdv=224" type="text/css" rel="stylesheet"/>

--%>




<%-- end of CDF tests, Aperture Skin below --%>

Current Behavior

Covered above, see output comparisons.

Expected Behavior

As described above.

Relevant log output

n/a

Anything else?

I plan to do more tests, main goal is to ensure compat with existing code. I plan to test the new Fluent stuff more soon-ish. :)

Affected Versions

10.02.00 RC2 or current development branch (unreleased)

What browsers are you seeing the problem on?

Chrome

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions