Title: [87635] trunk/Source/WebCore
Revision
87635
Author
[email protected]
Date
2011-05-29 01:30:35 -0700 (Sun, 29 May 2011)

Log Message

2011-05-29  Sheriff Bot  <[email protected]>

        Unreviewed, rolling out r87566.
        http://trac.webkit.org/changeset/87566
        https://bugs.webkit.org/show_bug.cgi?id=61702

        It made all tests assert on Qt in debug mode (Requested by
        Ossy_weekend on #webkit).

        * WebCore.exp.in:
        * bindings/ScriptControllerBase.cpp:
        (WebCore::ScriptController::executeIfJavaScriptURL):
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::suggestedMIMEType):
        (WebCore::Document::lastModified):
        (WebCore::Document::initSecurityContext):
        (WebCore::Document::updateURLForPushOrReplaceState):
        * dom/Document.h:
        (WebCore::Document::setDocumentLoader):
        (WebCore::Document::loader):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::replaceMediaElementTimerFired):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::createDocumentStructure):
        * platform/mac/HTMLConverter.mm:
        (fileWrapperForElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87634 => 87635)


--- trunk/Source/WebCore/ChangeLog	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/ChangeLog	2011-05-29 08:30:35 UTC (rev 87635)
@@ -1,3 +1,31 @@
+2011-05-29  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r87566.
+        http://trac.webkit.org/changeset/87566
+        https://bugs.webkit.org/show_bug.cgi?id=61702
+
+        It made all tests assert on Qt in debug mode (Requested by
+        Ossy_weekend on #webkit).
+
+        * WebCore.exp.in:
+        * bindings/ScriptControllerBase.cpp:
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::suggestedMIMEType):
+        (WebCore::Document::lastModified):
+        (WebCore::Document::initSecurityContext):
+        (WebCore::Document::updateURLForPushOrReplaceState):
+        * dom/Document.h:
+        (WebCore::Document::setDocumentLoader):
+        (WebCore::Document::loader):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::replaceMediaElementTimerFired):
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::createDocumentStructure):
+        * platform/mac/HTMLConverter.mm:
+        (fileWrapperForElement):
+
 2011-05-28  Steve Falkenburg  <[email protected]>
 
         Reviewed by Dan Bernstein.

Modified: trunk/Source/WebCore/WebCore.exp.in (87634 => 87635)


--- trunk/Source/WebCore/WebCore.exp.in	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-05-29 08:30:35 UTC (rev 87635)
@@ -1283,7 +1283,6 @@
 __ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
 __ZNK7WebCore8Document4bodyEv
 __ZNK7WebCore8Document6domainEv
-__ZNK7WebCore8Document6loaderEv
 __ZNK7WebCore8IntPointcv7CGPointEv
 __ZNK7WebCore8IntPointcv8_NSPointEv
 __ZNK7WebCore8Position10downstreamENS_27EditingBoundaryCrossingRuleE

Modified: trunk/Source/WebCore/bindings/ScriptControllerBase.cpp (87634 => 87635)


--- trunk/Source/WebCore/bindings/ScriptControllerBase.cpp	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/bindings/ScriptControllerBase.cpp	2011-05-29 08:30:35 UTC (rev 87635)
@@ -114,12 +114,9 @@
     // FIXME: We should always replace the document, but doing so
     //        synchronously can cause crashes:
     //        http://bugs.webkit.org/show_bug.cgi?id=16782
-    if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL) {
-        // We're still in a frame, so there should be a DocumentLoader.
-        ASSERT(m_frame->document()->loader());
-        if (DocumentLoader* loader = m_frame->document()->loader())
-            loader->writer()->replaceDocument(scriptResult);
-    }
+    if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL)
+        m_frame->document()->loader()->writer()->replaceDocument(scriptResult);
+
     return true;
 }
 

Modified: trunk/Source/WebCore/dom/Document.cpp (87634 => 87635)


--- trunk/Source/WebCore/dom/Document.cpp	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-05-29 08:30:35 UTC (rev 87635)
@@ -435,6 +435,7 @@
     m_ignoreAutofocus = false;
 
     m_frame = frame;
+    m_documentLoader = frame ? frame->loader()->activeDocumentLoader() : 0;
 
     // We depend on the url getting immediately set in subframes, but we
     // also depend on the url NOT getting immediately set in opened windows.
@@ -1105,9 +1106,7 @@
     if (m_document->isHTMLDocument())
         return "text/html";
 
-    if (DocumentLoader* documentLoader = loader())
-        return documentLoader->responseMIMEType();
-    return String();
+    return m_documentLoader->responseMIMEType();
 }
 
 // FIXME: We need to discuss the DOM API here at some point. Ideas:
@@ -3782,11 +3781,7 @@
     DateComponents date;
     bool foundDate = false;
     if (m_frame) {
-        // Since we're still in a Frame, we should have a DocumentLoader.
-        ASSERT(loader());
-        String httpLastModified;
-        if (loader()) 
-            httpLastModified = loader()->response().httpHeaderField("Last-Modified");
+        String httpLastModified = m_documentLoader->response().httpHeaderField("Last-Modified");
         if (!httpLastModified.isEmpty()) {
             date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
             foundDate = true;
@@ -4515,11 +4510,7 @@
         // load local resources.  See https://bugs.webkit.org/show_bug.cgi?id=16756
         // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further
         // discussion.
-        
-        DocumentLoader* documentLoader = loader();
-        // Since we're still in a Frame, we should have a DocumentLoader.
-        ASSERT(documentLoader);
-        if (documentLoader && documentLoader->substituteData().isValid())
+        if (m_documentLoader->substituteData().isValid())
             securityOrigin()->grantLoadLocalResources();
     }
 
@@ -4600,10 +4591,7 @@
 
     setURL(url);
     f->loader()->setOutgoingReferrer(url);
-    // Since we're still in a frame, we should have a DocumentLoader.
-    ASSERT(loader());
-    if (DocumentLoader* documentLoader = loader())
-        documentLoader->replaceRequestURLForSameDocumentNavigation(url);
+    m_documentLoader->replaceRequestURLForSameDocumentNavigation(url);
 }
 
 void Document::statePopped(SerializedScriptValue* stateObject)
@@ -5154,19 +5142,4 @@
         mainFrame->notifyChromeClientWheelEventHandlerCountChanged();
 }
 
-DocumentLoader* Document::loader() const
-{
-    if (!m_frame)
-        return 0;
-    
-    DocumentLoader* loader = m_frame->loader()->activeDocumentLoader();
-    if (!loader)
-        return 0;
-    
-    if (m_frame->document() != this)
-        return 0;
-    
-    return loader;
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/Document.h (87634 => 87635)


--- trunk/Source/WebCore/dom/Document.h	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/dom/Document.h	2011-05-29 08:30:35 UTC (rev 87635)
@@ -569,7 +569,8 @@
     void setVisuallyOrdered();
     bool visuallyOrdered() const { return m_visuallyOrdered; }
     
-    DocumentLoader* loader() const;
+    void setDocumentLoader(DocumentLoader* documentLoader) { m_documentLoader = documentLoader; }
+    DocumentLoader* loader() const { return m_documentLoader; }
 
     void open(Document* ownerDocument = 0);
     void implicitOpen();
@@ -1173,6 +1174,7 @@
     mutable RefPtr<CSSPrimitiveValueCache> m_cssPrimitiveValueCache;
 
     Frame* m_frame;
+    DocumentLoader* m_documentLoader;
     OwnPtr<CachedResourceLoader> m_cachedResourceLoader;
     RefPtr<DocumentParser> m_parser;
     bool m_wellFormed;

Modified: trunk/Source/WebCore/html/MediaDocument.cpp (87634 => 87635)


--- trunk/Source/WebCore/html/MediaDocument.cpp	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/html/MediaDocument.cpp	2011-05-29 08:30:35 UTC (rev 87635)
@@ -221,12 +221,8 @@
         embedElement->setAttribute(heightAttr, "100%");
         embedElement->setAttribute(nameAttr, "plugin");
         embedElement->setAttribute(srcAttr, url().string());
+        embedElement->setAttribute(typeAttr, loader()->writer()->mimeType());
 
-        DocumentLoader* documentLoader = loader();
-        ASSERT(documentLoader);
-        if (documentLoader)
-            embedElement->setAttribute(typeAttr, documentLoader->writer()->mimeType());
-
         ExceptionCode ec;
         videoElement->parentNode()->replaceChild(embedElement, videoElement, ec);
     }

Modified: trunk/Source/WebCore/html/PluginDocument.cpp (87634 => 87635)


--- trunk/Source/WebCore/html/PluginDocument.cpp	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/html/PluginDocument.cpp	2011-05-29 08:30:35 UTC (rev 87635)
@@ -92,11 +92,7 @@
     
     m_embedElement->setAttribute(nameAttr, "plugin");
     m_embedElement->setAttribute(srcAttr, document()->url().string());
-    
-    DocumentLoader* loader = document()->loader();
-    ASSERT(loader);
-    if (loader)
-        m_embedElement->setAttribute(typeAttr, loader->writer()->mimeType());
+    m_embedElement->setAttribute(typeAttr, document()->loader()->writer()->mimeType());
 
     static_cast<PluginDocument*>(document())->setPluginNode(m_embedElement);
 

Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (87634 => 87635)


--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm	2011-05-29 07:04:13 UTC (rev 87634)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm	2011-05-29 08:30:35 UTC (rev 87635)
@@ -1753,8 +1753,7 @@
     const AtomicString& attr = element->getAttribute(srcAttr);
     if (!attr.isEmpty()) {
         NSURL *URL = ""
-        if (DocumentLoader* loader = element->document()->loader())
-            wrapper = fileWrapperForURL(loader, URL);
+        wrapper = fileWrapperForURL(element->document()->loader(), URL);
     }
     if (!wrapper) {
         RenderImage* renderer = toRenderImage(element->renderer());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to