Skip to content

Serveral issues on Opera browser #411

Description

@gartz

I was trying to debug and help to find why the plataform isn't working on Opera browser, but I couldn't looks like somewhere when wrapping methods, it pass a undefined value, then it throw exception because there isn't a treatment for undefined value, it try to consider the undefined as an Object, and Opera don't allow to parse it.

The bug begins in ShadowDOM, file wrapper.js in this method:

 /**
   * Forwards existing methods on the native object to the wrapper methods.
   * This does not wrap any of the arguments or the return value since the
   * wrapper implementation already takes care of that.
   * @param {Array.<Function>} constructors
   * @parem {Array.<string>} names
   */
  function forwardMethodsToWrapper(constructors, names) {
    constructors.forEach(function(constructor) {
      names.forEach(function(name) {
        constructor.prototype[name] = function() {
          var w = wrapIfNeeded(this);
          return w[name].apply(w, arguments);
        };
      });
    });
  }

Activity

  1. gartz commented on Feb 3, 2014

    @gartz
    Author

    Ok, I'm working to fix the issues, so I have made a pull request in the HTMLImports project that add support to matchesSelector for Opera12.

    googlearchive/HTMLImports#48

    Another thing, to make HTMLImports work in Opera 12 you will need a shim for the requestFrameAnimation, that doesn't have native support on Opera 12:

    (function () {
        var lastTime = 0;
        var vendors = ['ms', 'moz', 'webkit', 'o'];
        for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
            window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
            window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
                                       || window[vendors[x]+'CancelRequestAnimationFrame'];
        }
    
        if (!window.requestAnimationFrame)
            window.requestAnimationFrame = function(callback, element) {
                var currTime = new Date().getTime();
                var timeToCall = Math.max(0, 16 - (currTime - lastTime));
                var id = window.setTimeout(function() { callback(currTime + timeToCall); },
                  timeToCall);
                lastTime = currTime + timeToCall;
                return id;
            };
    
        if (!window.cancelAnimationFrame)
            window.cancelAnimationFrame = function(id) {
                clearTimeout(id);
            };
    })();
    

    Soon I found other needs for Opera 12 support I will add here.

  2. gartz commented on Feb 4, 2014

    @gartz
    Author

    Another fix to add shadowDOM support to Opera 12: googlearchive/ShadowDOM#373

  3. arv commented on Feb 11, 2014

    @arv
    Contributor

    Sorry. Wont Fix.

    Opera 12 is discontinued and will never get native support for web components. Our goal is to get rid of these polyfills eventually and a discontinued browser is not going to help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions