#717 bug
Paul Sowden

Accessing a DOM node from a parent window in a child iframe moves the prototype to the child iframe and resets it in the parent window

Reported by Paul Sowden | June 19th, 2009 @ 12:28 AM

I just reported this bug against Webkit but it also affects Prototype (see https://bugs.webkit.org/show_bug.cgi?id=26520)

If an element is accessed in a child iframe in Webkit it causes the native DOM prototypes to get moved over to the child iframe and if an element is later accessed in the parent iframe then it doesn't inherit the properties from the prototype that Prototype assumes that it does.

As an example, the following page:

<script type="text/javascript" src="/prototype-"></script>

<iframe src="test-prototype-iframe.html"></iframe>
<form onsubmit="try{Form.serialize(this);}catch(e){alert(e);}finally{return false}"><input nama="fda"><input type="submit" name="fdsa"></form>

with the iframe html (test-prototype-iframe.html):

<script type="text/javascript">

window.onload = function (e) {
    top.document.body.addEventListener('mousedown', function (e) {
        var target = e.target;
    }, true);


Will cause an error to be thrown trying to use getValue on a HTMLInputElement (in Webkit) because the original HTMLInputElement's prototype has been moved to the child iframe and a new blank one now exists in the parent.

Comments and changes to this ticket

  • T.J. Crowder

    T.J. Crowder November 16th, 2009 @ 04:50 PM

    [responsible:none bulk edit command]

  • Tisho Georgiev

    Tisho Georgiev March 1st, 2010 @ 01:10 PM

    • State changed from “new” to “bug”
    • Tag set to needs:patch, section:lang

    This has been fixed in the latest WebKit Nightly and Chrome, but is still present in Safari 4.

  • Paul Sowden

    Paul Sowden March 1st, 2010 @ 09:45 PM

    Just to note, I don't think this was ever an issue in Chrome, it was an issue with the JavaScriptCore engine and Chrome uses V8.

  • Jenelle Stevenson

    Jenelle Stevenson June 22nd, 2018 @ 02:10 PM

    Solid streamz app is a live Solid Streamz TV streaming app that wouldn’t let you miss your favourite shows even while you’re on the go.

  • DaveMyers

    DaveMyers July 10th, 2018 @ 02:43 PM

    Javascript is best programming technique which helps me a lot during coding and I have shared multiple article on node js and angular js on different expansion joint covers sites. You guys can read online. Thank you.

  • ToddElliott

    ToddElliott July 13th, 2018 @ 12:42 PM

    Good job on providing a complete analysis and understanding of the problem, will definitely look into it myself as well. Hope you won't mind me referncing your site in an essay I'm writing at essay editing uk. Keep it up.

  • infi loop

    infi loop July 16th, 2018 @ 01:44 AM

    State changed from “new” to “bug”
    Tag set to “needs:patch, section:lang”
    This has been fixed in the latest WebKit Nightly and Chrome, but is still present in Safari 4.
    More is written on this topic over on this app Solid Streamz

  • Angelinayer

    Angelinayer September 26th, 2018 @ 09:47 AM

    Come here pages Come here Come here Come here Come here

  • 3vikram

    3vikram October 29th, 2018 @ 03:20 PM

    I was also facing a similar kind of issues and yes, it's not a big thing to resolve, it's as easy as you write a small and simple peace of code; “needs:patch, section:lang” use that as the state was changed from new to bug, we can go with the webkit nightly and chrome to do it, if you are a mac, go with safari or update the firefox to get it worked, we have also tested the same with Crowns Lite and now it's working pretty fine.

  • lee mu
  • dreman

    dreman October 31st, 2018 @ 03:58 PM

    Great stuff man.
    We are pleased to announce that https://oneboxhdappapk.com/mediabox-hd-apk/ is the best app to watch movies after it's the recent update from the movie DB app to mediabox HD app. Developers fixed all possible errors from their end.


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