[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml/css
From:       Peter Kelly <pmk () post ! com>
Date:       2003-08-16 6:38:40
[Download RAW message or body]

CVS commit by pmk: 

Found another case where a stylesheet loading error would cause the page
to not be displayed. My previous commit fixed the case where the error
occurred on the initial loading, but not if the sheet was already in the
cache with m_hadError set.


  M +7 -2      css_ruleimpl.cpp   1.44
  M +2 -1      css_ruleimpl.h   1.25


--- kdelibs/khtml/css/css_ruleimpl.cpp  #1.43:1.44
@@ -143,4 +143,5 @@ void CSSImportRuleImpl::setStyleSheet(co
     m_styleSheet->parseString( sheet, parent ? parent->useStrictParsing() : true );
     m_loading = false;
+    m_done = true;
 
     checkLoaded();
@@ -156,4 +157,5 @@ void CSSImportRuleImpl::error(int /*err*
 
     m_loading = false;
+    m_done = true;
 
     checkLoaded();
@@ -168,4 +170,5 @@ void CSSImportRuleImpl::init()
 {
     m_loading = 0;
+    m_done = false;
     khtml::DocLoader *docLoader = 0;
     StyleBaseImpl *root = this;
@@ -200,5 +203,7 @@ void CSSImportRuleImpl::init()
       // loaded (even if our subresources haven't), so if we have stylesheet after
       // checking the cache, then we've clearly loaded. -dwh
-      if (!m_styleSheet)
+      // This can also happen when error() is called from within ref(). In either case,
+      // m_done is set to true.
+      if (!m_done)
       m_loading = true;
     }

--- kdelibs/khtml/css/css_ruleimpl.h  #1.24:1.25
@@ -126,4 +126,5 @@ protected:
     khtml::CachedCSSStyleSheet *m_cachedSheet;
     bool m_loading;
+    bool m_done;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic