#202 enhancement
Eric Naeseth

Use "element.ownerDocument" wherever possible instead of assuming "document"

Reported by Eric Naeseth | July 2nd, 2008 @ 11:20 PM | in 1.6.1

In the WebKit workaround version of Element.Methods.setOpacity, there is code which tries adding a text node to the element whose opacity is being set, and then immediately removing it.

The text node is created on whatever document is currently in context. If this is not the same document on which the element exists, the node will fail to be added.

This code is wrapped in a try/catch block which will ignore the exception that this will generate, but it still seems like sub-optimal behavior.

Comments and changes to this ticket

  • John-David Dalton

    John-David Dalton July 3rd, 2008 @ 12:15 AM

    • → Tag changed from “dom safari” to “dom patched safari”
    • → Milestone changed from “” to “1.6.1”
    • → State changed from “new” to “bug”
    • → Title changed from “Bogus assumption in WebKit version of Element.Methods.setOpacity” to “WebKit branch of Element#setOpacity should use element.ownerDocument”
    • → Assigned user changed from “” to “Tobie Langel”

    Is your issue also with the try catch?

    I have mentioned using ownerDocument more to work with iframes and other elements.

  • John-David Dalton

    John-David Dalton July 3rd, 2008 @ 12:15 AM

    • → State changed from “bug” to “enhancement”
  • Eric Naeseth

    Eric Naeseth July 3rd, 2008 @ 12:31 AM

    I don't know why the try/catch is there, actually. I just wanted to point out that if someone did run into this issue, they wouldn't see any exception letting them know.

  • Eric Naeseth

    Eric Naeseth July 3rd, 2008 @ 01:36 AM

    Actually, I've found another one of these in Element#getStyle.

    Should I create a ticket for that, too, or is it no big deal?

  • Andrew Dupont

    Andrew Dupont July 3rd, 2008 @ 05:36 PM

    • → Tag changed from “dom patched safari” to “dom”
    • → Title changed from “WebKit branch of Element#setOpacity should use element.ownerDocument” to “Use "element.ownerDocument" wherever possible instead of assuming "document"”

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

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

People watching this ticket

Attachments

Tags