Closed
Bug 224952
Opened 21 years ago
Closed 21 years ago
javascript: iframe_element.src = href remain NULL
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: gary, Assigned: jst)
References
()
Details
Attachments
(1 file)
1.05 KB,
patch
|
caillon
:
review+
bzbarsky
:
superreview+
dbaron
:
approval1.6b+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.21 [en] Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Firebird/0.7 An iframe element's SRC cannot be set through javascript. Reproducible: Always Steps to Reproduce: 1. Click on a row in the files table 2. Servers page slide out Actual Results: Empty iframe, which is set to a URL. Expected Results: http://isohunt.com/servers.php should be loaded inside iframe, instead of iframe_element.src remaining NULL. The javascript triggered onClick below: function servOC(i, href, nColor) { var trObj = (document.getElementById) ? document.getElementById('ihtr' + i) : eval("document.all['ihtr" + i + "']"); var nameObj = (document.getElementById) ? document.getElementById('name' + i) : eval("document.all['name" + i + "']"); var ifObj = (document.getElementById) ? document.getElementById('ihif' + i) : eval("document.all['ihif" + i + "']"); if (trObj != null) { if (trObj.style.display=="none") { trObj.style.display=""; nameObj.style.background="#ECECD9"; if (ifObj.src == "") ifObj.src = href; smoothHeight('ihif' + i, 0, 210, 42, 'o'); } else { nameObj.style.background=nColor; smoothHeight('ihif' + i, 210, 0, 42, 'ihtr' + i); } } } Someone reported this problem exists for Mozilla 1.5 as well, so it's likely a new bug introduced to the DOM model recently. I've tested the javascript in earlier versions of both Mozilla and Firebird and this problem did not happen before.
Comment 1•21 years ago
|
||
> if (ifObj.src == "") ifObj.src = href; That test fails. When the src attribute us not set, we return null for the src property and |null == ""| is false). Just testing (!ifObj.src) should work for you, I think. caillon, we return null because of your review comments in bug 212277... I suspect we may want to revert it to returning empty string if it breaks too many things. jst, thoughts?
Comment 2•21 years ago
|
||
.
Assignee: events → general
Component: DOM Events → DOM Core
OS: Windows XP → All
Hardware: PC → All
Interesting, it works. ^.^ But please do keep some level of backward compatibility, as all browsers, including Mozilla previously, did not return false on assessing (ifObj.src == "").
Comment 4•21 years ago
|
||
we want to make a call one way or the other here by 1.6, in my opinion.... Assigning to jst to get an executive decision handed down, hopefully...
Assignee: general → jst
Assignee | ||
Comment 5•21 years ago
|
||
For compatibility's sake, revert back to returning "" for no URI attribute.
Assignee | ||
Updated•21 years ago
|
Attachment #136018 -
Flags: superreview?(bz-vacation)
Attachment #136018 -
Flags: review?(caillon)
Updated•21 years ago
|
Attachment #136018 -
Flags: review?(caillon) → review+
Comment 6•21 years ago
|
||
Comment on attachment 136018 [details] [diff] [review] Make iframe.src default to "" sr=bzbarsky Could this please be approved for 1.6b? We don't really want to break this.
Attachment #136018 -
Flags: superreview?(bz-vacation)
Attachment #136018 -
Flags: superreview+
Attachment #136018 -
Flags: approval1.6b?
Attachment #136018 -
Flags: approval1.6b? → approval1.6b+
Assignee | ||
Comment 7•21 years ago
|
||
Fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•