[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:13:54 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c35436ce1028b26c8b5184c5e3ff97a667245007
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 19 20:36:13 2003 +0000

    	Fix for 3488888, about:blank in iframes doesn't repaint properly.  Fix for 3485478, refreshing a remote
    	page often causes a white flash.  Fix for 3488827, XML/XHTML documents don't fire load events on bodies/framesets.
    
            Reviewed by darin
    
            * khtml/html/html_documentimpl.cpp:
            (HTMLDocumentImpl::HTMLDocumentImpl):
            * khtml/html/html_documentimpl.h:
            * khtml/rendering/render_canvas.cpp:
            (RenderCanvas::RenderCanvas):
            (RenderCanvas::layout):
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::DocumentImpl):
            (DocumentImpl::body):
            (DocumentImpl::close):
            * khtml/xml/dom_docimpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5587 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 35870d3..3acfe79 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-11-19  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3488888, about:blank in iframes doesn't repaint properly.  Fix for 3485478, refreshing a remote
+	page often causes a white flash.  Fix for 3488827, XML/XHTML documents don't fire load events on bodies/framesets.
+	
+        Reviewed by darin
+	
+        * khtml/html/html_documentimpl.cpp:
+        (HTMLDocumentImpl::HTMLDocumentImpl):
+        * khtml/html/html_documentimpl.h:
+        * khtml/rendering/render_canvas.cpp:
+        (RenderCanvas::RenderCanvas):
+        (RenderCanvas::layout):
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::DocumentImpl):
+        (DocumentImpl::body):
+        (DocumentImpl::close):
+        * khtml/xml/dom_docimpl.h:
+
 2003-11-18  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index 94a5497..5e74191 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -122,9 +122,6 @@ HTMLDocumentImpl::HTMLDocumentImpl(DOMImplementationImpl *_implementation, KHTML
 */
     connect( KHTMLFactory::vLinks(), SIGNAL( cleared()),
              SLOT( slotHistoryChanged() ));
-    m_startTime.restart();
-
-    processingLoadEvent = false;
 }
 
 HTMLDocumentImpl::~HTMLDocumentImpl()
@@ -220,26 +217,6 @@ void HTMLDocumentImpl::setCookie( const DOMString & value )
 #endif
 }
 
-
-
-HTMLElementImpl *HTMLDocumentImpl::body()
-{
-    NodeImpl *de = documentElement();
-    if (!de)
-        return 0;
-
-    // try to prefer a FRAMESET element over BODY
-    NodeImpl* body = 0;
-    for (NodeImpl* i = de->firstChild(); i; i = i->nextSibling()) {
-        if (i->id() == ID_FRAMESET)
-            return static_cast<HTMLElementImpl*>(i);
-
-        if (i->id() == ID_BODY)
-            body = i;
-    }
-    return static_cast<HTMLElementImpl *>(body);
-}
-
 void HTMLDocumentImpl::setBody(HTMLElementImpl *_body, int &exceptioncode)
 {
     HTMLElementImpl *b = body();
@@ -330,57 +307,6 @@ HTMLMapElementImpl* HTMLDocumentImpl::getMap(const DOMString& _url)
         return 0;
 }
 
-void HTMLDocumentImpl::close()
-{
-    // First fire the onload.
-    bool doload = !parsing() && m_tokenizer && !processingLoadEvent;
-    
-    bool wasNotRedirecting = !view() || view()->part()->d->m_scheduledRedirection == noRedirectionScheduled || view()->part()->d->m_scheduledRedirection == historyNavigationScheduled;
-
-    processingLoadEvent = true;
-    if (body() && doload) {
-	// We have to clear the tokenizer, in case someone document.write()s from the
-	// onLoad event handler, as in Radar 3206524
-	delete m_tokenizer;
-	m_tokenizer = 0;
-        dispatchImageLoadEventsNow();
-        body()->dispatchWindowEvent(EventImpl::LOAD_EVENT, false, false);
-    }
-    processingLoadEvent = false;
-        
-    // Make sure both the initial layout and reflow happen after the onload
-    // fires. This will improve onload scores, and other browsers do it.
-    // If they wanna cheat, we can too. -dwh
-    
-    bool isRedirectingSoon = view() && view()->part()->d->m_scheduledRedirection != noRedirectionScheduled && view()->part()->d->m_scheduledRedirection != historyNavigationScheduled && view()->part()->d->m_delayRedirect == 0;
-
-    if (doload && wasNotRedirecting && isRedirectingSoon && m_startTime.elapsed() < 1000) {
-        static int redirectCount = 0;
-        if (redirectCount++ % 4) {
-            // When redirecting over and over (e.g., i-bench), to avoid the appearance of complete inactivity,
-            // paint every fourth page.
-            // Just bail out. During the onload we were shifted to another page.
-            // i-Bench does this. When this happens don't bother painting or laying out.        
-            delete m_tokenizer;
-            m_tokenizer = 0;
-            view()->unscheduleRelayout();
-            return;
-        }
-    }
-                
-    // The initial layout happens here.
-    DocumentImpl::closeInternal(!doload);
-
-    // Now do our painting
-    if (body() && doload) {
-        updateRendering();
-        
-        // Always do a layout after loading if needed.
-        if (renderer() && renderer()->needsLayout())
-            view()->layout();
-    }
-}
-
 void HTMLDocumentImpl::addNamedImageOrForm(const QString &name)
 {
     if (name.length() == 0) {
diff --git a/WebCore/khtml/html/html_documentimpl.h b/WebCore/khtml/html/html_documentimpl.h
index b21b6ba..cf696d1 100644
--- a/WebCore/khtml/html/html_documentimpl.h
+++ b/WebCore/khtml/html/html_documentimpl.h
@@ -29,7 +29,6 @@
 #include "misc/loader_client.h"
 
 #include <qmap.h>
-#include <qdatetime.h>
 
 class KHTMLView;
 class QString;
@@ -68,7 +67,6 @@ public:
     DOMString designMode() const;
     void setDesignMode(const DOMString &);
 
-    HTMLElementImpl *body();
     void setBody(HTMLElementImpl *_body, int& exceptioncode);
 
     virtual Tokenizer *createTokenizer();
@@ -80,7 +78,6 @@ public:
     HTMLMapElementImpl* getMap(const DOMString& url_);
 
     virtual void determineParseMode( const QString &str );
-    virtual void close();
 
     void addNamedImageOrForm(const QString &name);
     void removeNamedImageOrForm(const QString &name);
@@ -99,12 +96,10 @@ protected slots:
      */
     void slotHistoryChanged();
 private:
-    QTime m_startTime;
-    // we actually store ints inside the pointer value itself; would use void *
+     // we actually store ints inside the pointer value itself; would use void *
     // but that makes the template unhappy.
     QDict<char> namedImageAndFormCounts;
-    bool processingLoadEvent;
-
+    
 #if APPLE_CHANGES
     DOMString m_policyBaseURL;
 #endif
diff --git a/WebCore/khtml/rendering/render_canvas.cpp b/WebCore/khtml/rendering/render_canvas.cpp
index 4b3aafd..6a99f81 100644
--- a/WebCore/khtml/rendering/render_canvas.cpp
+++ b/WebCore/khtml/rendering/render_canvas.cpp
@@ -68,8 +68,6 @@ RenderCanvas::RenderCanvas(DOM::NodeImpl* node, KHTMLView *view)
 
     // Create a new root layer for our layer hierarchy.
     m_layer = new (node->getDocument()->renderArena()) RenderLayer(this);
-    
-    m_view->scheduleRelayout();
 }
 
 RenderCanvas::~RenderCanvas()
@@ -178,8 +176,8 @@ void RenderCanvas::layout()
     kdDebug() << "RenderCanvas::end time used=" << qt.elapsed() << endl;
 #endif
 
-    layer()->setHeight(QMAX(doch, m_height));
-    layer()->setWidth(QMAX(docw, m_width));
+    layer()->setHeight(kMax(doch, m_height));
+    layer()->setWidth(kMax((short)docw, m_width));
     
     setNeedsLayout(false);
 }
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 6ce0082..d80e574 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -314,6 +314,9 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
 
     m_cssTarget = 0;
     m_accessKeyDictValid = false;
+    
+    m_processingLoadEvent = false;
+    m_startTime.restart();
 }
 
 DocumentImpl::~DocumentImpl()
@@ -1194,9 +1197,75 @@ void DocumentImpl::open(  )
         m_view->part()->jScript()->setSourceFile(m_url,"");
 }
 
-void DocumentImpl::close(  )
+HTMLElementImpl* DocumentImpl::body()
 {
-    closeInternal(true);
+    NodeImpl *de = documentElement();
+    if (!de)
+        return 0;
+    
+    // try to prefer a FRAMESET element over BODY
+    NodeImpl* body = 0;
+    for (NodeImpl* i = de->firstChild(); i; i = i->nextSibling()) {
+        if (i->id() == ID_FRAMESET)
+            return static_cast<HTMLElementImpl*>(i);
+        
+        if (i->id() == ID_BODY)
+            body = i;
+    }
+    return static_cast<HTMLElementImpl *>(body);
+}
+
+void DocumentImpl::close()
+{
+    // First fire the onload.
+    bool doload = !parsing() && m_tokenizer && !m_processingLoadEvent;
+    
+    bool wasNotRedirecting = !view() || view()->part()->d->m_scheduledRedirection == noRedirectionScheduled || view()->part()->d->m_scheduledRedirection == historyNavigationScheduled;
+    
+    m_processingLoadEvent = true;
+    if (body() && doload) {
+        // We have to clear the tokenizer, in case someone document.write()s from the
+        // onLoad event handler, as in Radar 3206524
+        delete m_tokenizer;
+        m_tokenizer = 0;
+        dispatchImageLoadEventsNow();
+        body()->dispatchWindowEvent(EventImpl::LOAD_EVENT, false, false);
+    }
+    m_processingLoadEvent = false;
+    
+    // Make sure both the initial layout and reflow happen after the onload
+    // fires. This will improve onload scores, and other browsers do it.
+    // If they wanna cheat, we can too. -dwh
+    
+    bool isRedirectingSoon = view() && view()->part()->d->m_scheduledRedirection != noRedirectionScheduled && view()->part()->d->m_scheduledRedirection != historyNavigationScheduled && view()->part()->d->m_delayRedirect == 0;
+    
+    if (doload && wasNotRedirecting && isRedirectingSoon && m_startTime.elapsed() < 1000) {
+        static int redirectCount = 0;
+        if (redirectCount++ % 4) {
+            // When redirecting over and over (e.g., i-bench), to avoid the appearance of complete inactivity,
+            // paint every fourth page.
+            // Just bail out. During the onload we were shifted to another page.
+            // i-Bench does this. When this happens don't bother painting or laying out.        
+            delete m_tokenizer;
+            m_tokenizer = 0;
+            view()->unscheduleRelayout();
+            return;
+        }
+    }
+    
+    // The initial layout happens here.
+    DocumentImpl::closeInternal(!doload);
+    
+    // Now do our painting/layout, but only if we aren't in a subframe or if we're in a subframe
+    // that has been sized already.  Otherwise, our view size would be incorrect, so doing any 
+    // layout/painting now would be pointless.
+    if (doload && (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->renderer()->needsLayout()))) {
+        updateRendering();
+        
+        // Always do a layout after loading if needed.
+        if (renderer() && (!renderer()->firstChild() || renderer()->needsLayout()))
+            view()->layout();
+    }
 }
 
 void DocumentImpl::closeInternal( bool checkTokenizer )
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index 11bc949..9adc87f 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -34,6 +34,7 @@
 #include <qobject.h>
 #include <qdict.h>
 #include <qmap.h>
+#include <qdatetime.h>
 
 #include <kurl.h>
 
@@ -254,8 +255,8 @@ public:
     void setSelection(NodeImpl* s, int sp, NodeImpl* e, int ep);
     void clearSelection();
 
-    void open (  );
-    virtual void close (  );
+    void open();
+    void close();
     void closeInternal ( bool checkTokenizer );
     void write ( const DOMString &text );
     void write ( const QString &text );
@@ -465,6 +466,8 @@ public:
     void addElementById(const DOMString &elementId, ElementImpl *element);
     void removeElementById(const DOMString &elementId, ElementImpl *element);
 
+    HTMLElementImpl* body();
+    
 signals:
     void finishedParsing();
 
@@ -556,6 +559,9 @@ protected:
 
     NodeImpl* m_cssTarget;
     
+    bool m_processingLoadEvent;
+    QTime m_startTime;
+
 #if APPLE_CHANGES
 public:
     KWQSignal m_finishedParsing;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list