Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Mozilla Firefox compatibility issues (Canvas mode) (Read 9388 times)
CrushJelly
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Oct 20th, 2016
Mozilla Firefox compatibility issues (Canvas mode)
Nov 24th, 2016 at 8:49am
Print Post  
Is there any Mindfusion issues with Firefox compatibility or I should look for the answer in my app?

Now my workflow load's perfectly with Google Chrome, but when I try to load it with Firefox, it doesn't load correctly
I see weird rectangles, but nothing more, no Diagram view, no NodeListView, I open up dev. console and I see this error "NS_ERROR_FAILURE" and I see that the workflow scripts fails at some point, I even see errors in Mindfusion.Diagramming.js.

But there is one catch, after several refreshes (F5) it loads workflow correctly.

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #1 - Nov 24th, 2016 at 9:02am
Print Post  
What's the full error message? First google result for that code is something about setting font on canvas, but NS_ERROR_FAILURE could be shown for many things I guess -
https://bugzilla.mozilla.org/show_bug.cgi?id=941146
  
Back to top
 
IP Logged
 
CrushJelly
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Oct 20th, 2016
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #2 - Nov 24th, 2016 at 9:57am
Print Post  
Slavcho wrote on Nov 24th, 2016 at 9:02am:
What's the full error message? First google result for that code is something about setting font on canvas, but NS_ERROR_FAILURE could be shown for many things I guess -
https://bugzilla.mozilla.org/show_bug.cgi?id=941146


We are loading workflow through our WebForm app, than it fails, if we run just .aspx page, where is the workflow code, than it works.

But like I said earlier after several refreshes it loads.


Well it fails at this piece of code:

Code (Javascript)
Select All
MyDiagramLink = function (parent, origin, destination) {
     // Fails here see errror (MyDiagramingLink.js 4)
    MyDiagramLink.initializeBase(this, [parent, origin, destination]);
}
 



My errors:

Code
Select All
NS_ERROR_FAILURE:
ScriptResource.axd:1

	b.prototype.measureString() ScriptResource.axd:1
	q.prototype.updateText()MindFusion.Diagramming.js%20line%201%20%3E%20eval:1
	c.DiagramLink() MindFusion.Diagramming.js%20line%201%20%3E%20eval:1
	Type$initializeBase() ScriptResource.axd:1664
	MyDiagramLink() MyDiagramLink.js:4
	j.prototype.loadItem() MindFusion.Diagramming.js%20line%201%20%3E%20eval:1
	j.prototype.fromJson() MindFusion.Diagramming.js%20line%201%20%3E%20eval:1
	<anonymous> Designer.aspx:91
	Sys$EventHandlerList$getHandler/<() ScriptResource.axd:2399
	Sys$_Application$raiseLoad() ScriptResource.axd:4241
	Sys$_Application$_doInitialize() ScriptResource.axd:4336
	init() ScriptResource.axd:4173
	Sys$_Application$initialize/check() ScriptResource.axd:4184

NS_ERROR_FAILURE:
ScriptResource.axd:1

	d.prototype.draw() ScriptResource.axd:1
	c.prototype.repaint() MindFusion.Diagramming.js%20line%201%20%3E%20eval:1
	Function$createDelegate/<() ScriptResource.axd:47

NS_ERROR_FAILURE:
ScriptResource.axd:1

	b.prototype.measureString() ScriptResource.axd:1
	NodeListView.prototype.updateLayout() NodeListView.js:35
	Function$createDelegate/<() ScriptResource.axd:47

NS_ERROR_FAILURE:
ScriptResource.axd:1

	d.prototype.draw() ScriptResource.axd:1
	a.prototype.draw() ScriptResource.axd:1
	b.prototype.repaint() ScriptResource.axd:1
	Function$createDelegate/<() ScriptResource.axd:47
 

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #3 - Nov 24th, 2016 at 10:18am
Print Post  
Any improvement if you run this with CanvasVirtualScroll property set to true?
  
Back to top
 
IP Logged
 
CrushJelly
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Oct 20th, 2016
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #4 - Nov 24th, 2016 at 10:43am
Print Post  
Slavcho wrote on Nov 24th, 2016 at 10:18am:
Any improvement if you run this with CanvasVirtualScroll property set to true?


It helped a bit, now I still get NS_ERROR, but now I can see a small piece of my diagram with no DiagramLinks.
But still I don't see NodeListView, and other Diagram view half.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #5 - Nov 24th, 2016 at 10:54am
Print Post  
First thing we do in measureString is setting this.context.font as in the bugzilla report above, so it could be same problem. However if it works after some reloads, it could be related to the order in which scripts are executed, e.g. if your MyDiagramLink instance is created before the canvas is fully initialized. At what point are you calling that constructor?
  
Back to top
 
IP Logged
 
CrushJelly
Junior Member
**
Offline


I Love MindFusion!

Posts: 59
Joined: Oct 20th, 2016
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #6 - Nov 24th, 2016 at 11:42am
Print Post  
Slavcho wrote on Nov 24th, 2016 at 10:54am:
First thing we do in measureString is setting this.context.font as in the bugzilla report above, so it could be same problem. However if it works after some reloads, it could be related to the order in which scripts are executed, e.g. if your MyDiagramLink instance s created before the canvas is fully initialized. At what point are you calling that constructor?


Well it's your functions, it could be plenty of places where font is used, but I can't see those places.
I tried changing measureString with my calculations, but still I get drawing errors.

It gets called automatically (DiagramLink) when loading workflow xml, or when I draw Link.
But the same error persists even when I create empty workflow diagram.

Error when I open empty workflow:

Code
Select All
NS_ERROR_FAILURE:
ScriptResource.axd:1

d.prototype.draw http://localhost/MyCurrent/ScriptResource.axd:1:59229
	c.prototype.repaint http://localhost/MyCurrent/Scripts/MindFusion/MindFusion.Diagramming.js%20line%201%20%3E%20eval:1:344976
	Function$createDelegate/< http://localhost/MyCurrent/ScriptResource.axd:47:16
 



  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #7 - Nov 24th, 2016 at 12:49pm
Print Post  
Maybe check if disabling hardware acceleration and other options in about:preferences#advanced helps. NS_ERROR_FAILURE is an internal Firefox error (https://developer.mozilla.org/en-US/docs/Mozilla/Errors) and all you can do is look for work-around. Also check if the diagram's sample projects show same error - if they don't, the problem might be coming from the specific DOM tree configuration in your project like the type of parent element that contains the DiagramView's div, e.g. an iframe as in the bugzilla report above.
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #8 - Dec 8th, 2016 at 5:00pm
Print Post  
I have exactly the same problem with firefox...and still have not yet purchased the source code...so can't debug.
Standalone page works just fine, also samples works correct too. But when loaded from iframe, i am getting that error.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Mozilla Firefox compatibility issues (Canvas mode)
Reply #9 - Dec 9th, 2016 at 9:32am
Print Post  
You can test with some Context2D API calls if it will help you anything -

Code
Select All
<body onload="myFunction()">
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;">
</canvas>

<script type="text/javascript"">
 function myFunction() {
  var c = document.getElementById("myCanvas");
  var ctx = c.getContext("2d");
  ctx.font = "30px Arial";
  ctx.strokeText("Hello World", 10, 50);
 }
</script>
</body> 



If we load this page in a hidden iframe as bugzilla bug above we get the error, if it's in a visible one it works. Same for loading the diagram control - it shows the error if iframe is hidden, and works otherwise.

Does the same happen for you? If your diagram is inside a tab control or similar UI, the tabs there might be implemented by showing / hiding iframes.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint