Title: [149313] trunk/Source/WebCore
Revision
149313
Author
[email protected]
Date
2013-04-29 14:06:32 -0700 (Mon, 29 Apr 2013)

Log Message

Don't check for @media rules affected by viewport changes in every layout.
<http://webkit.org/b/115370>
<rdar://problem/13765739>

Reviewed by Antti Koivisto.

Move the logic that checks if any @media rules are affected by a change in the viewport
size to FrameView::setFrameRect(). This way it's no longer necessary to do the style
recalc synchronously, which allows us to coalesce multiple updates in some cases.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::layout):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149312 => 149313)


--- trunk/Source/WebCore/ChangeLog	2013-04-29 21:00:37 UTC (rev 149312)
+++ trunk/Source/WebCore/ChangeLog	2013-04-29 21:06:32 UTC (rev 149313)
@@ -1,3 +1,19 @@
+2013-04-29  Andreas Kling  <[email protected]>
+
+        Don't check for @media rules affected by viewport changes in every layout.
+        <http://webkit.org/b/115370>
+        <rdar://problem/13765739>
+
+        Reviewed by Antti Koivisto.
+
+        Move the logic that checks if any @media rules are affected by a change in the viewport
+        size to FrameView::setFrameRect(). This way it's no longer necessary to do the style
+        recalc synchronously, which allows us to coalesce multiple updates in some cases.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        (WebCore::FrameView::layout):
+
 2013-04-29  Anders Carlsson  <[email protected]>
 
         Remove the last StorageSyncManager function

Modified: trunk/Source/WebCore/page/FrameView.cpp (149312 => 149313)


--- trunk/Source/WebCore/page/FrameView.cpp	2013-04-29 21:00:37 UTC (rev 149312)
+++ trunk/Source/WebCore/page/FrameView.cpp	2013-04-29 21:06:32 UTC (rev 149313)
@@ -476,6 +476,12 @@
     }
 #endif
 
+    // Viewport-dependent media queries may cause us to need completely different style information.
+    if (m_frame->document()->styleResolver()->affectedByViewportChange()) {
+        m_frame->document()->styleResolverChanged(DeferRecalcStyle);
+        InspectorInstrumentation::mediaQueryResultChanged(m_frame->document());
+    }
+
     if (renderView && !renderView->printing()) {
         IntSize currentSize;
         if (useFixedLayout() && !fixedLayoutSize().isEmpty() && delegatesScrolling())
@@ -1197,13 +1203,7 @@
             m_inSynchronousPostLayout = false;
         }
 
-        // Viewport-dependent media queries may cause us to need completely different style information.
-        // Check that here.
-        if (document->styleResolver()->affectedByViewportChange()) {
-            document->styleResolverChanged(RecalcStyleImmediately);
-            InspectorInstrumentation::mediaQueryResultChanged(document);
-        } else
-            document->evaluateMediaQueryList();
+        document->evaluateMediaQueryList();
 
         // If there is any pagination to apply, it will affect the RenderView's style, so we should
         // take care of that now.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to