myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <martin.kocicak.k...@gmail.com>
Subject Re: [core] Firefox 4 - <script> in XHR executed 2x?
Date Wed, 22 Jun 2011 12:42:51 GMT
Hi,

we'll try firefox 5, thank you for your help.

Thanks,

Kočičák

Werner Punz píše v Út 21. 06. 2011 v 21:45 +0200:
> Ok final verdict.
> What we have here is a bug in Firefox which apparently is fixed already 
> with the current version 5.
> 
> One script tag in the html element refreshed, the eval is not performed 
> which is the correct behavior according to the w3c and also to Mozilla.
> Two script tags, an auto eval is performed and then my eval code also 
> runs over the eval. Hence my auto eval detection code also fails which 
> just inserts only one tag.
> 
> To bring the question to the point, I am rather reluctant to try to 
> bypass this issue on my codebase, because i might open a can of worms 
> here with a Mozilla specific hack, what if I enable it and in another 
> situation (mabe another bunch of tags in a weird combination) the 
> falsely applied auto eval again is turned off?
> 
> All I can say is please give Firefox 5 a try, for me the problem is not 
> there, although I have yet to test it with version 5 for Windows.
> And if the problem still is there, I will file a bugreport on the 
> Mozilla side.
> 
> 
> werner
> 
> 
> 
> Am 21.06.11 21:32, schrieb Werner Punz:
> > Hi Martin, I can reproduce the problem, but funnily only in firefox 4
> > under windows. Firefox 5 under osx shows me the correct result.
> > I will investigate why that problem is, but this looks eerily like a
> > browser problem maybe of only one firefox version to me.
> >
> > Werner
> >
> >
> > Am 21.06.11 21:23, schrieb Werner Punz:
> >> Ok I will have a look at it, and them come back with the results.
> >>
> >> Werner
> >>
> >>
> >> Am 21.06.11 20:03, schrieb Martin Koci:
> >>> Hi,
> >>>
> >>> collegue of me did this a small test page (pasted below). Do you see
> >>> something wrong there?
> >>>
> >>> Thanks,
> >>>
> >>> Kočičák
> >>>
> >>> <h:commandButton value="Reload panel">
> >>> <f:ajax execute="@none" render="outputWriter" />
> >>> </h:commandButton>
> >>>
> >>> <script type="text/javascript">
> >>> var counter = 0;
> >>> function writeCounter() {
> >>> document.getElementById('output').innerHTML += (counter
> >>> ++) + ' ';
> >>> }
> >>> </script>
> >>>
> >>> <h:panelGroup id="output" layout="block" style="width: 400px;
> >>> height: 400px; border: 1px solid black;" />
> >>>
> >>> <!--
> >>> If this panelGroup contains only one script, it works well - the
> >>> script
> >>> is evaluated only once - in runScripts() from jsf.js.
> >>> But if it contains more script elements, the following code from
> >>> jsf.js _outerHTMLCompliant() evaluates them first:
> >>> item.parentNode.replaceChild(ret, item);
> >>> And then runScripts() evaluates them also.
> >>> -->
> >>> <h:panelGroup id="outputWriter">
> >>> <h:outputScript>
> >>> writeCounter();
> >>> </h:outputScript>
> >>>
> >>> <h:outputScript>var a;</h:outputScript>
> >>> </h:panelGroup>
> >>>
> >>>
> >>> Werner Punz píše v Út 21. 06. 2011 v 19:17 +0200:
> >>>> Actually the problem sounds like you get an auto eval and then the
> >>>> manual eval.
> >>>> However it also could be possible that you have the script twice in
> >>>> your
> >>>> dom tree when the scripts are evaled.
> >>>>
> >>>>
> >>>> Werner
> >>>>
> >>>>
> >>>> Am 21.06.11 12:24, schrieb Martin Koci:
> >>>>> Hi,
> >>>>>
> >>>>> ok, I'll investigate it more; I'll try isolate the problem in small
> >>>>> reproducible example, if possible. Most likely is problem in my
code.
> >>>>>
> >>>>> Thanks,
> >>>>>
> >>>>> Kočičák
> >>>>>
> >>>>> Werner Punz píše v Po 20. 06. 2011 v 22:33 +0200:
> >>>>>> Am 20.06.11 21:18, schrieb Martin Koci:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> I'm not very familiar with JavaScript, so I ask first if
it is
> >>>>>>> bug or
> >>>>>>> not:
> >>>>>>>
> >>>>>>> If<script> element is in XHR response, who is responsible
for
> >>>>>>> execute
> >>>>>>> that script? I found [1] so I suppose that runScripts function
> >>>>>>> does it
> >>>>>>> in MyFaces. With Firefox 4 it seems that<script> is
executed 2x:
> >>>>>>> first
> >>>>>>> time when DOM is replaced and second time from runScripts
> >>>>>>> function. But
> >>>>>>> I didn't debug it much ... problem can be anywhere else.
I don't
> >>>>>>> have
> >>>>>>> this problem with Firefox 3.6.
> >>>>>>>
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>>
> >>>>>>> Kočičák
> >>>>>>>
> >>>>>>> [1] http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-724
> >>>>>>>
> >>>>>>>
> >>>>>> Ok this is strange because it actually should not happen due
to two
> >>>>>> reasons.
> >>>>>> a) Firefox does not do any auto eval post 3.6
> >>>>>> b) I have auto eval detection code which is browser independend
> >>>>>> by adding a small inline script post load which sets a global
> >>>>>> variable.
> >>>>>>
> >>>>>>
> >>>>>> This is actually one of my standard testcases and firefox 4
one of my
> >>>>>> testing targets so this should have been crawled up at my last
> >>>>>> testing
> >>>>>> cycle.
> >>>>>> I will investigate this issue this week nevertheless, which
> >>>>>> platform do
> >>>>>> you get the double eval and which exact Firefox version?
> >>>>>>
> >>>>>>
> >>>>>> Werner
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
> 
> 
> 



Mime
View raw message