[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 06:37:55 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 703b54639e020d91c8ee7970c6c88b18d876450a
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 11 00:07:03 2002 +0000

    	Fix FOUC to behave correctly.  I was smoking crack when I
    	implemented this the first time (mainly because KHTML had
    	a badly named API that didn't mean even remotely what
    	I thought it should).
    
            * khtml/html/html_headimpl.cpp:
            (HTMLLinkElementImpl::process):
            (HTMLLinkElementImpl::setStyleSheet):
            (HTMLLinkElementImpl::sheetLoaded):
            (HTMLStyleElementImpl::childrenChanged):
            (HTMLStyleElementImpl::sheetLoaded):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f6d0e07..01cc2ca 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-09-10  David Hyatt  <hyatt at apple.com>
+
+	Fix FOUC to behave correctly.  I was smoking crack when I
+	implemented this the first time (mainly because KHTML had
+	a badly named API that didn't mean even remotely what
+	I thought it should).
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+        (HTMLLinkElementImpl::setStyleSheet):
+        (HTMLLinkElementImpl::sheetLoaded):
+        (HTMLStyleElementImpl::childrenChanged):
+        (HTMLStyleElementImpl::sheetLoaded):
+
 2002-09-10  Maciej Stachowiak  <mjs at apple.com>
 
 	WebCore part of fix for:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f6d0e07..01cc2ca 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-09-10  David Hyatt  <hyatt at apple.com>
+
+	Fix FOUC to behave correctly.  I was smoking crack when I
+	implemented this the first time (mainly because KHTML had
+	a badly named API that didn't mean even remotely what
+	I thought it should).
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+        (HTMLLinkElementImpl::setStyleSheet):
+        (HTMLLinkElementImpl::sheetLoaded):
+        (HTMLStyleElementImpl::childrenChanged):
+        (HTMLStyleElementImpl::sheetLoaded):
+
 2002-09-10  Maciej Stachowiak  <mjs at apple.com>
 
 	WebCore part of fix for:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f6d0e07..01cc2ca 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-09-10  David Hyatt  <hyatt at apple.com>
+
+	Fix FOUC to behave correctly.  I was smoking crack when I
+	implemented this the first time (mainly because KHTML had
+	a badly named API that didn't mean even remotely what
+	I thought it should).
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+        (HTMLLinkElementImpl::setStyleSheet):
+        (HTMLLinkElementImpl::sheetLoaded):
+        (HTMLStyleElementImpl::childrenChanged):
+        (HTMLStyleElementImpl::sheetLoaded):
+
 2002-09-10  Maciej Stachowiak  <mjs at apple.com>
 
 	WebCore part of fix for:
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 8e73449..7f662b1 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -152,8 +152,6 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
     }
 }
 
-static bool inProcessFunction = false;
-
 void HTMLLinkElementImpl::process()
 {
     if (!inDocument())
@@ -186,28 +184,23 @@ void HTMLLinkElementImpl::process()
         // ### there may be in some situations e.g. for an editor or script to manipulate
         if( m_media.isNull() || m_media.contains("screen") || m_media.contains("all") || m_media.contains("print") ) {
             m_loading = true;
-            inProcessFunction = true;
+
+            // Add ourselves as a pending sheet.
+            getDocument()->addPendingSheet();
             
             QString chset = getAttribute( ATTR_CHARSET ).string();
             if (m_cachedSheet)
-		m_cachedSheet->deref(this);
+                m_cachedSheet->deref(this);
             m_cachedSheet = getDocument()->docLoader()->requestStyleSheet(m_url, chset);
             if (m_cachedSheet)
-		m_cachedSheet->ref(this);
-
-            // If the stylesheet was synchronously available, then our m_loading variable will have
-            // been set to false when the cached sheet above gets a ref.  In this case, we don't
-            // need to add the sheet to our list of pending sheets, because it has already loaded.
-            if (m_loading)
-                getDocument()->addPendingSheet(); // Let the document know that we're pending.
-            inProcessFunction = false;
+                m_cachedSheet->ref(this);
         }
     }
     else if (m_sheet) {
-	// we no longer contain a stylesheet, e.g. perhaps rel or type was changed
-	m_sheet->deref();
-	m_sheet = 0;
-	getDocument()->updateStyleSelector();
+        // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
+        m_sheet->deref();
+        m_sheet = 0;
+        getDocument()->updateStyleSelector();
     }
 }
 
@@ -229,7 +222,7 @@ void HTMLLinkElementImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DO
 //    kdDebug( 6030 ) << "**** current medium: " << m_media << endl;
 
     if (m_sheet)
-	m_sheet->deref();
+        m_sheet->deref();
     m_sheet = new CSSStyleSheetImpl(this, url);
     kdDebug( 6030 ) << "style sheet parse mode strict = " << ( getDocument()->parseMode() == DocumentImpl::Strict ) << endl;
     m_sheet->ref();
@@ -240,11 +233,9 @@ void HTMLLinkElementImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DO
 
     m_loading = false;
 
-    // Just tell the doc about the sheet.
-    if (!inProcessFunction)
+    // Tell the doc about the sheet.
+    if (!isLoading())
         getDocument()->stylesheetLoaded();
-    else
-        getDocument()->updateStyleSelector();
 }
 
 bool HTMLLinkElementImpl::isLoading() const
@@ -258,7 +249,8 @@ bool HTMLLinkElementImpl::isLoading() const
 
 void HTMLLinkElementImpl::sheetLoaded()
 {
-    getDocument()->updateStyleSelector();
+    if (!isLoading())
+        getDocument()->stylesheetLoaded();
 }
 
 // -------------------------------------------------------------------------
@@ -389,12 +381,14 @@ void HTMLStyleElementImpl::childrenChanged()
     
     if ((m_type.isEmpty() || m_type == "text/css") // Type must be empty or CSS
          && (m_media.isNull() || m_media.contains("screen") || m_media.contains("all") || m_media.contains("print"))) {
+        getDocument()->addPendingSheet();
         m_sheet = new CSSStyleSheetImpl(this);
         m_sheet->ref();
         m_sheet->parseString( text, (getDocument()->parseMode() == DocumentImpl::Strict) );
     }
-    
-    getDocument()->updateStyleSelector();
+
+    if (!isLoading())
+        getDocument()->stylesheetLoaded();
 }
 
 bool HTMLStyleElementImpl::isLoading() const
@@ -405,8 +399,8 @@ bool HTMLStyleElementImpl::isLoading() const
 
 void HTMLStyleElementImpl::sheetLoaded()
 {
-    if (m_sheet)
-        getDocument()->updateStyleSelector();
+    if (!isLoading())
+        getDocument()->stylesheetLoaded();
 }
 
 // -------------------------------------------------------------------------

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list