[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

hyatt at apple.com hyatt at apple.com
Thu Oct 29 20:37:07 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 44194bce1d720bcecf47f04da87e5d4e79d57c92
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 1 00:13:39 2009 +0000

    Make sure the removal of user stylesheets results in all of the WebViews being updated to
    reflect the changes.
    
    Reviewed by Tim Hatcher.
    
    * page/PageGroup.cpp:
    (WebCore::PageGroup::removeUserContentWithURLForWorld):
    (WebCore::PageGroup::removeUserContentForWorld):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48951 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 45d38d5..bdae905 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2009-09-30  Dave Hyatt  <hyatt at apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Make sure the removal of user stylesheets results in all of the WebViews being updated to
+        reflect the changes.
+
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::removeUserContentWithURLForWorld):
+        (WebCore::PageGroup::removeUserContentForWorld):
+
 2009-09-30  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp
index 9d6f792..210a02a 100644
--- a/WebCore/page/PageGroup.cpp
+++ b/WebCore/page/PageGroup.cpp
@@ -253,11 +253,14 @@ void PageGroup::removeUserContentWithURLForWorld(const KURL& url, unsigned world
     
     if (m_userStyleSheets) {
         UserStyleSheetMap::iterator it = m_userStyleSheets->find(worldID);
+        bool sheetsChanged = false;
         if (it != m_userStyleSheets->end()) {
             UserStyleSheetVector* stylesheets = it->second;
             for (int i = stylesheets->size() - 1; i >= 0; --i) {
-                if (stylesheets->at(i)->url() == url)
+                if (stylesheets->at(i)->url() == url) {
                     stylesheets->remove(i);
+                    sheetsChanged = true;
+                }
             }
             
             if (stylesheets->isEmpty()) {
@@ -265,6 +268,15 @@ void PageGroup::removeUserContentWithURLForWorld(const KURL& url, unsigned world
                 delete it->second;
             }
         }
+        
+        // Clear our cached sheets and have them just reparse.
+        if (sheetsChanged) {
+            HashSet<Page*>::const_iterator end = m_pages.end();
+            for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
+                for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
+                    frame->document()->clearPageGroupUserSheets();
+            }
+        }
     }
 }
 
@@ -279,11 +291,22 @@ void PageGroup::removeUserContentForWorld(unsigned worldID)
     }
     
     if (m_userStyleSheets) {
+        bool sheetsChanged = false;
         UserStyleSheetMap::iterator it = m_userStyleSheets->find(worldID);
         if (it != m_userStyleSheets->end()) {
             m_userStyleSheets->remove(it);
+            sheetsChanged = true;
             delete it->second;
         }
+    
+        if (sheetsChanged) {
+            // Clear our cached sheets and have them just reparse.
+            HashSet<Page*>::const_iterator end = m_pages.end();
+            for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
+                for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
+                    frame->document()->clearPageGroupUserSheets();
+            }
+        }
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list