[ 
https://issues.apache.org/jira/browse/MYFACES-4498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637706#comment-17637706
 ] 

Werner Punz edited comment on MYFACES-4498 at 11/23/22 1:48 PM:
----------------------------------------------------------------

The link style  change is a bug in our codebase... will be fixed
The script disappearing already documented above. 
I will fix it for the new codebase first where I can set dedicated unit tests 
for this case and then fix it 
for our old codebase if requested/needed.
Reedit:
The Link stylesheet bug is a bug in the mona-dish codebase very likely carried 
over from the old myfaces codebas where this transformation was needed to apply 
styles in IE6 as far as I recall, but definitely obsolete now!

Not having the script elements being sticky in a head replace is clearly a bug, 
I already have the sticky flag in the codebase for script evaluation, it very 
likely is not used for this case.




was (Author: werpu):
The link style  change is a bug in our codebase... will be fixed
The script disappearing already documented above. 
I will fix it for the new codebase first where I can set dedicated unit tests 
for this case and then fix it 
for our old codebase if requested/needed.
Reedit:
The Link stylesheet bug is a bug in the mona-dish codebase very likely carried 
over from the old myfaces codebas where this transformation was needed to apply 
styles in IE6!

Not having the script elements being sticky in a head replace is clearly a bug, 
I already have the sticky flag in the codebase for script evaluation, it very 
likely is not used for this case.



> TCK: Issue 4345 : Head Element Not Updated As Expected via Ajax Call
> --------------------------------------------------------------------
>
>                 Key: MYFACES-4498
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4498
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 4.0.0-RC2
>            Reporter: Volodymyr Siedlecki
>            Assignee: Werner Punz
>            Priority: Major
>         Attachments: test-faces22-ajax.war
>
>
> Test Code: 
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/test/java/ee/jakarta/tck/faces/test/servlet30/ajax/Issue4345IT.java#L47]
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/main/webapp/issue4345result.xhtml]
>  
> [https://github.com/jakartaee/faces/blob/4.0.1/tck/faces22/ajax/src/test/java/ee/jakarta/tck/faces/test/servlet30/ajax/Issue4345IT.java#L47]
> This test was created for ensure HTML is only escaped twice ([Issue 
> 4345|https://github.com/eclipse-ee4j/mojarra/issues/4345). However, MyFaces 
> is encountering two problems with this test.
> Firstly, here is the Ajax response and the updated HTML: 
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <partial-response id="j_id__v_0">
>    <changes>
>       <update id="jakarta.faces.ViewRoot">
>          <![CDATA[<!--
>             Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights 
> reserved.
>             
>             This program and the accompanying materials are made available 
> under the
>             terms of the Eclipse Public License v. 2.0, which is available at
>             http://www.eclipse.org/legal/epl-2.0.
>             
>             This Source Code may also be made available under the following 
> Secondary
>             Licenses when the conditions for such availability set forth in 
> the
>             Eclipse Public License v. 2.0 are satisfied: GNU General Public 
> License,
>             version 2 with the GNU Classpath Exception, which is available at
>             https://www.gnu.org/software/classpath/license.html.
>             
>             SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH 
> Classpath-exception-2.0
>             
>             --><!DOCTYPE html>
>             <html xmlns="http://www.w3.org/1999/xhtml";><head>
>                 <!-- h:outputStylesheet does not support params in the URL, 
> so generate a similar link manually. -->
>                 <!--<h:outputStylesheet 
> name="issue4345.css?firstParam=1&amp;secondParam=2" />-->
>                 <link type="text/css" rel="stylesheet" 
> href="/test-faces22-ajax/jakarta.faces.resource/issue4345.css.xhtml?firstParam=1&amp;secondParam=2"
>  /><script type="text/javascript" 
> src="/test-faces22-ajax/jakarta.faces.resource/issue4345.js.xhtml?firstParam=1&amp;secondParam=2"></script></head><body></body>
>             </html>]]>
>       </update>
>       <update id="j_id__v_0:jakarta.faces.ViewState:1">
>          <![CDATA[ZmY2MjMxN2MxYTY3OTg1MTAwMDAwMDA0]]>
>       </update>
>    </changes>
> </partial-response> {code}
> The HTML is then set as : 
> {code:java}
> <html xmlns="http://www.w3.org/1999/xhtml";>
>    <head>
>       <style rel="stylesheet" type="text/css">@import 
> url('/test-faces22-ajax/jakarta.faces.resource/issue4345.css.xhtml?firstParam=1&secondParam=2');</style>
>    </head>
>    <body></body>
> </html>
>  {code}
> 1) We change from a link (type/css ) to a style tag that imports the URL? 
> Should that occur?  The JavaScript in issue4345result.xhtml specifically 
> looks for a link element. 
> 2) The script tags *are not appended* to the head element, but I do see 
> network requests for them. Additionally, the scripts do run (confirmed by the 
> console: "issue4345.js loaded." ). 
> This fails on both the RC2 scripts and the new TypeScript code. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to