Last modified: 2006-08-13 22:16:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8989, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6989 - sajax onload fails on IFRAME
sajax onload fails on IFRAME
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.8.x
PC Windows 2000
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-12 06:26 UTC by Carl Duisberg
Modified: 2006-08-13 22:16 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Broken output due to described bug (40.24 KB, image/png)
2006-08-13 21:00 UTC, Carl Duisberg
Details

Description Carl Duisberg 2006-08-12 06:26:38 UTC
When the wiki page contains an IFRAME the body.onload event will be triggered
twice once for the main frame, once for the iframe. When the IFRAME loads first
this will cause sjax_onload to mess up the whole page.

To reproduce put the following into localSettings.php:

$wgSiteNotice = '<IFRAME src="/" />';
Comment 1 Brion Vibber 2006-08-13 17:29:32 UTC
What's a sajax onload and what does it have to do with MediaWiki?
Comment 2 Carl Duisberg 2006-08-13 20:00:16 UTC
(In reply to comment #1)
> What's a sajax onload and what does it have to do with MediaWiki?
Function sajax_onload() is defined in /skins/common/ajax.js
Comment 3 Brion Vibber 2006-08-13 20:02:09 UTC
When would you ever have an iframe and how does it interact?

I'm really pretty lost here, there's no examples given and it 
doesn't appear to be related to anything that actually ever 
happens.
Comment 4 Carl Duisberg 2006-08-13 20:32:25 UTC
(In reply to comment #3)
> When would you ever have an iframe and how does it interact?
The example to reproduce the error is given above:
Put 
$wgSiteNotice = '<IFRAME src="/" />'; 
into localSettings.php.

Why have I been investigating IFRAMEs?

Wikis typically show only content hosted inside the Wiki. Showing content
generated on software outside the Wiki could have amongst others the following
applications:

* Inline rendering of live demos inside a page discussing programming technologies.
* Inclusion of existing software for making the wiki more interactive. The
requirement put forward in
http://meta.wikimedia.org/w/index.php?title=Extension_Requests&oldid=407347#Ajax_Vote
could be solved this way.

IFRAMEs are ONE possibility of making content not orginating inside the wiki
visible on a wiki page. The major advantage over other technologies like
creating extra DIVs is that the content in an IFRAME is almost independent of
the parent page.


Comment 5 Brion Vibber 2006-08-13 20:46:57 UTC
I'm going to INVALID this since there's no explanation of what's 
wrong, what's not working, what's contained in the iframe, etc.
Comment 6 Carl Duisberg 2006-08-13 21:00:58 UTC
Created attachment 2221 [details]
Broken output  due to described bug

The screenshot shows the output of the wiki if 
$wgSiteNotice = '<IFRAME src="" />'
Comment 7 Carl Duisberg 2006-08-13 21:10:18 UTC
Above screenshots shows the output for an empty IFRAME inserted into the
sitemessage DIV.

If $wgSiteNotice = '<IFRAME src="" />'; is removed form localsettings a normal
wiki page is shown.

The test environment was as follows:
* Windows 2000 prof
* MediaWiki 1.8 alpha rev. 15483
* Apache 2.0.49
* PHP Version 5.1.1
* MySQL - 5.0.23-community-nt
Comment 8 Daniel Kinzler 2006-08-13 21:36:18 UTC
To clarify: are you trying to use the AjaxSearch feature? Are you trying to show
a page generated by MediaWiki in the iframe? The same wiki, or another? And what
browser are you using (this is a javacsript issue, ergo client side).

If a wiki page is loaded in an iframe, the onload hooks are executed, which is
intended behaviour. I don't know though how iframes interact with javascript/dom
in different browsers, but i would have thought that the "inner" js code
wouldn't "leak" into the souronding page... I'd consider that a browser bug,
unless sajax is doing something very strange with teh DOM.

Can you provide a URL for seeing this bug live?

Thinking about it - wikibits.js uses window.addEventListener to register to
hook. Is this maybe (in some browsers) triggered also when iframes in the window
are loaded, as opposed to document.onload?
Comment 9 Carl Duisberg 2006-08-13 22:16:00 UTC
It seems to boil down to spurious treatment of the <iframe> tag in browsers:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr">
<head></head>
<body>
<iframe src=""></iframe>
<h1 class="firstHeading">This is rendered</h1>
</body></html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr">
<head></head>
<body>
<iframe src="" />
<h1 class="firstHeading">This is not rendered</h1>
</body></html>

In the context of XML it seems strange that the first example renders the <H1>
heading, the second does not. (Tested both in IExplore 6.0 and Mozilla 1.7.11)

But this is browser issue not a mediaWiki problem.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links