#959 enhancement
bradrees

Prototype does not load on the Playstation 3 browser (NetFront)

Reported by bradrees | December 7th, 2009 @ 04:18 PM

If you try to load prototype on the Playstation 3 browser it fails.

Attached is a patch that will make Prototype load and most of the functions work.

Since I cannot get custom events working I have added a new method: Event.domLoaded(handler). This will execute the supplied handler when the domLoaded event is fired. If the dom:loaded event has already fired then the function will be executed immediately.

Cheers

Brad

Comments and changes to this ticket

  • bradrees
  • bradrees
  • bradrees

    bradrees December 7th, 2009 @ 04:21 PM

    Sorry about the updates - it seems that I can't upload files in Chrome :)

    0001 is the changes, and 0002 are the tests.

  • bradrees

    bradrees December 7th, 2009 @ 04:21 PM

    • Title changed from “Prototype does not load on the Playstion 3 browser (NetFront)” to “Prototype does not load on the Playstation 3 browser (NetFront)”
  • bradrees
  • Tobie Langel

    Tobie Langel December 7th, 2009 @ 07:02 PM

    • Tag cleared.
    • State changed from “new” to “wont_fix”

    Thanks for your ticket. We think this might be better implemented as a plugin rather than in the framework itself.

    Don't forget to register your plugin on Scripteka once it's completed so that the community can benefit from it.

  • Juriy Zaytsev

    Juriy Zaytsev December 7th, 2009 @ 07:42 PM

    • Assigned user set to “Juriy Zaytsev”
    • State changed from “wont_fix” to “enhancement”

    @bradrees

    Nice! Thanks for bringing this up. Few comments about this patch:

    1) It looks like most of the failures in NetFront are related to browser sniffing in prototype (no surprises there).
    2) Addition of sniff for Prototype.Browser.PS3 in getOffsetParent "wrapper" is not really the way to go. We need a proper feature test instead.
    3) Other failures seem to be related to the fact that we make unsafe assumptions about environment. E.g. that document.createEventObject exists if document.createEvent doesn't; or that document.createEvent exists if userAgent identifies itself as IE (ugh...).

    It's not very clear why there's a need for Event.domLoadedQueue. Does DOMContentLoaded not fire in NetFront (or fires at the wrong time)? What exactly is failing there?

    Also, have you tried running any of Prototype unit tests?

  • bradrees

    bradrees December 8th, 2009 @ 12:33 PM

    Hi Juriy,

    In response to 3) - Event.domLoadedQueue is there as the PS3 doesn't seem to support firing custom events - hence you can register for document.observe("dom:loaded") but it will never be fired. Also I must admit that I was trying to shoehorn in the feature of being able to register a handler for the dom:loaded event and if the DOM is already 'ready' then the handler will be run immediately. I think this is a very handy feature of other frameworks (jQuery, Glow etc).

    I actually hadn't run the full unit tests before submitting. Basically Prototype fails to load so I had assumed everything the depends on it fails too. I wrote a number of test cases while fixing it, however I haven't yet done a full pass using the test supplied with the project. Let me get back to you on that one.

  • bradrees

    bradrees December 8th, 2009 @ 02:00 PM

    Ok so here are the full results after patching on PS3 (note I had already tested FF3, Chrome and Opera - all fine):

    ajax: Mostly fails, passes for testUpdaterOptions, testOnCreateCallback, testCallbacks. A number reported that tests must be run from rake.

    array: 2 failures - testToArrayOnNodeList (Function not defined?), test$w (assertEnumEqual, expected <['a', 'b', 'c', 'd']>, actual <['a', 'b', 'c\t', 'd']>)

    base: pass (patched)

    class: 1 failure - testClassWithToStringAnValueOfMethods

    date: pass

    dom: lots of failures with Function is not defined. Other test fail due to issues with the layout engine of NetFront. Nothing surprising here.

    element mixins: 1 failure - Function is not defined

    enumerable: pass

    event: mostly failures with TypeError: Tried to use undefined as an object. Of note Event.domLoaded passes.

    form: mostly passes. failures for testFormActivating, testFormGetInputs, testFormFindFirstElement, testFormRequest.

    function: pass

    hash: pass

    number: pass

    object: pass

    periodical executer: pass

    position: pass (patched)

    range: pass

    regex: pass

    selector engine: pass

    string: PS3 stopped responding for a bit, then would not give me a result (no joke). My personal test cases passed however.

    unit test: pass (error about rake, but I'm assuming that is due to me hacking around with the test suite).

  • bradrees
  • bradrees

    bradrees December 8th, 2009 @ 02:17 PM

    • Assigned user set to “Juriy Zaytsev”

    Sorry, new to this interface!

  • Juriy Zaytsev

    Juriy Zaytsev December 18th, 2009 @ 06:24 PM

    @bradrees

    testClassWithToStringAnValueOfMethods should not be failing, since we use feature test now. Could you run test suite with the latest version (from the trunk)?

    I put one online — http://yura.thinkweb2.com/prototype/test/unit/tmp/

  • Tisho Georgiev

    Tisho Georgiev March 1st, 2010 @ 06:37 PM

    • Tag set to general
  • Diego Perini

    Diego Perini August 1st, 2010 @ 02:22 PM

    • Importance changed from “” to “”

    Some related info to PS3 I have gone through while testing my stuff on it.

    navigator.userAgent -> Mozilla/5.0 (PLAYSTATION 3; 1.00)
    

    Does implement Microsoft Event model (attachEvent/detachEvent) with following differences:

    document.createEventObject method is absent
    

    The IEContentLoaded solution, as implemented in Prototype, works correctly by using the "doScroll()" trick even on PS3.

    It seems the minimal functionality is granted, both NWMatcher and NWEvents works on it, even delegation work. WOW !

    I read Juriy saying it is a NetFront browser and read blog posts stating that too but I have no evidence this is a NetFront browser, the fact it works with the "doScroll()" trick let me believe this is just another IE engine with the same problems, reduced capabilities and maybe a small CSS2 lift.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

The Prototype JavaScript library.

Shared Ticket Bins

Tags

Pages