Bug 6926 - iframe.contentDocument returns 'undefined' when hidden by style 'display: none' (Bugzilla "Edit Attachment As Comment" feature does not work)
Summary: iframe.contentDocument returns 'undefined' when hidden by style 'display: non...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 417.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-01-29 21:25 PST by David Kilzer (:ddkilzer)
Modified: 2016-09-26 09:28 PDT (History)
3 users (show)

See Also:


Attachments
Test case (745 bytes, text/html)
2006-02-04 21:08 PST, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2006-01-29 21:25:30 PST
Steps to reproduce:

1. Open Bug 6900.
2. Click on "Edit" link next to patch attachment.
3. Click on "Edit Attachment As Comment".

Expected:

The "Comment (on the bug)" textarea is hidden and the diff in the window is replaced by the same diff with quote (">") characters on the first line.  (See behavior in Firefox 1.5.)

Actual:

A JavaScript error occurs (see JavaScript Console):

Undefined value
http://bugzilla.opendarwin.org/attachment.cgi?id=6062&action=edit
Line: 235
Comment 1 David Kilzer (:ddkilzer) 2006-01-29 21:30:04 PST
Note that other types of attachments (such as text/html) behave differently, although they still don't work as expected, either.  See Bug 6916 for a text/html attachment.
Comment 2 David Kilzer (:ddkilzer) 2006-02-04 21:08:47 PST
Created attachment 6256 [details]
Test case

An <iframe></iframe> element that is hidden with style "display: none;" still has content, but iframeElement.contentDocument returns an undefined value when the iframe is hidden.
Comment 3 David Kilzer (:ddkilzer) 2006-02-04 21:13:28 PST
Updating Summary to match the issue.  Changed NeedsReduction keyword to HasReduction.

Same bug occurs in Safari 2.0.3 (417.8) on 10.4.4, so it's not a regression.

Test case works in Firefox 1.5.0.1.  MSIE 6 does not have an XMLSerializer object, so this feature of Bugzilla is not even enabled in it.
Comment 4 Alexey Proskuryakov 2006-02-05 00:06:08 PST
Sounds closely related to bug 3581. I'm re-adding the original summary, to make this issue easier to find.
Comment 5 David Kilzer (:ddkilzer) 2006-06-11 05:12:30 PDT
(In reply to comment #0)
> Steps to reproduce:
> 
> 1. Open Bug 6900.
> 2. Click on "Edit" link next to patch attachment.
> 3. Click on "Edit Attachment As Comment".

The current version of Bugzilla on http://bugzilla.opendarwin.org/ seems to have worked around this Safari issue.  However, the test case (Attachment 6256 [details]) still does not work in WebKit r14810 today.
Comment 6 David Kilzer (:ddkilzer) 2006-12-24 17:55:22 PST
This was fixed a while ago.  Not sure what fixed it, though.

Comment 7 Alexey Proskuryakov 2006-12-24 21:32:25 PST
Probably, bug 3581.