This project is archived and is in readonly mode.

#165 ✓resolved
Fred Chasen

Safari 2.0.x support

Reported by Fred Chasen | June 25th, 2008 @ 11:57 PM

Many parts of 1.2 still work with Safari 2, but the adding fx gives a "Parser error" on line 1071 - which is the code for making the function.caller work with browsers that do not support it.

The comment mentions that only opera falls into this category, but I believe that safari does as well.

This can be seen on the demos when view in any version of safari under 3.

Comments and changes to this ticket

  • Fred Chasen

    Fred Chasen June 27th, 2008 @ 06:29 PM

    
    if (!arguments.callee.caller) self[key] = eval('(' + String(current).replace(/\bthis\.parent\(\s*(\))?/g, function(full, close){
      					return 'arguments.callee.parent.call(this' + (close || ', ');
    }) + ')');
    
    

    This seems to be the line that is stopping the script.

    If 1.2 is still going to support version 2 of Safari this seems like a pretty critical issue.

    Any ideas on how to get around it?

  • Thomas Aylott

    Thomas Aylott June 27th, 2008 @ 09:00 PM

    • Tag changed from 1.2, critical to 1.2, critical, safari2

    Did you test this with the Safari 2 standalone or on a real Tiger system before the latest system update?

    Can you make a simple testcase html file that I can use to test this easily? I'm going to try and get Tiger installed on one of my external drives so I can still test against it.

    Thanks

  • Thomas Aylott

    Thomas Aylott June 27th, 2008 @ 09:00 PM

    • Milestone changed from 2.0 to 1.2.1
  • Fred Chasen

    Fred Chasen August 1st, 2008 @ 05:39 PM

    Tested on a real tiger system. Still gives the same errors

    Here is the test case I have been using.

    As you can see, if you comment out the fx class it will run just fine.

    But add the fx's in and it will choke.

    Thanks for having a look.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/...">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>Safari 2.0 Test</title>
    <script src="js/mootools-1.2-core-nc.js" type="text/javascript"></script>
    
    
    <script type="text/javascript">
    		window.addEvent('domready', function(){
    			
    			// Try commenting this out to see the other parts work just fine
    			var fx_left = new Fx.Tween('tmpLink', {duration:4200, wait:false});
    			
    		
    			$$('span').each(function(item, index){
    				var tmpLink = item.getElement('a').getProperty('href');
    				$('tmpLink').setStyle('background', 'purple');
    				
    				//Better Comment this line as well.
    				fx_left.start('margin-top', 200);
    				
    			});	
    			
    		}); 
    
    
    </script>	
    </head>
    <body>
    	<span>I am a test sentence <a href = "donley">ohhey</a></span>
    	<div id = "tmpLink">i am tmp</div>
    </body>
    </html>
    
  • Fred Chasen

    Fred Chasen July 7th, 2008 @ 08:05 PM

    Thomas did you have a chance to test this?

    Sounds like safari 4 might be having the same issue as well.

    thanks!

  • Thomas Aylott

    Thomas Aylott July 7th, 2008 @ 09:25 PM

    I haven't gotten to it yet. Things are very crazy over here atm.

    But if you managed to reproduce it on a real Tiger system then that's

    good enough for me.

  • caktux

    caktux July 26th, 2008 @ 11:20 PM

    I confirm this bug in Safari 2.0.4 on Tiger. Would it be possible to get around function.caller to make Class.Mutators more cross-browser?

  • Jan Kassens

    Jan Kassens July 27th, 2008 @ 10:01 AM

    • State changed from “new” to “open”
  • Kee Hinckley

    Kee Hinckley July 28th, 2008 @ 11:49 PM

    I just spent several hours trying to figure out why Tween wasn't working in Safari 4 (Developer Version). It also came down to the parent() routine. arguments.callee is null. So I can confirm that this is a problem in Safari 4.

  • Kee Hinckley

    Kee Hinckley July 30th, 2008 @ 11:08 PM

    At this point I am pretty sure that the problem in Safari 4 is a Safari 4 bug. arguments.callee works fine throughout the code, it is null only in the following routine:

    self.parent = function(){

    return arguments.callee.caller.parent.apply(this, arguments);

    };

  • bxbx

    bxbx July 31st, 2008 @ 07:36 AM

    Just curious but... is there any real reason for not discontinuing Safari 2.x support?

  • CroNiX

    CroNiX July 31st, 2008 @ 04:58 PM

    Probably the same reason for not discontinuing IE6 support...people still use it.

  • Fred Chasen

    Fred Chasen July 31st, 2008 @ 05:10 PM

    yep, for me safari 2 support is very necessary, as often computers that are still running 10.4 use it.

    I would love to forget about it, but that's simply not an option for many of us.

  • Thomas Aylott
  • Thomas Aylott

    Thomas Aylott August 1st, 2008 @ 06:39 PM

    • Tag changed from 1.2, critical, safari2 to 1.2, critical, options, patch, safari2, spec

    Here's a more simplified Spec proving the issue.

    It seems like it's a bug that only shows up for classes that Implement: Options

  • Thomas Aylott

    Thomas Aylott August 1st, 2008 @ 07:44 PM

    Temporary fix: 0001-Temporary-fix-for-the-Safari2-165.patch

    Here's a hacky workaround for this bug that should get you back up and running until the bug is completely fixed.

  • Thomas Aylott

    Thomas Aylott August 1st, 2008 @ 07:46 PM

    • Assigned user changed from “Valerio” to “Thomas Aylott”

    0001-Temporary-fix-for-the-Safari2-165.patch

  • Lukas Rieder

    Lukas Rieder August 11th, 2008 @ 02:53 PM

    • Title changed from “Safari 2.0.x support” to “Temporary fix doesn't work out”

    Hy,

    so this Problem will be fixed with 1.2.1 bug fix release? I've applied the '0001-Temporary-fix-for-the-Safari2-165.patch' from Thomas Aylott, but the problem is still there.

    Safari (v2) Debug says there's a problem in line 1071, wich points to setOptions.

    Have a nice day,

    Lukas - hopefully waiting for 1.2.1

  • Lukas Rieder

    Lukas Rieder August 11th, 2008 @ 02:55 PM

    • Title changed from “Temporary fix doesn't work out” to “Safari 2.0.x support”

    (really sorry, I'm not that familiar with lighthouse yet)

  • Thomas Aylott

    Thomas Aylott August 15th, 2008 @ 07:36 AM

    
    (function(){return /^on[A-Z]/}).toString()
    

    Safari2 returns "function () { return ^on[A-Z]; }"

    That's not cool™

  • Thomas Aylott

    Thomas Aylott August 19th, 2008 @ 09:35 PM

    • Milestone cleared.
    • Tag changed from 1.2, critical, options, patch, safari2, spec to 1.2, critical, safari2

    Ok guys. Looks like Safari 2 has a major bug and a major missing feature.

    I need to know from you guys exactly why you need Safari 2 support.

    What is likely going to happen is that Safari 2 support will be dropped from 1.2 and all future releases.

    There's a chance that someone will do a custom build of MooTools 1.2 with Safari 2 support if people really still need it.

    How many people are interested?

  • caktux

    caktux August 19th, 2008 @ 09:49 PM

    While you're there, why not drop support for IE6 and Opera? It's not like IE6 didn't have major bugs too... And btw, the major bug is in MooTools 1.2 since arguments.caller was deprecated in JavaScript 1.4, so it should simply not be used in MooTools.

  • Tom Occhino

    Tom Occhino August 20th, 2008 @ 04:31 AM

    @caktux

    1. MooTools does not use arguments.caller anywhere in the source, and yes, we know it's been deprecated. We use Function.caller which replaced arguments.caller, and was recently added, not deprecated. (the function it is called on happens to be arguments.callee) http://developer.mozilla.org/en/...
    2. Function.caller is not deprecated, rather, it is just non-standard. All browsers except Opera, however support it. (This includes Safari3+, Firefox2+ and IE6+)
    3. Yahoo and Sun have both dropped support for Safari2. After developing for it for a while, you will see why Apple has likely even dropped support for this JavaScript crippled browser.

    Please use a little more discretion, and a little less sarcasm next time you post

  • Fred Chasen

    Fred Chasen August 20th, 2008 @ 05:20 PM

    Some of us really do still need safari support. It has sadly kept me from updating to 1.2 and if support is discontinued I will never be able to.

    In our office we have many macs that are still using 10.4, many of which are still using safari 2. I believe that if you have not updated to 10.4.11 you can't use safari 3.

    There will always be a client that has an older laptop and something like this can cause a project to stop in its tracks.

    I believe that caktux is trying to say that dropping support for a browser is a huge change, even if it is not that commonly used.

    Mootools seems to have the current browser version and one version before it supported for all browser and it would be great if safari was not the expetion.

  • Anthony McLin

    Anthony McLin August 20th, 2008 @ 05:45 PM

    Since Safari 3 doesn't show up until OSX 10.4.11, you can't guarantee that any Mac users except for Leopard are using it. I'd be very curious to see adoption rates for incremental OSX updates because I know a lot of corporate and school environments refuse to rollout system updates because of maintenance and compatibility issues, and many home users are quite lax in updating their systems.

    Safari 3 is only 10 months old as bundled w/ Leopard and the 10.4.11 update. That really is far to quick to be removing support. After all, IE7 is only 17 months old and IE6 is still supported.

    I have to keep Safari 2 around for testing purposes because the majority of my Mac-using coworkers and clients are still on 10.4.8 or so. I can get away with convincing clients that they can't use Safari on the private back-ends of their sites (where other Javascript issues like MCE apply) but clients don't buy the argument that their users will have to upgrade. In fact, when that discussion happens, the client usually chooses to remove the additional functionality, so in this scenario, no mootools 1.2.

    This specific bug though is what's keeping sites from working on Safari 2. While I don't expect support for every last feature and function in Safari 2, but this bug makes the entire effects class unusable.

    The cart-blanc release of 1.2 (with its claim of Safari 1.2 support) was a real problem. Fixing this bug leaves Safari 2 support mostly working (albeit deprecated) and would be a huge boon for those of us trying to switch to 1.2. By the time 1.3 rolls out, it won't be an issue any more.

    A real world example. We're rebuilding our site (currently Flash) to use Mootools. Of our daily unique visitors (our own visits already excluded), 22% use Safari on OSX. I would like to give more time before cutting out support for our clients, and also before cutting out support for my boss and coworkers.

  • Thomas Aylott

    Thomas Aylott August 20th, 2008 @ 07:30 PM

    Would you be willing to use a custom build of mootools 1.2?

    We could make a fork that fully supports safari 2 by reverting to some of the older inheritance code. You would lose some of the new inheritance syntax though.

    -- Thomas Aylott / SubtleGradient (from iPhone)

    On Aug 20, 2008, at 12:46 PM, Lighthouse support@lighthouseapp.com wrote:

  • Fred Chasen

    Fred Chasen August 20th, 2008 @ 07:44 PM

    I think that would work fine.

    Maybe another alternative is degrading more gracefully.

    For instance with effect:

    Right now it stops all JavaScript in its tracks when a effect is called.

    Would it be possible for this to throw a warning instead of the error, so that if you are using safari 2 you can have a conditional event set up?

    Say you had a fade from opacity 0-1, maybe in safari it could just set opacity to 1.

    I certainly understand that people using an older browser might not get the full experience, but hopefully we can avoid totally disabling it.

  • Thomas Aylott
  • Thomas Aylott

    Thomas Aylott August 20th, 2008 @ 10:18 PM

    Can you guys do some testing for me?

    Here's a version of MooTools that I just built from my gitHub fork's safari2 branch

    Please let me know if you encounter ANY warnings, errors or anything when using this build.

    
    var MooTools = {
    	'version': '1.2dev',
    	'build': '7e342ac35901e9d64f4e008eb64b6ac0ab267d60'
    };
    
  • Fred Chasen

    Fred Chasen August 21st, 2008 @ 05:52 PM

    Tested on 2.0.4 standalone on 10.4 and works great with the effects demo and a few other scripts.

    I will test it on some real tiger systems in a bit

  • Tom Occhino

    Tom Occhino October 3rd, 2008 @ 04:50 AM

    • State changed from “open” to “resolved”
    • Tag changed from 1.2, critical, safari2 to safari2

    Safari 2.x support is back with the newly refactored Class.js

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Tags

Pages