Revert r149313: Don't check for @media rules affected by viewport changes in every...
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2013 14:45:45 +0000 (14:45 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2013 14:45:45 +0000 (14:45 +0000)
<rdar://problem/14277905>

Rubber-stamped by Antti Koivisto.

This changed caused more harm than good. setFrameRect() is not the only path in FrameView
that can cause media queries to need invalidation.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp

index f9d464f..90e0554 100644 (file)
@@ -1,3 +1,17 @@
+2013-07-11  Andreas Kling  <akling@apple.com>
+
+        Revert r149313: Don't check for @media rules affected by viewport changes in every layout.
+        <rdar://problem/14277905>
+
+        Rubber-stamped by Antti Koivisto.
+
+        This changed caused more harm than good. setFrameRect() is not the only path in FrameView
+        that can cause media queries to need invalidation.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        (WebCore::FrameView::layout):
+
 2013-07-11  Kangil Han  <kangil.han@samsung.com>
 
         Introduce isHTMLTitleElement and toHTMLTitleElement
index 6865a42..6c3f769 100644 (file)
@@ -480,18 +480,6 @@ void FrameView::setFrameRect(const IntRect& newRect)
     }
 #endif
 
-    // Viewport-dependent media queries may cause us to need completely different style information.
-    if (m_frame) {
-        if (Document* document = m_frame->document()) {
-            if (StyleResolver* resolver = document->styleResolverIfExists()) {
-                if (resolver->affectedByViewportChange()) {
-                    document->styleResolverChanged(DeferRecalcStyle);
-                    InspectorInstrumentation::mediaQueryResultChanged(document);
-                }
-            }
-        }
-    }
-
     sendResizeEventIfNeeded();
 }
 
@@ -1199,7 +1187,12 @@ void FrameView::layout(bool allowSubtree)
             m_inSynchronousPostLayout = false;
         }
 
-        document->evaluateMediaQueryList();
+        // Viewport-dependent media queries may cause us to need completely different style information.
+        if (document->ensureStyleResolver()->affectedByViewportChange()) {
+            document->styleResolverChanged(DeferRecalcStyle);
+            InspectorInstrumentation::mediaQueryResultChanged(document);
+        } else
+            document->evaluateMediaQueryList();
 
         // If there is any pagination to apply, it will affect the RenderView's style, so we should
         // take care of that now.