#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.7

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

    • Title changed from “Bogus assumption in WebKit version of Element.Methods.setOpacity” to “WebKit branch of Element#setOpacity should use element.ownerDocument”
    • State changed from “new” to “bug”
    • Tag changed from dom, safari to dom, patched, safari
    • Milestone set to 1.7
    • Assigned user set 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

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

    Tobie Langel July 24th, 2009 @ 02:10 AM

    • Tag changed from dom to section:dom

    [not-tagged:"dom" tagged:"section:dom" bulk edit command]

  • T.J. Crowder

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

    • Assigned user cleared.

    [responsible:none bulk edit command]

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

Attachments

Pages