Title: [149839] trunk/Source/WebCore
Revision
149839
Author
[email protected]
Date
2013-05-09 13:54:16 -0700 (Thu, 09 May 2013)

Log Message

A change in system environment should force all CSS properties to be recomputed.
https://bugs.webkit.org/show_bug.cgi?id=115872
<rdar://problem/13781171>

Reviewed by Antti Koivisto.

When a change in the global environment occurs, for example system colors,
we need to make sure all the CSS properties are recomputed and not fetched
from the cache. For this reason we invalidate the properties cache.
I've also renamed the function to give it a more meaningful name.
        
* page/Page.cpp:
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
* page/Page.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformColorsDidChange):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149838 => 149839)


--- trunk/Source/WebCore/ChangeLog	2013-05-09 20:35:32 UTC (rev 149838)
+++ trunk/Source/WebCore/ChangeLog	2013-05-09 20:54:16 UTC (rev 149839)
@@ -1,3 +1,22 @@
+2013-05-09  Enrica Casucci  <[email protected]>
+
+        A change in system environment should force all CSS properties to be recomputed.
+        https://bugs.webkit.org/show_bug.cgi?id=115872
+        <rdar://problem/13781171>
+
+        Reviewed by Antti Koivisto.
+
+        When a change in the global environment occurs, for example system colors,
+        we need to make sure all the CSS properties are recomputed and not fetched
+        from the cache. For this reason we invalidate the properties cache.
+        I've also renamed the function to give it a more meaningful name.
+        
+        * page/Page.cpp:
+        (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
+        * page/Page.h:
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::platformColorsDidChange):
+
 2013-05-09  Antti Koivisto  <[email protected]>
 
         Reoptimize free-standing :focus/link/visited/-webkit-any-link selectors.

Modified: trunk/Source/WebCore/page/Page.cpp (149838 => 149839)


--- trunk/Source/WebCore/page/Page.cpp	2013-05-09 20:35:32 UTC (rev 149838)
+++ trunk/Source/WebCore/page/Page.cpp	2013-05-09 20:54:16 UTC (rev 149839)
@@ -76,6 +76,7 @@
 #include "SharedBuffer.h"
 #include "StorageArea.h"
 #include "StorageNamespace.h"
+#include "StyleResolver.h"
 #include "TextResourceDecoder.h"
 #include "VisitedLinkState.h"
 #include "VoidCallback.h"
@@ -458,14 +459,20 @@
     m_group = m_singlePageGroup.get();
 }
 
-void Page::scheduleForcedStyleRecalcForAllPages()
+void Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment()
 {
     if (!allPages)
         return;
     HashSet<Page*>::iterator end = allPages->end();
     for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it)
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+            // If a change in the global environment has occurred, we need to
+            // make sure all the properties a recomputed, therefore we invalidate
+            // the properties cache.
+            if (StyleResolver* styleResolver = frame->document()->styleResolverIfExists())
+                styleResolver->invalidateMatchedPropertiesCache();
             frame->document()->scheduleForcedStyleRecalc();
+        }
 }
 
 void Page::setNeedsRecalcStyleInAllFrames()

Modified: trunk/Source/WebCore/page/Page.h (149838 => 149839)


--- trunk/Source/WebCore/page/Page.h	2013-05-09 20:35:32 UTC (rev 149838)
+++ trunk/Source/WebCore/page/Page.h	2013-05-09 20:54:16 UTC (rev 149839)
@@ -111,7 +111,7 @@
     WTF_MAKE_NONCOPYABLE(Page);
     friend class Settings;
 public:
-    static void scheduleForcedStyleRecalcForAllPages();
+    static void updateStyleForAllPagesAfterGlobalChangeInEnvironment();
 
     // It is up to the platform to ensure that non-null clients are provided where required.
     struct PageClients {

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (149838 => 149839)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2013-05-09 20:35:32 UTC (rev 149838)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2013-05-09 20:54:16 UTC (rev 149839)
@@ -1123,7 +1123,7 @@
     m_activeListBoxSelectionBackgroundColor = Color();
     m_inactiveListBoxSelectionForegroundColor = Color();
 
-    Page::scheduleForcedStyleRecalcForAllPages();
+    Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
 }
 
 Color RenderTheme::systemColor(int cssValueId) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to