<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Tests/UserTests/Element/Element.iframe.html</filename>
    </added>
    <added>
      <filename>Tests/UserTests/Element/Element.iframe.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1709,7 +1709,7 @@ Creates an IFrame HTML Element and extends its window and document with MooTools
 
 ### Notes:
 
-- If the IFrame is from the same domain as the &quot;host&quot;, its document and window will be extended with MooTools functionalities, allowing you to fully use MooTools within it.
+- If the IFrame is from the same domain as the &quot;host&quot; or running locally, its document and window will be extended with MooTools functionalities, allowing you to fully use MooTools within it.
 - If the IFrame already exists and has a different name than id, the name will be made the same as the id.
 - If the IFrame is from a different domain, its window and document will not be extended with MooTools methods.
 </diff>
      <filename>Docs/Element/Element.md</filename>
    </modified>
    <modified>
      <diff>@@ -47,25 +47,26 @@ var IFrame = new Native({
 	generics: false,
 
 	initialize: function(){
-		var params = Array.link(arguments, {properties: Object.type, iframe: $defined});
+		var params = Array.link(arguments, { properties: Object.type, iframe: $defined });
 		var props = params.properties || {};
-		var iframe = document.id(params.iframe) || false;
+		var iframe = document.id(params.iframe);
 		var onload = props.onload || $empty;
 		delete props.onload;
-		props.id = props.name = $pick(props.id, props.name, iframe.id, iframe.name, 'IFrame_' + $time());
+		props.id = props.name = $pick(props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + $time());
 		iframe = new Element(iframe || 'iframe', props);
 		var onFrameLoad = function(){
 			var host = $try(function(){
 				return iframe.contentWindow.location.host;
 			});
-			if (host &amp;&amp; host == window.location.host){
+			if (!host || host == window.location.host){
 				var win = new Window(iframe.contentWindow);
 				new Document(iframe.contentWindow.document);
 				$extend(win.Element.prototype, Element.Prototype);
 			}
 			onload.call(iframe.contentWindow, iframe.contentWindow.document);
 		};
-		(window.frames[props.id]) ? onFrameLoad() : iframe.addListener('load', onFrameLoad);
+		var contentWindow = $try(function(){ return iframe.contentWindow; });
+		((contentWindow &amp;&amp; contentWindow.document.body) || window.frames[props.id]) ? onFrameLoad() : iframe.addListener('load', onFrameLoad);
 		return iframe;
 	}
 </diff>
      <filename>Source/Element/Element.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 {
 	&quot;Element&quot;: {
+		&quot;Element&quot;:['iframe'],
 		&quot;Element.Dimensions&quot;:['offsets', 'scrollSize']
 	},
 	&quot;Request&quot;: {</diff>
      <filename>Tests/UserTests/tests.json</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>01b3b0d280697e52cbb4591bcd697c3e24655e8e</id>
    </parent>
  </parents>
  <author>
    <name>Valerio Proietti</name>
    <email>kamicane@gmail.com</email>
  </author>
  <url>http://github.com/mootools/mootools-core/commit/307b34781672ffc410cb548b6bfc8f1f0a7da056</url>
  <id>307b34781672ffc410cb548b6bfc8f1f0a7da056</id>
  <committed-date>2009-06-18T13:01:44-07:00</committed-date>
  <authored-date>2009-06-18T13:01:44-07:00</authored-date>
  <message> - cherry-picked from calyptus branch:
 - Bug fixes IFrame load (tickets #573, #296)
 - New IFrames doesn't require an ID.
 - Extends local iframes Window and Document.
 - Fixes load event on already loaded iframes in Firefox 3.
 - The props.onload property is still undocumented and still differs from props.events.load (ticket #68). Needs discussion.

Conflicts:

	Source/Element/Element.js</message>
  <tree>8ba7e0ce47a42a279893c524fb27568b14d56a85</tree>
  <committer>
    <name>Valerio Proietti</name>
    <email>kamicane@gmail.com</email>
  </committer>
</commit>
