'reqAnimFrame' function in Opera - opera

I tried to run the example: http://tutorials.jenkov.com/html5-canvas/animation.html.
But it gives me following error on Opera 12+:
Uncaught exception: TypeError: 'reqAnimFrame' is not a function.
Thanks
Sneha

The proposed requestAnimationFrame() method is not yet implemented in Opera. It will be supported in a future version, for now you will need a JavaScript that falls back to using setTimeout() in browsers that do not support requestAnimationFrame().
The script you linked to makes no attempt to be compatible with older browsers. In fact, it event doesn't attempt to be compatible with future browsers that will presumably drop the prefixes and define just window.requestAnimationFrame(). It would be a good idea for the author to amend the script to fix these issues in his demo - it's not really hard to do so.

Related

Patch Gecko to introduce a synonym for a supported CSS property ("appearance" for "-moz-appearance")

I am working on a firefox fork and would like to duplicate -moz-apperance as appearance. I have tried duplicating it as a shorthand property but this throws errors at the compile stage using ./mach build The documentation seems cryptic.
There's documentation about implementing new CSS properties, which might be hard to follow, but browsers are complex pieces of software.
(Currently this question is too broad to provide an answer that's not link-only.)
update: an actual answer from dbaron (via mozilla.dev.platform):
by adding entries to:
https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSPropAliasList.h

API changes in Thunderbird 24

Is there a list of the breaking API changes in Thundebird 24? So it is possible to easier find incompatibilities in addons.
The difficulty is that error console does not show any error or warning, so it is quite hard to locate the bug caused by the change of API.
I had the same headache.
Error console)
The Error Console is deprecated in Firefox, and is now only made
available if you set the devtools.errorconsole.enabled preference to
true.
In TB: File->Preferences->Advanced->General->Config editor...
Changes for TB 24)
This is not so clear but i found only this list.
I hope these hits will help you and trust me, I really know how you feel. I also felt this frustration when I had to rewrite parts of my code 1 day before the planned release. :)

Dojo DEPRECATED dojo.moduleUrl

Hellow I have one project and while running it I got some warnings:
DEPRECATED: dojo.moduleUrl() use require.toUrl -- will be removed in
version: 2.0
but where is no "moduleUrl" uses in my project, does anybody know how to fix it ? Thanx
You don't say what version of Dojo you are using, but I assume it is 1.9. According to a quick scan dojo.moduleUrl() is used in the dojox section about 40 times. dojo.moduleUrl itself is reporting that it is deprecated.
I would expect that when Dojo 2.0 comes out all the dojox widjets will be upgraded accordingly and your worries will be at an end.
Update: Just noticed a similar answer has been posted while I've been thinking of mine :-)
Some code in the dojox package still uses this function. Are you using anything from the dojox package?
If you want to find out what code is calling it, use the uncompressed dojo files and put a breakpoint in dojo/_base/kernal on ~line 282 (depending on version). When the breakpoint is hit, look at the call stack.
This message is only a warning and not an error, so your code isn't broken.

IE10: msxml.load(document.all("UserInfo") is throwing an error

I have a XML String with in the <xml> tags in a .jsp file and I am trying to load that xml using xmldoc.Load(document.all("Info")) and it is giving an error
Invalid procedure call or argument
but everything works in Ie9. When I inspect the document.all("Info") it says
Object UnknownHTMLElement in IE 10 and Object in IE9.
here is the code snippet which I used
var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
boolXMLLoaded=xmldoc.load (document.all("UserInfo"))
<xml id=UserInfo>`
<?xml version='1.0'?><RESPONSES UserName=" DOUGLAS ................
</xml>
Any help is greatly appreciated..
The reason your code doesn't work in newer IE versions is because you're using obsolete (very very obsolete) code. You need to update to modern web standards if you expect modern browsers (including IE10) to work.
Two issues are obvious immediately:
document.all has been deprecated for years; you shouldn't be using it -- it is non-standard and only still exists to allow backward-compatibility with ancient versions of IE (eg IE5). Modern IE versions won't like it, and it definitely doesn't work on browsers other an IE.
In most cases, if you're trying to reference an element by ID (as in this case), you should use document.getElementById() instead.
Further info from Mozilla Developer Network.
new ActiveXObject("MSXML2.DOMDocument.3.0") is also non-standard and deprecated, and also shouldn't be used in modern browsers. Again, it is IE-specific, and was replaced from IE7 onward with the web standards alternative.
You should replace it with document.implementation.createHTMLDocument();. See also the anwsers here.
If you need to support IE6 or earlier then you can detect whether the browser supports the standard syntax and provide a fall back to the old ActiveX control only for old IE versions.
Given that the tiny bit of code you've shown us is using two obvious and well known features that are so badly out-of-date, I would expect to see more problems of a similar nature if we were to see more of your code. Because of this, I would recommend posting some of your code on SO's sister site https://codereview.stackexchange.com/ to get some additional feedback on how you can improve it.
Hope that helps.
var xmldoc= new ActiveXObject("Microsoft.XMLDOM");
replace this in place of
var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
and try it again

Updating to PHP 5.3 with deprecated functions warning disabled

I'm very keen to update a number of our servers to PHP 5.3. This would be in readiness for Zend Framework 2 and also for the apparent performance updates. Unfortunately, i have large amounts of legacy code on these servers which in time will be fixed, but cannot all be fixed before the migration. I'm considering updating but disabling the deprecated function error on all but a few development sites where i can begin to work through updating old code.
error_reporting(E_ALL ^ E_DEPRECATED);
Is there any fundamental reason why this would be a bad idea?
Well, you could forget that you set the flag and wonder why your application breaks in a next PHP update. It can be very frustrating to debug an application without proper error reporting. That's one reason I can think of.
However, if you do it, document it somewhere. It can save you a couple of hours before you remember setting the flag at all.
If you haven't already you should read the migration guide with particular focus on Backward Incompatible Changes and Removed Extensions.
You have bigger issues than deprecation. Ignoring E_DEPRECATED will not suffice. Because of the incompatible changes there will also be other type of errors or, maybe, even worse, unexpected behaviors.
Here's a simple example:
<?php
function goto($line){
echo $line;
}
goto(7);
?>
This code will work fine and output 7 in PHP 5.2.x but will give you a parse error in PHP 5.3.x.
What you need to do is take each item in that guide and check your code and update where needed. To make this faster you could ignore the deprecated functionality in a first phase and just disable error reporting for E_DEPRECATED, but you can't assume that you will only get some harmless warnings when porting to another major PHP branch.
Also don't forget about your hack and fix the deprecated issues as soon as possible.
Regards,
Alin
Note: I tried to answer the question from a practical point of view, so please don't tell me that ignoring warnings is bad. I know that, but I also know that time is not an infinite resource.
I presume you have some kind of test server? If not, you really should set one up and test your code in PHP 5.3. If your code is thoroughly Unit Tested, testing it will take seconds, and fixing it will be fairly quick too, as the unit tests will tell you exactly where to look. If not, then consider making Unit Testing it all a priority before the next release, and in the meantime go through it all, first with E_DEPRECATED warnings disabled and fix anything which comes up, then with it re-enabled once you have time. You could also run a global find-and-replace for easier to fix errors.