Created
          January 31, 2010 23:42 
        
      - 
      
- 
        Save boucher/291319 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | diff --git a/AppKit/Platform/DOM/CPPlatformString.j b/AppKit/Platform/DOM/CPPlatformString.j | |
| index 371e41a..bc6cf90 100644 | |
| --- a/AppKit/Platform/DOM/CPPlatformString.j | |
| +++ b/AppKit/Platform/DOM/CPPlatformString.j | |
| @@ -52,23 +52,23 @@ var DOMSpanElement = nil, | |
| if (DOMIFrameElement) | |
| return; | |
| - DOMIFrameElement = document.createElement("iframe"); | |
| + var iframe = document.createElement("iframe"); | |
| // necessary for Safari caching bug: | |
| - DOMIFrameElement.name = "iframe_" + FLOOR(RAND() * 10000); | |
| - DOMIFrameElement.style.position = "absolute"; | |
| - DOMIFrameElement.style.left = "-100px"; | |
| - DOMIFrameElement.style.top = "-100px"; | |
| - DOMIFrameElement.style.width = "1px"; | |
| - DOMIFrameElement.style.height = "1px"; | |
| - DOMIFrameElement.style.borderWidth = "0px"; | |
| - DOMIFrameElement.style.overflow = "hidden"; | |
| - DOMIFrameElement.style.zIndex = 100000000000; | |
| + iframe.name = "iframe_" + FLOOR(RAND() * 10000); | |
| + iframe.style.position = "absolute"; | |
| + iframe.style.left = "-100px"; | |
| + iframe.style.top = "-100px"; | |
| + iframe.style.width = "1px"; | |
| + iframe.style.height = "1px"; | |
| + iframe.style.borderWidth = "0px"; | |
| + iframe.style.overflow = "hidden"; | |
| + iframe.style.zIndex = 100000000000; | |
| var bodyElement = [CPPlatform mainBodyElement]; | |
| - bodyElement.appendChild(DOMIFrameElement); | |
| + bodyElement.appendChild(iframe); | |
| - var DOMIFrameDocument = (DOMIFrameElement.contentDocument || DOMIFrameElement.contentWindow.document); | |
| + var DOMIFrameDocument = (iframe.contentDocument || iframe.contentWindow.document); | |
| DOMIFrameDocument.write("<html><head></head><body></body></html>"); | |
| DOMIFrameDocument.close(); | |
| @@ -87,6 +87,8 @@ var DOMSpanElement = nil, | |
| DOMSpanElement.style.margin = "0px"; | |
| DOMDivElement.appendChild(DOMSpanElement); | |
| + | |
| + DOMIFrameElement = iframe; | |
| } | |
| + (void)removeDOMElements | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment