This project is archived and is in readonly mode.

#732 ✓resolved
Oskar Krawczyk

Methods failing on Element Collection in Safari 4

Reported by Oskar Krawczyk | August 11th, 2009 @ 01:45 PM | in 2.0 (closed)

I've noticed that before but figured I was doing something wrongly, but apparently more and more people are noticing this problem.

A simple:

$$('div').hide() will not work on Safari 4 (alone).

To make it work we need to alter the implementation:

Array.implement({
  hide: function() {
    this.setStyle('display', 'none');
  }
});

From what I see, none of the Shortcuts work– Setters and Getters do work.

Please see the sample case: http://mooshell.net/bhtsj/1

Best,
Oskar

Comments and changes to this ticket

  • Sebastian Markbåge

    Sebastian Markbåge August 11th, 2009 @ 02:49 PM

    • Assigned user changed from “Aaron Newton” to “Sebastian Markbåge”
    • State changed from “new” to “open”

    This is related to the same problem as this: https://mootools.lighthouseapp.com/projects/24057/tickets/72-mootoo...

    It was a major bug in Webkit's JavaScript engine which could lead to more issues. It has been fixed in Webkit but is not yet picked up by Safari.

    You can get around it by not using Elements (or $$) before you implement methods on it. The URI class in MooTools More uses $$ it on first run but won't in the next release. So any subsequent extensions won't work. We have a more solid patch for Core under consideration that works around this bug.

  • Oskar Krawczyk

    Oskar Krawczyk August 11th, 2009 @ 10:42 PM

    • Assigned user cleared.

    Good news everybody, the newest update of Safari (4.0.3) fixes the problem.

  • Scott Kyle

    Scott Kyle August 19th, 2009 @ 08:47 PM

    • State changed from “open” to “resolved”

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